»ö« Welcome to Perl 6! | perl6.org/ | evalbot usage: 'perl6: say 3;' or rakudo:, niecza:, std:, or /msg p6eval perl6: ... | irclog: irc.perl6.org/ | UTF-8 is our friend! Set by sorear on 4 February 2011. |
|||
sorear | good * #perl6 | 00:05 | |
00:11
awoodland left
|
|||
TimToady | thou: the Set type is supposed to be immutable, because if you remove an object, it's a different set | 00:12 | |
thou | ok, so just use $s .= difference()? | 00:13 | |
TimToady | there's supposed to be a KeySet type that emulates a "mutable" set, but it's not implemented, I think | ||
so I think just use a Hash for now | |||
%hash.delete('key') in rakudo, since rakudo does not yet implement :delete | 00:14 | ||
and I think the keys are only strings at the moment | |||
set difference might work too | |||
for small sets it's probably efficient enough | 00:15 | ||
I think it does === semantics too, which is more what you want | |||
00:15
risou is now known as risou_awy
|
|||
sorear | rakudo: my $str = 'aaa'; $str--; say $str # TimToady, I am dubious of this | 00:25 | |
p6eval | rakudo ca8731: ( no output ) | ||
sorear | rakudo: my $str = 'aaa'; $str--; say $str.perl # TimToady, I am dubious of this | ||
p6eval | rakudo ca8731: OUTPUT«undef» | ||
sorear | rakudo: "foo".bytes.PARROT.say; 2.PARROT.say | 00:48 | |
p6eval | rakudo ca8731: OUTPUT«IntegerInt» | ||
sorear | #rakudobug | ||
colomon | yup | 00:55 | |
ugh | 01:01 | ||
rakudo: "foo".bytes.say | |||
p6eval | rakudo ca8731: OUTPUT«3» | ||
01:13
woosley joined
01:17
ggoebel left
01:18
dju_ joined,
dju__ left
|
|||
dalek | ecza: 2d9ebd6 | sorear++ | / (2 files): Implement Str.chom?p and sub form |
01:22 | |
ast: 46bf918 | sorear++ | S32-str/cho (2 files): Fudge chom?p for Niecza |
|||
01:22
ggoebel joined
01:26
cdarroch left
01:36
whiteknight left
02:10
ggoebel left
02:11
PacoLinux left
02:13
PacoLinux joined
02:15
ggoebel joined
02:18
PacoLinux left
02:20
PacoLinux joined
02:21
huf left
02:31
Raynes joined
02:40
ymasory joined,
ymasory left,
ymasory joined
|
|||
sorear | odd, S04-statements/goto.t tests I-don't-know-what and hardly goto at all | 02:49 | |
thou | i'm getting this error: Type objects are abstract and have no attributes, but you tried to access $!key: Code is here, am I doing something stupid, or is this something unimplemented? friendpaste.com/6CFralb4xTPxsiXlEzGkHe | 02:54 | |
sorear | that's... not how constructors work in Perl 6 | 02:55 | |
thou | ah | ||
sorear | "new" is just a static method | 02:56 | |
it doesn't have a usable "self", so it can't access $.key | |||
02:56
pjcj left
|
|||
sorear | you could do my $new = callsame(); and then $new.key =, etc | 02:56 | |
02:56
pjcj joined
|
|||
thou | and then return $new at the end | 02:57 | |
sorear | yes | ||
alternately, nextwith(self, key => $key, val => $val, color => True) | |||
this can be shortened to nextwith(self, :$key, :$val, :color) | 02:58 | ||
thou | ok, good! | 02:59 | |
sorear | you could also add " = True" to has $.color | 03:00 | |
thou | nextwith handles MMD and inheritance, right? | ||
sorear | yes | ||
thou | yes, i'm sure there's a bunch of tweaks i can make; i'm right now transliterating directly from the paper, and hopefully will get something working and then perhaps make it more perlish | 03:01 | |
sorear | actually you don't want to use callsame() here, since Mu.new doesn't take $key and $val | ||
it should be callwith(self) | |||
thou | the book has: return self.bless(*, :&callback, :@dependencies); | 03:02 | |
with a =for author what is * here? | |||
but i haven't gotten to the synopsis that goes over this yet, so i'm kind of just shooting from the hip and hoping i guess right | 03:03 | ||
which probably is a waste of your time, but i do appreciate the pointers. | |||
sorear | Mu.bless is basically the same as Mu.new | 03:04 | |
the main difference is that people don't override bless normally | |||
also bless takes a first argument of * | |||
the * is reserved for future use; there has been speculation that it will enable passing strings to pick alternate object storage systems | 03:05 | ||
thou | sorear: i switched to nextwith(self, :$key, :$val, :color<True>), and it now says: too many positional arguments: 2 passed, 1 expected (pointing at the Node.new($key, $val) call): friendpaste.com/6CFralb4xTPxsiXlEzGkHe | 03:13 | |
i also tried my $new = callwith(self); $new.key = ... | 03:14 | ||
with the same result (2 passed, 1 expected) | |||
maybe i need to study some actual code | |||
i'll spend some time looking at modules.perl6.org/ | 03:15 | ||
sorear: ok, for now i just deleted my new() method altogether, and call Node.new(:$key, :$value, :color<True>). thanks for your time! | 03:19 | ||
03:24
agentzh joined
|
|||
sorear | odd. | 03:25 | |
03:27
Su-Shee left
03:29
Su-Shee joined
03:37
Baggio joined
|
|||
dalek | ecza: ae1c75a | sorear++ | / (2 files): Implement =:= |
03:40 | |
ecza: 75aee84 | sorear++ | src/niecza: Parse and ignore "returns" annotations on subs and methods |
|||
ecza: 0c0d65d | sorear++ | lib/CORE.setting: Allow [op] to work with Mu |
|||
03:40
Baggio left
03:41
Baggio joined,
Baggio left
|
|||
sorear | pmichaud: nextsame() in rakudo is doing funny stuff with 'self' that I can't find anywhere in S06 or S12 | 03:47 | |
perl6: class A { method f(|$x) { say $x.perl } }; class B is A { method f() { nextwith(self,1,2) } }; B.f | 03:48 | ||
p6eval | rakudo ca8731, niecza v5-19-g2d9ebd6: OUTPUT«\(B, 1, 2)» | ||
..pugs: OUTPUT«*** No such subroutine: "&nextwith" at /tmp/LD9rKgHdHP line 1, column 72-91» | |||
sorear | double odd | 03:49 | |
perl6: class A { method f(*@x) { say [self, @x].perl } }; class B is A { method f() { nextwith(self,1,2) } }; B.f | |||
p6eval | rakudo ca8731: OUTPUT«[B, B, 1, 2]» | ||
..niecza v5-19-g2d9ebd6: OUTPUT«[B, 1, 2]» | |||
..pugs: OUTPUT«*** No such subroutine: "&nextwith" at /tmp/l8esOnDY6_ line 1, column 80-99» | |||
pmichaud | sorear: you'd have to chat with jnthn++ about that. also keep in mind that nextsame and protos have changed a bit since nextsame() was implemented in Rakudo | 03:57 | |
I suspect jnthn is fixing it in nom rather than try to keep Rakudo master up to date | 03:58 | ||
sorear | rakudo: role A { method x(@foo:) { say +[ self ] } }; ([1,2,3] but A).x | 04:02 | |
p6eval | rakudo ca8731: OUTPUT«3» | ||
sorear | I beleive this is wrong. | ||
04:03
alc joined
04:30
takesako joined
|
|||
sorear | rakudo: say defined 1 && 0 | 04:35 | |
p6eval | rakudo ca8731: OUTPUT«0» | ||
sorear | rakudo: say cos 1 && 0 | ||
p6eval | rakudo ca8731: OUTPUT«1» | ||
sorear | I wonder whether I should reply to pmichaud's post to say that so, not, abs, and defined follow different rules | 04:37 | |
(in niecza, -defined +sleep) | 04:38 | ||
04:43
alc left
04:44
alc joined
|
|||
pmichaud | probably wouldn't hurt to mention that some identifiers are in fact prefix ops | 04:51 | |
I've been a little distracted trying to get the parrot/zavolaj nci issues worked out in time for the parrot release (~2 hrs from now) | 04:52 | ||
05:00
molaf joined
05:02
kaare_ joined
05:07
Zapelius left
05:08
koban joined,
koban left
05:10
koban joined
05:13
noganex_ joined
05:14
sftp left
05:17
noganex left,
birdwindupbird joined
05:18
mtk left
05:20
ymasory left
05:26
mtk joined
|
|||
sorear | std: sub foo(;;: ;;: ;;) { } | 05:34 | |
p6eval | std a71faea: OUTPUT«ok 00:01 113m» | ||
sorear | what does that even mean | ||
moritz | good morning | 05:40 | |
tadzik | good morning | 05:41 | |
nebuchadnezzar | good morning | ||
sorear | hello | 05:44 | |
05:57
wtw_ joined
|
|||
pmichaud | gist.github.com/976023 # patch to enable zavolaj to work again on recent parrots | 05:59 | |
06:01
wtw_ is now known as wtw
|
|||
tadzik | are you pushing this? | 06:04 | |
dalek | ecza: bc9e1bc | sorear++ | / (8 files): Explicit invocants alias, not replace, self |
06:25 | |
sorear | time to update my mono; I'm getting nondeterministic crashes with the last change | ||
sorear wonders if maybe ey should switch to mono 2.10 | 06:32 | ||
delightful bug of the day | 06:36 | ||
niecza: if 1 { my Str $s = 12 }; say "alive" | 06:37 | ||
p6eval | niecza v5-23-gbc9e1bc: OUTPUT«Potential difficulties: $s is declared but not used at /tmp/w3ycGZqgnN line 1:------> if 1 { my Str $s⏏ = 12 }; say "alive"alive» | ||
sorear | niecza: my Str $s = 12; say "alive" | ||
p6eval | niecza v5-23-gbc9e1bc: OUTPUT«Unhandled exception: Nominal type check failed for scalar store; got Num, needed Str or subtype at /tmp/NpeI8mpQbo line 1 (MAIN mainline @ 1) at /home/p6eval/niecza/lib/CORE.setting line 1390 (CORE C567_ANON @ 2) at /home/p6eval/niecza/lib/CORE.setting line 1391 | ||
..(CORE module-… | |||
TimToady | that's the first bug in my todo file | 06:38 | |
sorear | TimToady: I'm not referring to the warning ... | ||
niecza ignores type constraints that are inside bare blocks | |||
TimToady | ah | 06:39 | |
sorear | somehow | ||
(possibly an inliner glitch?) | |||
jdhore | moritz, 'morning | ||
sorear | hello jdhore. | ||
er | |||
sorry, I'm not moritz. | |||
jdhore | OR ARE YOU?! | ||
sorear | well I don't have a kid, I'm not living in Germany, ... | 06:40 | |
jdhore | oh, I didn't know moritz had a kid | ||
moritz | that's a rather new development :-) | 06:46 | |
or newish, I should say | 06:47 | ||
06:48
domidumont joined
|
|||
jdhore | ah | 06:50 | |
moritz, Well i am definetly up for a release on Thursday | |||
moritz | that's great | 06:52 | |
jdhore | and I haven't been around much because i'm sort of spreading myself rather thin with IRC, plus i'm kind of an idiot when it comes to deep internals of a programming language like P6 and it's been very low-level stuff in here lately so I wouldn't have had much to contribute :) | 06:54 | |
moritz | that's ok, I was just asking :-) | 06:55 | |
dalek | ecza: 334e133 | sorear++ | / (3 files): Fix type constraints being ignored in inlined blocks |
07:01 | |
sorear | jdhore: what would you consider "not low level" stuff? | 07:02 | |
jdhore | sorear, I'm not sure exactly | ||
It also doesn't help that I generally have no idea what i'm doing | |||
dalek | ecza: 48b90b7 | sorear++ | t/spectest.data: We pass S12-methods/chaining.t now |
07:04 | |
sorear | making that test file work required fixing a bug with type constraints, sprinkling 'Mu' in appropriate places in the setting, making $!foo work in methods with a named invocant, adding =:=, and gracefully ignoring "returns" | 07:05 | |
maybe it'll benefit other test files? | 07:06 | ||
jdhore: what does releasing Rakudo require? | 07:07 | ||
moritz | mostly writing an announcement and following instructions | 07:08 | |
jdhore | sorear, github.com/rakudo/rakudo/blob/mast..._guide.pod | ||
Yeah, basically :D | |||
sorear | niecza: say Pair | 07:10 | |
p6eval | niecza v5-23-gbc9e1bc: OUTPUT«Unhandled exception: Attempted to access slot key of type object for Pair at /home/p6eval/niecza/lib/CORE.setting line 0 (CORE key @ 0) at /home/p6eval/niecza/lib/CORE.setting line 859 (CORE Pair.Str @ 2) at line 0 (ExitRunloop @ 0) at | 07:11 | |
../home/p6eval/niecza/lib/CORE.setting … | |||
sorear | niecza: class :: is Str { } | 07:14 | |
p6eval | niecza v5-23-gbc9e1bc: OUTPUT«Unhandled exception: Unable to resolve method ast in class Any at /home/p6eval/niecza/src/NieczaActions.pm6 line 162 (NieczaActions NieczaActions.morename @ 6) at line 0 (ExitRunloop @ 0) at /home/p6eval/niecza/src/STD.pm6 line 344 (STD STD.morename @ 23) at | ||
../home/p6eval/n… | |||
07:18
lue left
07:19
lue joined
|
|||
sorear out | 07:19 | ||
mberends | patched zavolaj locally with gist.github.com/976023 from pmichaud++, the examples die with 'Parent of PCT;Grammar is null' on current Rakudo, so I assume there is an unpushed Rakudo commit still to come. | 07:25 | |
07:26
mj41 joined
|
|||
mberends | (prior to the patch, only the unix-fork example ran, and used about 52MB per Rakudo process (i386), smaller than it used to be, istr) | 07:30 | |
moritz | phenny: tell sorear that t/spec/S05-grammar/action-stubs.t passes 13 tests and fails a few, might be worth looking at | 07:32 | |
phenny | moritz: I'll pass that on when sorear is around. | ||
07:43
Zapelius joined
07:45
lue left,
lue joined,
Zapelius left
07:46
awoodland joined
08:00
wamba joined
08:02
f00li5h left
08:03
tzhs joined
|
|||
moritz | niezca: my @a = qw/1 2 3/; say ~@a.push('b') | 08:20 | |
niecza: my @a = qw/1 2 3/; say ~@a.push('b') | |||
p6eval | niecza v5-25-g48b90b7: OUTPUT«» | ||
TiMBuS | is the nom branch meant to compile yet | ||
moritz | no | 08:21 | |
dalek | ast: e6c9e36 | moritz++ | S32-array/push.t: fudge push.t for niecza |
||
TiMBuS | aw | 08:22 | |
dalek | ast: 32c4ff6 | moritz++ | S32-array/push.t: fix typo in previous commit |
||
08:35
awoodland left
08:38
dakkar joined
08:46
awoodland joined
|
|||
dalek | ecza: 70169ab | moritz++ | t/spectest.data: run three more test files |
08:50 | |
09:00
dalek left
09:01
dalek joined,
ChanServ sets mode: +v dalek,
p6eval left
09:02
f00li5h joined
09:03
p6eval joined,
ChanServ sets mode: +v p6eval
09:06
MayDaniel joined
09:18
awoodland left
09:42
tzhs left
09:46
MayDaniel left
09:48
woosley left
09:50
SHODAN joined
10:01
snearch joined
10:04
[Coke] left
10:06
[Coke] joined
|
|||
dalek | kudo: 5f1bf60 | moritz++ | build/PARROT_REVISION: bump PARROT_REVISION to 3.4.0 release |
10:13 | |
10:25
thou left
10:53
daemon left
10:55
daemon joined
11:06
Patterner left
11:07
dur-randir joined,
Psyche^ joined,
Psyche^ is now known as Patterner
11:10
huf joined
11:13
Trashlord joined
11:16
woosley joined
11:34
woosley left
11:48
colomon left
11:51
Trashlord left
12:08
BinGOs left
12:10
BinGOs joined,
wknight8111 joined
12:16
bluescreen10 joined
12:20
bluescreen10 left
12:31
pernatiy left,
wamba left
12:32
wamba joined,
leprevost joined,
proller joined
12:35
bluescreen10 joined
12:36
mtk left
12:40
mtk joined
12:52
Zapelius joined
13:00
Zapelius left
13:04
pernatiy joined,
Holy_Cow joined
13:06
Holy_Cow left
13:07
JimmyZ joined
13:19
IllvilJa left,
literal__ joined,
literal__ left
13:20
mtk left
13:21
mtk joined
13:22
jfried left
13:26
Vlavv` joined
13:29
donri joined
13:30
Vlavv_ left
13:31
mberends left
13:33
snearch left
13:34
Sarten-X left
13:36
mberends joined
13:41
tzhs joined
13:42
wamba left
13:45
Sarten-X joined
13:51
wamba joined
13:53
silent_h_ joined
13:56
koban left
14:01
wamba left
14:06
dur-randir left
|
|||
pmichaud | good morning, #perl6 | 14:07 | |
moritz | good am, pm | ||
PerlJam | greets pm | 14:08 | |
JimmyZ | good morning pm | ||
14:08
agentzh left
14:09
Trashlord joined
14:10
alester left
|
|||
TimToady | 你好 | 14:11 | |
14:17
alc left
14:20
literal joined,
literal left
14:21
literal joined
14:22
literal left
14:24
literal joined
14:25
sftp joined
14:26
literal left
14:27
literal joined,
dur-randir joined
14:31
bluescreen10 left
14:33
Trashlord left
14:35
ymasory joined
|
|||
moritz | .u plus-minus | 14:35 | |
phenny | U+00B1 PLUS-MINUS SIGN (±) | ||
14:36
Trashlord joined
|
|||
moritz | phenny++ # Unicode enabling this dumb input system | 14:38 | |
TimToady | .u ∓ | 14:39 | |
phenny | U+2213 MINUS-OR-PLUS SIGN (∓) | ||
TimToady | .u minus.*plus | 14:40 | |
phenny | U+2213 MINUS-OR-PLUS SIGN (∓) | ||
moritz | pmichaud++ # #phasers pre-report | 14:41 | |
ingy | o/ | 14:43 | |
14:44
bluescreen10 joined
|
|||
ingy | TimToady: 你好吗 | 14:44 | |
14:44
colomon joined,
wtw left
|
|||
ingy | TimToady: have you seen skritter.com? | 14:45 | |
I'm totally hooked | |||
been using it a couple months | |||
TimToady doesn't need another hookage at the moment... | |||
ingy | got my bamboo drawing pad and all | 14:46 | |
TimToady: try the 5 min demo | |||
srsly | |||
just try for 2 mins | |||
I can actually write all the chinese I know, legibly now | 14:48 | ||
JimmyZ | 大家好 | 14:49 | |
ingy hopes he hasn't ruined the future of perl 6 | 14:51 | ||
as he drifts off to sleep on the other side of the equator | 14:52 | ||
14:53
dur-randir left
14:56
Trashlord left
14:57
mishnick joined
14:59
mishnick_ joined
15:00
mishnick left
15:01
SHODAN left,
spinclad left
15:03
proller left,
proller_ joined
15:04
mishnick_ left,
Lorn left
15:09
Trashlord joined
15:10
dur-randir joined
15:12
risou_awy is now known as risou,
risou_ joined
|
|||
jdv79 | jnthn: wow, blog posts since february. thanks! very exciting news:) | 15:19 | |
15:20
leprevost left
15:21
Trashlord left
15:23
Trashlord joined,
alester joined
15:31
Lorn joined
15:36
tzhs left
15:39
MayDaniel joined
15:42
snearch joined
15:44
MayDaniel left
15:45
Trashlord left
15:48
Trashlord joined
|
|||
moritz | tadzik: the reason I did so much work on the test suite was that I mentored a GSOC project that cleaned up and enhanced the test suite. So I thought I better know something about before the project starts :-) | 15:49 | |
tadzik: and somehow I got stuck with it | 15:50 | ||
tadzik: so mentoring your pod parsing stuff sounds much easier, since I roughly know what Pod6 is supposed to look like, and I've written parsers before :-) | |||
15:51
mj41 left
|
|||
tadzik | :) | 15:55 | |
15:57
[particle] left
16:01
newbee joined
16:03
[particle]1 joined
|
|||
newbee | rakudo: class A { has @.data is rw; submethod BUILD {push @.data, 1, 2, 3}; }; my $a = A.new; say $a.perl; | 16:03 | |
p6eval | rakudo 5f1bf6: OUTPUT«A.new(data => [1, 2, 3])» | ||
newbee | rakudo: class A { has @.data is rw; submethod BUILD {push @.data, 1, 2, 3}; }; my $a = A.new; say $a.data.perl; | 16:04 | |
p6eval | rakudo 5f1bf6: OUTPUT«[1, 2, 3]» | ||
newbee | rakudo: class A { has @.data is rw; submethod BUILD {push @.data, 1, 2, 3}; }; my $a = A.new; say @a.data.perl; | ||
p6eval | rakudo 5f1bf6: OUTPUT«===SORRY!===Symbol '@a' not predeclared in <anonymous> (/tmp/q2bJLcNwb9:22)» | ||
16:05
Trashlord left
|
|||
moritz | newbee: use @!a in BUILD | 16:05 | |
16:06
Retromingent joined
|
|||
newbee | rakudo: class A { has @.data is rw; submethod BUILD {push @.data, 1, 2, 3}; }; my $a = A.new; say $a.data.elems; | 16:06 | |
16:06
Retromingent left
|
|||
p6eval | rakudo 5f1bf6: OUTPUT«3» | 16:06 | |
16:06
cdarroch joined,
cdarroch left,
cdarroch joined
|
|||
newbee | thanks moritz... but $. works, why should i use $! ? | 16:06 | |
16:06
Retromingent joined
|
|||
moritz | newbee: because in BUILD the object isn't fully constructed yet, so the more low-level construct is safer | 16:07 | |
16:07
domidumont left
|
|||
TimToady | std: class A { has @.data is rw; submethod BUILD {push @.data, 1, 2, 3} } | 16:07 | |
p6eval | std a71faea: OUTPUT«===SORRY!===Virtual call @.data may not be used on partially constructed object at /tmp/Xq94M6tS_g line 1:------> has @.data is rw; submethod BUILD {push ⏏@.data, 1, 2, 3} }Check failedFAILED 00:01 117m» | ||
moritz | newbee: also you'll sometimes want to use non-rw attributes, then you *have* to use @!a. Better get used to it :-) | 16:08 | |
newbee | i'm a little confused....$! mean "private" and $. means "public" ? | 16:09 | |
TimToady | no, $. means abstract, and $! means concrete | 16:10 | |
but you're correct insofar as the general public are allowed to see only the abstract interface | |||
and the implementation is not allowed to use the abstract interface until the concrete guts of the object are constructed | 16:11 | ||
so you can think of them as public and private, but it's more like $. is a virtual method call, while $! is the actual storage slot | 16:12 | ||
tadzik | I always read $. as "has a public accessor" | ||
TimToady | which is virtual :) | 16:13 | |
tadzik | and $! as "is an object attribute" | ||
virtual in what way? | |||
moritz | but outside 'has', $.foo really means self.foo or self.foo.item or so | ||
TimToady | it calls back via self, which may be more derived than ::?CLASS | ||
tadzik | mhm | ||
TimToady | so your children are allowed to override the meaning of your attribute | 16:14 | |
sometimes you want to talk to your children, and sometimes you don't... :) | |||
16:14
spq joined
|
|||
tadzik | the meaning of the attribute, or the accessor? | 16:14 | |
16:14
newbee_ joined
|
|||
TimToady | the meaning of the abstract attribute | 16:15 | |
newbee_ | yes, but is better to think about it in terms of "concrete" and "abstract". All this time i was thinking on "public" and "private" hence my confusion | ||
tadzik | when in Perl, I rarely think Public and Private :) | 16:16 | |
16:16
newbee left,
[particle]1 left
|
|||
TimToady | or think of it as "interface" vs "implementation" | 16:17 | |
16:17
bluescreen10 left
|
|||
TimToady | or as "on the record" vs "off the record", if you're a politician... | 16:17 | |
16:17
bluescreen10 joined
16:18
Trashlord joined
|
|||
newbee_ | $! = attribute needed for the implementation; $. = "interface" attribute | 16:18 | |
TimToady | or "de jure" vs "de facto" | 16:19 | |
newbee_ | what if i want a variable to be both? | ||
tadzik | the second one is not a variable :> | 16:20 | |
btw: does $!a is rw; make any sense? | 16:21 | ||
newbee_ | example.... a class that analizes a text file. I want to specify on BUILD time the $!filename. But i want to change it later so the same object analizes another file. | ||
tadzik | newbee_: you can always change it later. But when you want a read-write accesor from the outside world, is rw is the way | ||
rakudo: class Foo { has $.a is rw; }; my $a = Foo.new(a => 5); $a.a = 'b'; $a.a.say | 16:22 | ||
p6eval | rakudo 5f1bf6: OUTPUT«b» | ||
TimToady | but from a functional programming point of view, modifying your object's is likely to be poor design | 16:23 | |
FP tends to prefer immutable objects | |||
s/"'s"// | |||
16:23
p6eval left
16:25
p6eval joined,
ChanServ sets mode: +v p6eval,
grzniuk joined
16:26
grzniuk left
16:27
[particle] joined
|
|||
JimmyZ thought one is public and another is private and there is no protected | 16:28 | ||
TimToady | public/private is more about different kinds of access to the same kind of thing | 16:29 | |
$! and $. are about different kinds of things | |||
"physical" vs "logical" | 16:30 | ||
"is rw" is more about access (but only controls write access) | |||
JimmyZ | they are more like lvalue methods ? | 16:31 | |
TimToady | yes, you get readonly accessors otherwise | ||
16:34
newbee_ left
|
|||
TimToady | normal "logical" attributes declared with $. are "look but don't touch", whereas "$. is rw" is, er, more promiscuous... | 16:35 | |
16:36
Trashlord left
|
|||
TimToady | private vs public works as a metaphor, as long as you understand that your public personna can change every time you mixin a new role | 16:38 | |
new roles can put wrappers or derived methods around your own accessors | 16:39 | ||
16:39
newbee__ joined,
Trashlord joined
16:42
[particle] left
16:43
M_o_C joined
|
|||
JimmyZ sleeps | 16:44 | ||
16:44
JimmyZ left
16:50
Trashlord left
16:52
Trashlord joined
16:53
mtk left,
newbee__ left
16:54
mtk joined,
aindilis left
16:55
aindilis` joined
16:56
dakkar left
16:57
mishnick joined
|
|||
mishnick | join #perl | 16:58 | |
16:58
mishnick left,
newbee_ joined
16:59
Vlavv` left
17:00
p6eval left
17:01
p6eval joined,
ChanServ sets mode: +v p6eval
17:02
mtk left
17:03
mtk joined,
thou joined
17:04
Trashlord left
17:06
birdwindupbird left,
xinming_ left,
Vlavv` joined
17:07
[particle]1 joined,
xinming joined
17:08
[particle]1 is now known as [particle]
17:10
wamba joined,
dsouza left
17:12
hercynium joined
|
|||
newbee_ | what does this error mean: "get_attr_str() not implemented in class 'Sub'"? | 17:12 | |
tadzik | that means something is broken | 17:13 | |
colomon | quite likely both your code and Rakudo. :) | 17:15 | |
tadzik | could be :) | 17:16 | |
17:19
icwiener joined
|
|||
colomon | newbee_: what I'm trying to say is, most likely Rakudo responded to your broken code in a broken fashion. It's hard to get more specific without seeing the code in question. (And it might merely be a Rakudo bug, I've run into that message a few times recently myself.) | 17:29 | |
newbee_ | rakudo: class Holidays { has DateTime @.hd is rw; has submethod BUILD(@dates) { for (@dates) {push @.hd, $_~'T00:00:00Z';} }; }; my $h = Holidays.new("2011-01-01T00:00:00Z", "2011-12-25T00:00:00Z"); say $h.perl; | 17:34 | |
p6eval | rakudo 5f1bf6: OUTPUT«Not enough positional parameters passed; got 1 but expected 2 in 'Holidays::BUILD' at line 22:/tmp/aQ0JU1_MRK in main program body at line 22:/tmp/aQ0JU1_MRK» | ||
newbee_ | rakudo: class Holidays { has DateTime @.hd is rw; has submethod BUILD(*@dates) { for (@dates) {push @.hd, $_~'T00:00:00Z';} }; }; my $h = Holidays.new("2011-01-01T00:00:00Z", "2011-12-25T00:00:00Z"); say $h.perl; | ||
p6eval | rakudo 5f1bf6: OUTPUT«Holidays.new(hd => [])» | ||
newbee_ | i expected at least an exception because T00:00:00Z was repeated, but it seems that BUILD ignores the args... or i'm doing something very wrong (very likely) | 17:36 | |
Juerd | That T in there was a huge mistake | ||
By the ISO people | |||
colomon | rakudo: class Holidays { has @.hd is rw; has submethod BUILD(*@dates) { for (@dates) {push @.hd, $_~'T00:00:00Z';} }; }; my $h = Holidays.new("2011-01-01T00:00:00Z", "2011-12-25T00:00:00Z"); say $h.perl; | 17:38 | |
p6eval | rakudo 5f1bf6: OUTPUT«Holidays.new(hd => [])» | ||
colomon | rakudo: class Holidays { has @.hd is rw; has submethod BUILD(*@dates) { say "I got called!"; for (@dates) {push @.hd, $_~'T00:00:00Z';} }; }; my $h = Holidays.new("2011-01-01T00:00:00Z", "2011-12-25T00:00:00Z"); say $h.perl; | ||
p6eval | rakudo 5f1bf6: OUTPUT«I got called!Holidays.new(hd => [])» | ||
newbee_ | rakudo: class Holidays { has DateTime @.hd is rw; submethod BUILD(*@dates) { for (@dates) {push @.hd, $_~'T00:00:00Z';} }; }; my $h = Holidays.new("2011-01-01", "2011-12-25"); say $h.perl; | 17:39 | |
p6eval | rakudo 5f1bf6: OUTPUT«Holidays.new(hd => [])» | ||
newbee_ | rakudo: class Holidays { has DateTime @.hd is rw; submethod BUILD(*@dates) { for (@dates) {push @!hd, $_~'T00:00:00Z';} }; }; my $h = Holidays.new("2011-01-01", "2011-12-25"); say $h.perl; | ||
p6eval | rakudo 5f1bf6: OUTPUT«Holidays.new(hd => [])» | ||
colomon | rakudo: class Holidays { has @.hd is rw; has submethod BUILD(*@dates) { say "I got called!"; for (@dates) {say "a"; push @.hd, $_~'T00:00:00Z';} }; }; my $h = Holidays.new("2011-01-01T00:00:00Z", "2011-12-25T00:00:00Z"); say $h.perl; | 17:40 | |
p6eval | rakudo 5f1bf6: OUTPUT«I got called!Holidays.new(hd => [])» | ||
colomon | so there's nothing in @dates. | 17:41 | |
17:41
Chillance joined
|
|||
colomon has to admit he doesn't remember how BUILD is supposed to work. | 17:41 | ||
newbee_ | :( | 17:42 | |
colomon | rakudo: class Holidays { has @.hd is rw; submethod BUILD(*@dates) { say "I got called!"; for (@dates) {say "a"; push @.hd, $_~'T00:00:00Z';} }; }; my $h = Holidays.new("2011-01-01T00:00:00Z", "2011-12-25T00:00:00Z"); say $h.perl; | ||
p6eval | rakudo 5f1bf6: OUTPUT«I got called!Holidays.new(hd => [])» | ||
newbee_ | well... i tried too using @dates without *, but didn't work: "Not enough positional parameters passed; got 1 but expected 2". | 17:43 | |
17:44
impious joined
|
|||
colomon | oh, that's a sign right there. | 17:44 | |
The one it got was "self" | |||
newbee_ | rakudo: class Holidays { has DateTime @.hd is rw; submethod BUILD(@dates) { say @dates.perl }; }; my @d=<2011-01-01 2011-12-25>; my $h = Holidays.new(@d); | 17:45 | |
p6eval | rakudo 5f1bf6: OUTPUT«Not enough positional parameters passed; got 1 but expected 2 in 'Holidays::BUILD' at line 22:/tmp/Xe6HNQJkoH in main program body at line 22:/tmp/Xe6HNQJkoH» | ||
colomon | by making it *@dates, you allowed the empty array as an option passing in | ||
TimToady | this is all bogus | ||
new and BUILD take named params | |||
colomon | TimToady: hey, we were just getting there. | ||
TimToady | *only* | ||
colomon | by process of elimination | 17:46 | |
default new, you mean. | |||
TimToady | I see no redef of new there... | ||
colomon | right, you're right about this code. | ||
TimToady | yes, default new, but BUILD is always called with named parames | 17:47 | |
17:47
JodaZ left
|
|||
TimToady | *ms | 17:47 | |
colomon | I'm just saying you're allowed to write a new method which takes positional params. | ||
TimToady | er, named args... | ||
sure, but ya can't do it by changing BUILD's sig | 17:48 | ||
newbee_ | rakudo: class Holidays { has DateTime @.hd is rw; submethod BUILD(@dates) { say @dates.perl }; }; my @d=<2011-01-01 2011-12-25>; my $h = Holidays.new(dates=>@d); | ||
17:48
JodaZ joined
|
|||
p6eval | rakudo 5f1bf6: OUTPUT«["2011-01-01", "2011-12-25"]» | 17:48 | |
newbee_ | rakudo: class Holidays { has DateTime @.hd is rw; submethod BUILD(*@dates) { for (@dates) {push @!hd, $_~'T00:00:00Z';} }; }; my $h = Holidays.new(dates=><2011-01-01 2011-12-25>); say $h.perl; | ||
p6eval | rakudo 5f1bf6: OUTPUT«Holidays.new(hd => [])» | ||
17:49
pernatiy left
|
|||
TimToady | newbee_: you can't use a slurpy parameter in a BUILD, is one result of what I said earlier | 17:49 | |
colomon | rakudo: class Holidays { has @.hd is rw; submethod BUILD(:@dates) { say "I got called!"; for (@dates) {say "a"; push @.hd, $_~'T00:00:00Z';} }; }; my $h = Holidays.new(:dates(["2011-01-01T00:00:00Z", "2011-12-25T00:00:00Z"])); say $h.perl; | 17:50 | |
p6eval | rakudo 5f1bf6: OUTPUT«I got called!aaHolidays.new(hd => ["2011-01-01T00:00:00ZT00:00:00Z", "2011-12-25T00:00:00ZT00:00:00Z"])» | ||
colomon | TimToady++ # rescuing me from spending the next hour trying to figure that out via trial and error | ||
TimToady: is there somewhere in the spec that explains BUILD? I started looking in S12, and I've seen a bunch of references to it, but nothing so far that explains how it is expected to be used. | 17:51 | ||
newbee_: why are you trying to use BUILD instead of overloading new, anyway? | 17:52 | ||
newbee_ | BUILD is the way to make constructors ??? | ||
tadzik | not exactly | ||
...but I'm not an expert in the field :) | 17:53 | ||
colomon | rakudo: class Holidays { has @.hd is rw; multi method new(*@dates) {for (@dates) {push @.hd, $_~'T00:00:00Z';} }; }; my $h = Holidays.new("2011-01-01T00:00:00Z", "2011-12-25T00:00:00Z"); say $h.perl; | ||
p6eval | rakudo 5f1bf6: OUTPUT«Type objects are abstract and have no attributes, but you tried to access @!hd in <anon> at line 22:/tmp/Ng0cYcb_yv in 'Holidays::new' at line 1 in main program body at line 22:/tmp/Ng0cYcb_yv» | ||
colomon | errr... | 17:54 | |
TimToady | it's all(?) explained in S12:748 | ||
colomon | rakudo: class Holidays { has @.hd is rw; multi method new(*@dates) { bless(*, :hd(@dates)); }; }; my $h = Holidays.new("2011-01-01T00:00:00Z", "2011-12-25T00:00:00Z"); say $h.perl; | ||
p6eval | rakudo 5f1bf6: OUTPUT«Could not find sub &bless in 'Holidays::new' at line 22:/tmp/nvUWNf3wCm in main program body at line 22:/tmp/nvUWNf3wCm» | ||
colomon | urk | ||
rakudo: class Holidays { has @.hd is rw; multi method new(*@dates) { self.bless(*, :hd(@dates)); }; }; my $h = Holidays.new("2011-01-01T00:00:00Z", "2011-12-25T00:00:00Z"); say $h.perl; | 17:55 | ||
p6eval | rakudo 5f1bf6: OUTPUT«Holidays.new(hd => ["2011-01-01T00:00:00Z", "2011-12-25T00:00:00Z"])» | ||
colomon | there you are | ||
moritz | newbee_: perlgeek.de/blog-en/perl-6/object-c...ation.html | ||
newbee_ | :D | ||
colomon | of course, that doesn't do what you wanted with DateTime... | ||
newbee_ | class Holidays { has DateTime @.hd is rw; submethod BUILD(@dates) { for (@dates) {push @!hd, $_~'T00:00:00Z';} }; }; my $h = Holidays.new(dates => <2011-15-99 2011-12-25>); say $h.perl; | 17:56 | |
rakudo: class Holidays { has DateTime @.hd is rw; submethod BUILD(@dates) { for (@dates) {push @!hd, $_~'T00:00:00Z';} }; }; my $h = Holidays.new(dates => <2011-15-99 2011-12-25>); say $h.perl; | |||
p6eval | rakudo 5f1bf6: OUTPUT«Holidays.new(hd => ["2011-15-99T00:00:00Z", "2011-12-25T00:00:00Z"])» | ||
17:56
Zapelius joined
17:57
Zapelius left
17:58
brill joined
|
|||
newbee_ | i will try to use 'new' instead of BUILD from now on... the thing is, i expected an exception for 2011-15-99 as a DateTime | 17:58 | |
17:58
Zapelius joined
|
|||
colomon | I don't think Rakudo implements types on class members yet. | 17:58 | |
17:58
p6eval left,
M_o_C left
|
|||
newbee_ | ahh,, it's ok then :) | 17:59 | |
17:59
brill left,
hercynium left,
p6eval joined,
ChanServ sets mode: +v p6eval
|
|||
moritz | .oO( fix in ... ) |
18:00 | |
newbee_ | sorry for all these newbee questions... i'll try to not honor my nickname so much from now on :) | ||
18:01
brill joined,
p6eval left,
impious left
18:02
p6eval joined,
ChanServ sets mode: +v p6eval
|
|||
moritz | newbee_: that's ok, there's not too much material for learning Perl 6 otherwise yet | 18:04 | |
brill | Sorry? Just went online. What is the best material for learning Perl 6 right now? | 18:06 | |
tadzik | are you a Perl5-er? | ||
moritz | brill: asking here, "Using Perl 6" and a few blogs out there | ||
perl6.org/documentation/ | 18:07 | ||
brill | Yes. I dabbled a bit with Perl 5. | ||
tadzik | oh, I remember fixing this page to be helpful to everyone :) | ||
moritz | brill: perlgeek.de/en/article/5-to-6 maybe | ||
tadzik | oh, I could also add "Write about Pod6 for the Perl 6 Book" to my proposal | ||
brill | Thanks all. | 18:08 | |
18:16
proller_ left
18:18
am0c joined
18:32
lumi_ joined
18:46
brill left
18:49
cdarroch left
18:54
risou_ left,
risou is now known as risou_awy
18:58
kjeldahl joined
|
|||
tadzik | seen masak | 19:05 | |
aloha | masak was last seen in #perl6 2 days 5 hours ago saying "pivo &". | ||
tadzik | what a pivo | ||
seen jnthn | 19:07 | ||
aloha | jnthn was last seen in #perl6 2 days 6 hours ago saying "masak is so impure... :P". | ||
alester | pmichaud: Did we miss something in the migration? twitter.com/chromatic_x/statuses/70...3420181504 | 19:17 | |
19:18
mikehh joined
19:27
fhelmberger left
19:33
lichtkind joined
|
|||
lichtkind | TimToady: may I ask you something more demanding? | 19:34 | |
19:36
[particle] left
19:37
birdwindupbird joined
19:44
IllvilJa joined
|
|||
flussence | *sigh*... guy at $dayjob today said he was going to ignore perl 6 "until it's released and distros are shipping it". Maybe I should introduce him to Debian stable some time... | 19:45 | |
(or at least, a version newer than 3.0...) | |||
19:45
pernatiy joined
|
|||
Tene | flussence: I've still got Debian 3.1 boxes at work; we've been migrating to a reasonable distro, but not finished yet | 19:46 | |
colomon | chromatic's asking about rakudo.org on twitter atm... | 19:47 | |
19:48
[particle] joined
|
|||
IllvilJa | Gentoo got rakudo ebuilds, even if they are masked out as 'testing'. | 19:48 | |
perigrin | only about the status page and the benchmarks | ||
IllvilJa | flussence: my last sentence was a reply to you, BTW. | 19:49 | |
flussence: you can inflict the Gentoo experience upon him at any time :-). | |||
flussence | nah, someone's already done that before I started working there. Half our servers haven't been updated since gentoo still used version numbers :) | 19:50 | |
19:50
icwiener left
|
|||
flussence | (on the other hand, his refusal to update the OS on them gave me an excuse to install perlbrew on everything and get out of the 5.8 dark ages) | 19:52 | |
19:55
[particle] left
|
|||
tadzik | rakudo: my $a = "a{time}"; say $a; sleep 2; say $a | 19:55 | |
p6eval | rakudo 5f1bf6: OUTPUT«a1305662107a1305662107» | ||
tadzik | hrm | ||
flussence | cached? | ||
moritz | rakudo: say time | 19:56 | |
p6eval | rakudo 5f1bf6: OUTPUT«1305662181» | ||
tadzik | no, that was expected | ||
flussence files a flussencebug | |||
pmichaud | mberends: patched zavolaj isn't working for you? | 19:57 | |
I responded briefly (is there any other way?) to chromatic's tweet | 19:58 | ||
19:58
PacoLinux left
20:02
[particle] joined
|
|||
tadzik | colomon: I managed to resurrect this script, all it does is that it prints the return value and the output of prove of the chosen module | 20:11 | |
although there is some IPC::Run fail (there's a Perl5 script, I'm not sure what for, but I don't feel like questioning my 3-month-old logic :) | 20:12 | ||
colomon: github.com/tadzik/popolnik-client | 20:14 | ||
colomon | tadzik++ | ||
tadzik | use like 'perl popolnik.pl Acme::Meow' | ||
colomon++ | |||
still, there's some IPC::Run fail as I said, you can fix this if you feel like this | |||
20:14
REPLeffect joined
|
|||
tadzik | maybe a total rewrite will help it too, it was written for some old panda | 20:15 | |
20:21
spq left
20:27
birdwindupbird left
20:31
PacoLinux joined
20:34
snearch left
20:36
wknight8111 left
20:39
wamba left
20:41
kjeldahl left
20:45
mtk left
20:46
mtk joined
20:52
icwiener joined,
wamba joined
20:57
noganex joined
20:58
noganex_ left
21:08
dju__ joined
21:11
dju_ left
21:14
hercynium joined
21:16
stepnem left
21:18
noganex_ joined
21:20
carlin joined
21:21
noganex left
|
|||
carlin | rakudo: module foo { our $bar = 42; }; say $foo::quux; | 21:21 | |
p6eval | rakudo 5f1bf6: OUTPUT«Null PMC access in type() in main program body at line 22:/tmp/j6aVkyYZDR» | ||
carlin | rakudo: module foo { our $bar = 42; }; say $foo::quux ~ "baz"; | ||
p6eval | rakudo 5f1bf6: OUTPUT«Null PMC access in can() in main program body at line 1:/tmp/B4oO2Hehul» | ||
carlin | Are those already reported? | 21:22 | |
21:22
stepnem joined
21:30
wamba left
21:31
mj41 joined
21:38
kaare_ left,
carlin left
21:43
ymasory left
21:50
dominicus joined
|
|||
dominicus | When will Perl 6 be ready? | 21:50 | |
mikehh | dominicus: ready for what? | 21:52 | |
dominicus | mikehh: Use within a production environment. | 21:53 | |
sjohnson | for the public | ||
21:54
bluescreen10 left
|
|||
flussence | Use Debian stable if you want a production environment, it's been shipping perl 6 for a while now. | 21:54 | |
mikehh | Christmas of course, but I already use it for some things | 21:55 | |
21:55
nebuchadnezzar left
|
|||
mikehh | for quick scripts there is nothing better | 21:58 | |
not necessarily run time, but certainly setting them up | |||
of course some things are still missing, but no other language has everything anyway | 21:59 | ||
and rakudo has a lot available | 22:00 | ||
22:04
dur-randir left
22:05
dju__ left,
dju__ joined
22:08
hercynium left
22:13
donri left
22:18
newbee_ left
22:25
jevin left
22:28
lichtkind left
22:30
whiteknight joined
22:37
broquaint left
|
|||
pmichaud | perl 6 is in debian stable? | 22:38 | |
Juerd | That'd be funny | 22:39 | |
22:39
nebuchadnezzar joined
22:40
nebuchadnezzar left,
nebuchadnezzar joined
|
|||
tylercurtis doesn't see it in aptitude. | 22:41 | ||
pmichaud | yes, I've looked for it before with no success. There's a "rakudo" package in debian experimental, apparently, but it's 2010.01 or somesuch | ||
I'll probably want to start a new package or see if we can bump the package maintainers a bit | 22:42 | ||
22:46
mj41 left
22:51
icwiener left
22:56
kst left
23:01
alester left,
dju__ is now known as dju
23:08
mtk left
23:11
stepnem left
23:15
sftp left,
noganex_ left
23:17
kst joined
23:20
risou_awy is now known as risou,
risou_ joined
23:23
molaf_ joined
23:25
noganex joined
23:27
molaf left
23:28
stepnem joined
23:38
am0c left
23:42
Chillance left
23:46
jaldhar joined
23:50
Moukeddar joined,
Moukeddar left
|