»ö« | perl6.org/ | nopaste: paste.lisp.org/new/perl6 | evalbot usage: 'perl6: say 3;' or rakudo: / pugs: / std: , or /msg p6eval perl6: ... | irclog: irc.pugscode.org/ | UTF-8 is our friend!
Set by diakopter on 25 January 2010.
00:00 mikehh joined 00:01 snarkyboojum joined
lue s.b.: o/ 00:01
masak snarkyboojum: oh hai! 00:02
snarkyboojum masak: ello
masak rakudo: my $a = $a++; say $a 00:04
p6eval rakudo f960a2: OUTPUT«Any()␤»
jnthn rakudo: my $a = ++$a; say $a
p6eval rakudo f960a2: OUTPUT«1␤»
jnthn rakudo++ :-)
masak yup. 00:05
rakudo: my Int $a = $a++; say $a
p6eval rakudo f960a2: OUTPUT«Int()␤»
masak rakudo: my Int $a = $a++; say +$a
p6eval rakudo f960a2: OUTPUT«Use of type object as value␤current instr.: 'perl6;Perl6Exception;throw' pc 14251 (src/builtins/Seq.pir:52)␤»
masak hm.
jnthn Don't *think* I disagree with that too much. 00:07
Maybe just warn rather than die.
But it at least tells you what you did.
masak indeed.
just thinking that it's quite obvious that the Int type object would numify to 0. 00:08
jnthn :-/
alpha: say +Int
p6eval alpha 30e0ed: OUTPUT«Use of type object as value␤0␤»
ruz rakudo: grammar I { rule k { 'k' }; rule v { 'v' } } 00:09
p6eval rakudo f960a2: OUTPUT«Symbol '$ss_SS_S_S__S_S_s' not predeclared in <anonymous>␤current instr.: 'perl6;PCT;HLLCompiler;panic' pc 137 (compilers/pct/src/PCT/HLLCompiler.pir:101)␤»
00:09 eternaleye left
ruz is sad 00:09
masak hugs ruz 00:11
lue hugme: hug ruz 00:12
...where is hugme?
mberends rakudo: grammar I { rule k { 'k' }; rule v { 'v' }; }; say "give ruz a semicolon"
p6eval rakudo 2314af: OUTPUT«Symbol '$ss_SS_S_S__S_S_s' not predeclared in <anonymous>␤current instr.: 'perl6;PCT;HLLCompiler;panic' pc 137 (compilers/pct/src/PCT/HLLCompiler.pir:101)␤» 00:13
jnthn I think grammars ain't back in master yet, but bkeeler++ was/is working on a patch. :-)
masak lue: hugme hasn't been around lately. I have to do all my hugging the old-fashioned way.
lue rakudo: sub hugme($a){say "$a is hugged by a butterfly. All is well";}; hugme("ruz"); 00:15
p6eval rakudo 2314af: OUTPUT«ruz is hugged by a butterfly. All is well␤»
snarkyboojum mein gott 40 commits in the last 24 hours or so :) 00:16
00:16 eternaleye joined
snarkyboojum jnthn is on a complete and utter rampage :) w00t 00:18
colomon snarkyboojum: dang, you're right! I hadn't quite appreciated how many patches jnthn++ has pushed today... 00:20
00:23 hanekomu_ left 00:25 new_order joined 00:26 IllvilJa left
masak SF strikes again! lastofthecarelessmen.blogspot.com/2...catch.html 00:30
jnthn pmichaud: When you're back, see lastofthecarelessmen.blogspot.com/2...catch.html 00:31
pmichaud: Not quite sure how we fix that one. :-/ 00:32
00:33 mikehh left 00:34 mberends left 00:35 simcop2387 left
colomon yow. 00:36
automatically wrap the iterator in a Seq when it's attached to @a? 00:37
jnthn Maybe. 00:39
quietfanatic Why is it "use of type object as value"? 00:40
It's not a type object, it's an undefined object of that type
so it should say "use of undefined object as value"
masak I'd tend to agree. 00:41
lue actually, I say that types are objects :)
jnthn type object and undefined object of a certain type are, in my eyes, the same thing.
quietfanatic Well, I'm just going by what TimToady said to me once
jnthn You could emit the error either way and it's probably correct. 00:42
quietfanatic that Int, as an object, isn't a type, it's an undefined Int.
jnthn Right, but it's a "type object" in that it represents all values of the type too.
quietfanatic I guess it could be seen that way, yeah. 00:43
whatever :)
jnthn Having implemented a bunch of the type-y stuff, I'm more prone to see them that way. :-)
I agree "undefined object" may be a more useful way to explain it to the user. 00:44
quietfanatic ...that's what I was thinking
jnthn LTA error ticket welcome.
quietfanatic I might submit if I get around to it
jnthn masakbot!
masak comes to life 00:45
masak submits LTA ticket 00:46
lue masak: submit ticket
00:46 masak left
lue masak: sleep 00:46
sorry, masakbot:
00:47 masak joined
jnthn github.com/rakudo/rakudo/commits/ - whole page is commits from today. \o/ 00:48
masak jnthn++
00:48 simcop2387 joined
masak colomon++ 00:48
jnthn pmichaud++ and colomon++ too! 00:49
00:49 mberends joined
lue masakbot: applaud again 00:50
(o great, the quiet time is finally coming...) 00:56
masak rattles his chains
jnthn turns up Within Temptation
mberends commits @*INC 00:57
jnthn ...well at least someone did something useful. :-)
mberends++
mberends the dreaded %*ENV still lieth and waiteth... 00:58
jnthn Oh boy... 00:59
:-)
Anyways, sleeps for me 01:02
night! o/
01:02 lejon joined
masak night, jnthn! o/ 01:02
mberends o/
lue night o/ 01:03
lejon ?
help
lue your help has been granted, but its location is unknown. 01:04
what do you need help with?
masak lejon: hello. welcome to #perl6.
lue Bonvenon al #perl6 ! 01:05
lejon :) well, first time using IRC ...
masak cool.
lejon: you from .se?
lejon yup
masak jag med. 01:06
:)
lejon Stockholm area
ok
masak Uppsala here.
lejon Ah! Mina gamla hemtrakter...
lue I have a tractor in my garden (?) (I do not speak your tounge)
masak lejon: Varför flyttade du? Här är så fint :)
lue stop stop stop stop stop /o\ 01:07
lejon Hehe, "trakter" means "area" or "location" :)
01:07 cognominal joined
mberends lue: there's always Google Translate ;) 01:07
lue Saluton, cognominal! (I'm in an esperanto mood)
lejon Well, we moved from Uppsala since we both worked in Stockholm, but we do miss it...
lue evilbot: run google translate 01:08
evilbot: run translate #my bad
hmmmm :)
01:08 mberends is now known as evilbot 01:09 evilbot is now known as mberends
lue diakopter: ping, by any chance? 01:13
lejon hi, everyone... does anyone now what the state of perl6 grammars are? 01:18
lue ask masak, he's been working on an engine :) 01:19
TimToady well, he's been working on a PGE clone, which isn't exactly perl6...
masak :)
lejon: the state of the art is STD.pm, obviously.
TimToady lejon: what do you want to know?
mberends lejon: Perl 6 grammars work very well, there are just a few details to implement in Rakudo
masak lejon: if you're looking at parsing Perl 6, you might want to have a look at STD.pm.
lejon: if you want to *use* Perl 6 grammars for other things, I'd recommend Rakudo alpha. 01:20
01:20 lue is now known as The
lejon well, I was mostly wondering if rakudo can pares STD.pm at this stage for instance? 01:20
01:20 The is now known as lue
masak no, not yet. 01:20
TimToady not quite
masak they're converging, though.
TimToady though we haven't tried recently :)
lue
.oO(darn, spaces aren't allowed in nicknames)
01:21
lejon "they" meaning rakudo and ...?
masak STD.pm
TimToady STD parsed nearly all the test suite, it just doesn't run it
rakudo parses less of it, but runs much of what it does parse 01:22
lejon Oh, I see so rakudo has their own version of STD.pm...?
TimToady well, they call it grammar.pm
lejon cool, I see...
lue it's not that big, really... (only ~1000 lines of code)
TimToady well, even STD.pm is only 5700 lines, and that's with a bunch of ops that should be in CORE instead 01:23
(which is what I'm working on currently btw)
cognominal lue, kiel vi fartas? 01:24
01:24 xomas left
lue eh... I'm not proficient in epo yet, just a few phrases :) 01:24
Mi estas komencanto. (for one) 01:25
masak cognominal: ho, ĉu ankaŭ vi parolas? 01:27
huf masak: what language is this? 01:28
lue (like I said before, at least I have somewhere to practice esperanto in (relatively) real life)
masak huf: Esperanto. seemingly everyone on this channel speaks it. :) 01:29
huf heh ;)))
lue there's the ##esperanto channel here on freenode (not there, though)
Tene I don't! I'm rather not fond of esperanto. I do study lojban, though.
masak don't listen to Tene. he's just a grumpy Lojbanist. :P
lue Tene: why not? (just curious) 01:30
Tene Good advice. Definitely should ignore me.
01:30 Guest2390 joined
Tene lue: www.xibalba.demon.co.uk/jbr/ranto/ is a good overview of stuff I dislike about it. The reason I don't study it, though, is that it's just not interesting to me. 01:31
01:32 wknight8111 left
masak I wouldn't say that page reflects Esperanto very well. it does reflect many outside misconceptions about the language, though. 01:32
lue beh. Klingon may be well-known, but there are only ~a dozen fluent speakers (not me)
that webpage seems oddly extremist. (not saying you are, Tene) 01:33
Tene Esperanto doesn't introduce enough interesting ideas to learn it for research purposes, afaict, and insufficient speakers to learn it for utility.
masak true. 01:34
Tene Hmm. "good overview" is a bit extreme. "Mentions a few things that bothered me, among other things I haven't evaluated".
lue the part about european-centric (not asia-friendly): I once read of a conversation between two epo speakers, one jp.
masak the community of thousands of speakers that does exist, though, is kind of an interesting phenomenon on its own :)
lue: thing is, Eo is in a way an isolating language masquerading as a European one. 01:35
lue The japanese guy said that all asian languages (jp, chinese, ko, etc.) are completely different from each other, so it makes no difference
01:35 lest_away is now known as lestrrat
lue that it's mainly european-based to asians. 01:35
masak yeah, pulling words from something other than Europe seems difficult in practice.
lue "Clumsy - full of hard sounds, odd letters and absurd words." that one made me laugh. The only (slightly) difficult ones are (possibly) ĥ and r 01:36
masak lue: yes, but even Asians will recognize the isolating part.
lue: tbh, 'sc' isn't easy either :P 01:37
cognominal Speaking of language, right now, I am using Objective-C. Coming from Perl, which excels at not repeating itself, it is extremely painful. Also you could cram a perl one liner in the space of an Apple Objective-C identifier.
Tene cognominal: write perl to generate your obj-C, of course!
masak cognominal: does Objective-C have redeeming qualities?
cognominal it is dynamic, sort of. Recently got closures too. 01:38
lue is analyzing this page and writing about it as he goes. This page was written in the ASCII days, it seems. The special characters argument is invalid.
cognominal Tene: I am seriously thinking doing that. But I don't want to be sidetracked :)
01:39 amindfv joined
TimToady pmichaud: Junction.Str is *not* supposed to autothread 01:39
cognominal Also it seems that the Cocoa environment has one right way to do anything and I have trouble to figure it out. In Perl, I often immediately find some way to do something even if in the long term it is not the right one. 01:40
At least, it helps to get started and has the immediate rewarding property, a very important one for me who get easily discouraged. 01:42
01:47 Guest2390 left 01:48 mikehh joined
masak g'night, people. 01:48
lejon well, time to sleep good night!
lue goodnight
01:48 masak left, lejon left
pugssvn r29885 | lwall++ | [S02] clarify what was meant by "Nil undefined as an item". 01:51
01:54 jferrero left
pmichaud TimToady: (Junction.Str) noted, sorry if I got it backwards again 01:59
thanks for the clarification :)
TimToady: If you have any thoughts or suggestions for lastofthecarelessmen.blogspot.com/2...atch.html, they'd be welcome. :-) 02:06
(afk, drugstore run) 02:07
02:10 mssm left 02:12 jaldhar left 02:13 jaldhar joined 02:24 mssm joined
lue rakudo: multi sub infix :<≤>($a, $b) { $a <= $b;}; say 3≤5; 02:29
p6eval rakudo a7403f: OUTPUT«traits specified as colon pairs not yet understood at line 11, near "($a, $b) {"␤current instr.: 'perl6;HLL;Grammar;panic' pc 500 (ext/nqp-rx/src/stage0/HLL-s0.pir:328)␤»
lue rakudo: multi sub infix :<≤> ($a, $b) { $a <= $b;}; say 3≤5; 02:30
p6eval rakudo a7403f: OUTPUT«traits specified as colon pairs not yet understood at line 11, near "($a, $b) {"␤current instr.: 'perl6;HLL;Grammar;panic' pc 500 (ext/nqp-rx/src/stage0/HLL-s0.pir:328)␤»
lue hmm
mberends lue: omit some spaces
colomon lue: rakudo doesn't allow you to create new operators yet.
and yes, don't think there should be a space between infix and : 02:31
lue alpha: multi sub infix:<≤> ($a, $b) { $a <= $b;}; say 3≤5; 02:32
p6eval alpha 30e0ed: OUTPUT«1␤»
lue \o/
mberends lue++ 02:35
lue: soon you'll be able to store that in a module, and never type <= again ;)
colomon I'd prefer to use R> 02:37
;)
lue that's what I'm doing right now. The 'official' P6 module, a work in progress.
(what should the jnthn() sub do?)
mberends it should DWIM
lue DWIM? 02:38
mberends Do What I Mean, perlish for automagically Doing The Right Thing
lue alpha: multi sub prefix:<¬> ($a) { !$a;}; say ¬5; 02:39
p6eval alpha 30e0ed: OUTPUT«0␤»
lue ah, so the meta-sub
alpha: multi sub prefix:<¬> ($a) { !$a;}; say ¬False;
p6eval alpha 30e0ed: OUTPUT«1␤»
lue jnthn() would be the most complex sub out there, then. 02:40
Would it take arguments to decide what to do, or magically tell based on its surroundings?
mberends oh, the latter 02:41
colomon I think it would take a string of code or a closure, and make the code Just DWIM.
lue so there would be a prefix, suffix, infix, etc... great 02:42
mberends perhaps just fix 02:44
lue alpha: multi sub prefix:<¬> ($a) { !$a;}; say 3¬=5;
p6eval alpha 30e0ed: OUTPUT«Confused at line 10, near "\x{ac}=5;"␤in Main (file <unknown>, line <unknown>)␤»
lue so you could define multi sub fix:<> ?
colomon no, I think mberends was making a funny
lue that would make it slightly easier, though 02:45
mberends yes, sorry my ;) key was asleep
lue multi sub fix:<jnthn> { if in {...} if pre {...} ... } or something like that.
colomon I was thinking jnthn should just be a sub, but actually, now I want prefix:<jnthn> so we can use metaops with it.... 02:47
rakudo: my $a = 80000.0000000000000000000000000;
p6eval rakudo a7403f: OUTPUT«PAST::Compiler can't compile node of type BigInt␤current instr.: 'perl6;PCT;HLLCompiler;panic' pc 137 (compilers/pct/src/PCT/HLLCompiler.pir:101)␤»
arlinius rakudo: say [\jnthn] @_
p6eval rakudo a7403f: OUTPUT«Confused at line 11, near "say [\\jnth"␤current instr.: 'perl6;HLL;Grammar;panic' pc 500 (ext/nqp-rx/src/stage0/HLL-s0.pir:328)␤»
colomon rakudo: my $a = 1.0000000000000000000000000000000000000000000000000000000000000000000e1; 02:48
p6eval rakudo a7403f: OUTPUT«float division by zero␤current instr.: 'perl6;Perl6;Actions;_block5172' pc 198761 (src/gen/perl6-actions.pir:10645)␤»
lue what would the prefix form do w/ metaops ?
lue .oO(jnthn's gonna have a medical condition of some sort when he reads the backlog, maybe shock)
colomon well, mostly I want to have hyper-jnthn 02:49
jnthn<<@code-array
lue alpha: multi sub infix:<hai> ($a, $b) { $a + $b;}; multi sub suffix:<hai> ($a) { $a.perl;}; say 5 hai 4; say "oh"hai; 02:50
p6eval alpha 30e0ed: OUTPUT«Confused at line 10, near "hai;"␤in Main (file <unknown>, line <unknown>)␤»
lue alpha: multi sub infix:<hai> ($a, $b) { $a + $b;}; multi sub suffix:<hai> ($a) { $a.perl;}; say 5 hai 4; say "oh"hai
p6eval alpha 30e0ed: OUTPUT«Confused at line 10, near "hai"␤in Main (file <unknown>, line <unknown>)␤»
lue alpha: multi sub infix:<hai> ($a, $b) { $a + $b;}; multi sub suffix:<hai> ($a) { $a.perl;}; say 5 hai 4; say "oh".hai
p6eval alpha 30e0ed: OUTPUT«9␤Method 'hai' not found for invocant of class 'Str'␤in Main (file src/gen_setting.pm, line 324)␤»
colomon postfix, not suffix, I think. 02:51
lue alpha: multi sub infix:<hai> ($a, $b) { $a + $b;}; multi sub postfix:<hai> ($a) { $a.perl;}; say 5 hai 4; say "oh"hai
p6eval alpha 30e0ed: OUTPUT«Confused at line 10, near "hai"␤in Main (file <unknown>, line <unknown>)␤»
colomon huh.
alpha: multi sub infix:<hai> ($a, $b) { $a + $b;}; say 5 hai 4; 02:52
p6eval alpha 30e0ed: OUTPUT«9␤»
lue alpha: multi sub infix:<hai> ($a, $b) { $a + $b;}; multi sub prefix:<hai> ($a) { $a.perl;}; say 5 hai 4; say hai"there";
p6eval alpha 30e0ed: OUTPUT«9␤"there"␤»
colomon alpha: multi sub postfix:<hai> ($a) { $a.perl;}; say "oh"hai
p6eval alpha 30e0ed: OUTPUT«"oh"␤»
lue just testing to see if you could have multiple operators w/ same name
pmichaud you can, within some limits.
things get confused when there's an infix and postfix operator with the same token. 02:53
(because they both parse in operator position)
colomon pmichaud: how hard would it be to get define-your-own operators working in master?
lue the jnthn() omnisub ought to be an interesting challenge though
pmichaud colomon: shouldn't be too hard
arlinius alpha: multi sub postfix:<+> ($a) { $a + 2 }; say 5+ 02:54
p6eval alpha 30e0ed: OUTPUT«Confused at line 10, near "+"␤in Main (file <unknown>, line <unknown>)␤»
pmichaud colomon: I've been thinking of adding that "soonish"
arlinius like that kind of confused
colomon pmichaud: sweet
pmichaud the tricky part is getting the parser modified to recognize the new tokens
arlinius alpha: multi sub postfix:<!> ($a) { $a + 2 }; say 5!
colomon right
p6eval alpha 30e0ed: OUTPUT«7␤»
pmichaud (which isn't hard, but has to happen at BEGIN time)
lue tell it to forget other things then. (o wait, bad idea) 02:55
maybe it can happen at ALMOSTREADY or DONTBEGINJUSTYET time :D
colomon pmichaud: I was just looking at S02-builtin_data_types/num.t, It's kind of a nightmare. 02:57
lue (is there a quick list of the kinds of operators P6 has?)
colomon lue: see S03
perlcabal.org/syn/S03.html 02:58
pmichaud it's a year out of date, but there's also www.ozonehouse.com/mark/periodic/
(Periodic table of the Perl 6 operators)
colomon if that were up-to-date I would totally buy one to hang on the wall.
02:59 synth joined
colomon still wants a Rakudo t-shirt, for that matter... 02:59
02:59 synth left, redicaps left
pmichaud rakudo.spreadshirt.com 02:59
02:59 redicaps joined
pmichaud cafepress.com/rakudo 02:59
lue I'm there (S03), but it's not exactly a quick list (list as in grocery).
pmichaud lue: "Operator precedence" at the top of S03 is a pretty good list 03:00
03:00 synth joined
colomon pmichaud: If there's nothing snappier by YAPC:NA, I'll get the value t-shirt Rakudo Perl 6 from cafepress. :) 03:01
pmichaud colomon: works for me. I'm open for suggestions on snappier designs, too :)
colomon I think I'd rather have a light-colored Rakudo logo on a dark-colored t-shirt. 03:02
pmichaud I can probably arrange that :-)
lue .rnd(Our deluxe Peanut Chicken, where our motto is "So peanutty, you won't taste the chicken!")
colomon pmichaud++
lue: the thing is, Perl 6 has a gazillion operators. It's an important component of the design, but it makes normal lists tricky. 03:03
lue A good list I'm interested in would be the names you'd use in multi sub [name]:<jnthn> ... 03:04
but I'll manage with the ones out there :)
pmichaud: how about a shirt that says something like: (more) 03:08
楽土 Perl 6 (Rakudo Perl 6): Its name is japanese, so it must be cool. 03:09
arlinius rakudo: sub 楽土 { say "楽土" } 03:11
p6eval rakudo a7403f: ( no output )
arlinius rakudo: sub 楽土 { say "楽土" }; 楽土
p6eval rakudo a7403f: OUTPUT«楽土␤»
03:11 cognominal left
lue good sub! must include... 03:11
03:12 cognominal joined
TimToady pmichaud: if you bind an iterator to @, it should become something Positional with the iterator as its "extender" 03:13
interesting Q whether it should become Seq or Array though
03:13 lichtkind left
colomon TimToady: seems like it would depend on whether it is a rw parameter or not.... 03:14
TimToady depends on how rw distributes
03:14 mberends left
TimToady but maybe rw is what we want 03:14
(to make an Array)
03:15 lichtkind joined 03:16 k23z__ left
colomon pmichaud: Am I correct in thinking dec_number must be the function generating the divide by zero / BigInt errors with super-long decimal numbers? 03:16
03:18 lichtkind left 03:19 zorgnax left
colomon rakudo: say (10.).WHAT 03:19
p6eval rakudo a7403f: OUTPUT«Confused at line 11, near "say (10.)."␤current instr.: 'perl6;HLL;Grammar;panic' pc 500 (ext/nqp-rx/src/stage0/HLL-s0.pir:328)␤»
TimToady std: say (10.).WHAT
p6eval std 29885: OUTPUT«===SORRY!===␤Decimal point must be followed by digit at /tmp/mgsIBGZ0mi line 1:␤------> say (10.⏏).WHAT␤FAILED 00:01 107m␤»
colomon I see what's going on in the grammar. :) 03:20
03:20 lichtkind joined, redicaps left, redicaps joined, lichtkind left
pmichaud I'm not sure Seq or Array are the right answers, though 03:21
suppose I have
foo( (1..1000000).map({ ... }) )
TimToady the "extender" part of a Seq or Array is still lazy 03:22
pmichaud is it normal to expect that foo() will keep around all 1 million elements? What if it wants to process them one-at-a-time
TimToady then it shifts them
pmichaud that argues for Array, then.
(since Seq doesn't shift)
03:23 lue is now known as TheDoctor, TheDoctor is now known as The_Doctor
pmichaud it also means that the parameter isn't really bound to the argument 03:23
(which may be okay, but feels like a bit of a departure) 03:24
03:24 The_Doctor is now known as Doctor_Who, Doctor_Who is now known as lue
lue I can't pick a decent DrWho-related nick! :( 03:24
03:24 redicaps left 03:25 redicaps joined
pmichaud colomon: yes, whatever is making decimal numbers into Rats is what is generating the problems with really big decimals 03:26
s/big/long/
lue the biggest decimal I can think of is .999... :P
(not allowing whole numbers in the mix)
colomon pmichaud: the one thing that occurred to me -- maybe we could track how many times the @ variable is used? If it's only referred to once, the iterator should be fine, if it's more than once it has to be Seq/Array? 03:27
pmichaud colomon: what about binding?
colomon pmichaud: darned if I know. I'm just trying to brainstorm here. :)
and if we're going down that path, what happens if you pass an iterator to a $ argument? 03:31
pmichaud I'm still struggling with that a bit also :-) 03:32
lue std: my $ = 4; say $
p6eval std 29885: OUTPUT«===SORRY!===␤Non-declarative sigil is missing its name at /tmp/eznc8Rg04J line 1:␤------> my $ = 4; say $⏏<EOL>␤ expecting twigil␤FAILED 00:01 108m␤»
lue std: my $$ = 4; say $$
p6eval std 29885: OUTPUT«===SORRY!===␤Non-declarative sigil is missing its name at /tmp/ar1SFwrOcR line 1:␤------> my $$ = 4; say $$⏏<EOL>␤ expecting twigil␤FAILED 00:01 106m␤»
pmichaud std: say (my $ = 4);
p6eval std 29885: OUTPUT«ok 00:01 106m␤»
lue alpha: say (my $ = 4); 03:35
p6eval alpha 30e0ed: OUTPUT«Malformed declaration at line 10, near "$ = 4);"␤in Main (file <unknown>, line <unknown>)␤»
pmichaud otoh, .999..... *is* a whole number :-)
lue I know, but it is still a decimal :) 03:36
03:38 cognominal left
pmichaud 03:12 <TimToady> pmichaud: if you bind an iterator to @, it should become something Positional with the iterator as its "extender" 03:39
so, is there a method that gets called whenever an object is about to be bound?
(if so, what is that method called?)
03:47 Chillance left
colomon pmichaud: is it DEBUG that lets you "say" in Actions.pm? 03:49
pmichaud say in Actions.pm requires parens.
(NQP doesn't support listops)
colomon oh, so say works?
pmichaud I think it does, ye.
yes.
but you have to do say("something") and not say "something" 03:50
if that doesn't work, there's always pir::say("something")
colomon pmichaud++
colomon is trying to figure out how dec_number works without deciphering the PIR portion...
pmichaud the PIR portion is simply figuring out what value to use as the base 03:51
so, given 123.456
the PIR portion is calculating the base as 1000
colomon I think it's coming out zero sometimes.
pmichaud (because there are three digits after the decimal)
colomon say() doesn't work. 03:52
pmichaud try pir::say() then.
colomon compiling...
that compiled, I think. 03:53
(still building)
lue colomon: PIR isn't that bad! Not when you've studied assembler!...
pmichaud I don't think that $base can be zero.
do you have an example where it's failing? 03:54
colomon rakudo: my $a = 1.0000000000000000000000000000000000000000000000000000000000000000000e1;
p6eval rakudo a7403f: OUTPUT«float division by zero␤current instr.: 'perl6;Perl6;Actions;_block5172' pc 198761 (src/gen/perl6-actions.pir:10645)␤»
pmichaud rakudo: my $a = 1.00000000000000000000000000000000000000000000000000000000000 03:55
p6eval rakudo a7403f: OUTPUT«Nominal type check failed for parameter '$a'; expected Int but got Num instead␤current instr.: 'perl6;Rat;gcd' pc 316077 (src/gen/core.pir:37051)␤»
colomon lue: I've programmed 6502 and IBM mainframe assembler. But I'd still rather avoid it if I can.
pmichaud okay, what is happening in the 1.000000000000000000000e1 case is that we're going outside the range of values that can be computed in an I register. 03:56
colomon thought it might be something like that.
pmichaud so, perhaps changes all of the occurrences of $I2 to $N2
*change
that would at least get us into the realm of floating point values
we don't actually lose much by doing that, since NQP's math ops are going to end up doing floating point anyway
colomon :( 03:57
seems like there's something off with this approach.
pmichaud we do rub against Parrot's limited view of numbers here, yes. 03:58
there was a long thread about this just eight days ago in Parrot
lue thinks he'll avoid the jnthn omnisub for now
pmichaud anyway, are you trying the $I2 -> $N2 approach? 04:00
colomon actually, I'm still trying to get say to compile for me.
it keeps on compiling for a long time and then failing.
pmichaud pir::say didn't work?
lue rakudo: $a=3; say $a.WHO;
p6eval rakudo a7403f: OUTPUT«Symbol '$a' not predeclared in <anonymous>␤current instr.: 'perl6;PCT;HLLCompiler;panic' pc 137 (compilers/pct/src/PCT/HLLCompiler.pir:101)␤»
lue rakudo: my $a=3; say $a.WHO; 04:01
p6eval rakudo a7403f: OUTPUT«Int␤»
colomon error:imcc:syntax error, unexpected INTC, expecting $end ('10')
is what I get from pir::say($base);
pmichaud weeeeeeird
lue How would you get the name of a variable for use in code?
other than providing it manually?
sjohnson hi 04:03
04:03 meppel joined
colomon lue: you mean something like sub a($b) { say $b.WHO; }; my $c = "hello"; a($c) and you want WHO to print $c? 04:04
lue yes, in a nutshell.
colomon lue: unfortunately, I don't have a clue. :)
pmichaud I would think that it would have to print $b :-)
and .WHO means something else :)
lue I know. I want to create a dalek() sub, which nullifies the provided variable, and say "[variable name] exterminated!" 04:05
colomon I took the pir::say out and finally have a complete build again.
lue my $a=3; say $a.WHO; 04:06
rakudo: my $a=3; say $a.WHO;
p6eval rakudo a7403f: OUTPUT«Int␤»
lue rakudo: my $a=3; say $a.WHAT;
p6eval rakudo a7403f: OUTPUT«Int()␤»
lue rakudo: my $a=3; say $a.WHEN;
p6eval rakudo a7403f: OUTPUT«Method 'WHEN' not found for invocant of class 'Integer'␤current instr.: '_block14' pc 29 (EVAL_1:0)␤»
lue rakudo: my $a=3; say $a.WHERE;
p6eval rakudo a7403f: OUTPUT«47393419560592␤»
lue rakudo: my $a=3; say $a.WHY;
p6eval rakudo a7403f: OUTPUT«Method 'WHY' not found for invocant of class 'Integer'␤current instr.: '_block14' pc 29 (EVAL_1:0)␤»
lue rakudo: my $a=3; say $a.HOW;
p6eval rakudo a7403f: ( no output )
lue ? 04:07
colomon trying $I2 -> $N2 now.
I'm predicting it doesn't work, at least for Rats.
Tene lue: you'd need macros to do that, and they're NYI in rakudo.
04:07 meppl left
lue I find WHO counterintuitive AND redundant (a world record!) 04:07
Tene lue: I got a prototype working, but I'm still blocking on spec decisions from TimToady to start really working on it.
rakudo: my $a = 3; say $a.WHO.WHAT 04:08
p6eval rakudo a7403f: OUTPUT«Method 'WHAT' not found for invocant of class 'Int'␤current instr.: '_block14' pc 29 (EVAL_1:0)␤»
Tene rakudo: my $a = 3; say $a.WHAT.WHAT
p6eval rakudo a7403f: OUTPUT«Int()␤»
colomon pmichaud: I've been wondering for a while if the dec_number routine should call infix:</> instead of Rat.new. 04:10
> say 1.1000000000000000000000000000000000000 04:11
too many positional arguments: 3 passed, 1 expected
> say 1.1000000000000000000000000000000000000e1
10
seems LTA 04:12
04:13 cognominal joined 04:14 xinming_ joined
pmichaud yes, I'm certain that it is. You're very welcome to come up with a better algorithm :-) 04:14
04:15 justatheory left
pmichaud I threw that one together just to get something working, not because I felt it was the right way to go. 04:16
colomon sure, believe me, I understand that approach. :)
(don't look to hard at infix:<Z>, for instance. ;)
pmichaud the way that alpha computed fractional parts was by iterating over each digit and place 04:17
probably should bring that back. 04:18
lue rakudo: multi sub infix:<xyzzy>($a, $b) {say $a.WHAT; say $b.WHAT;}; 3 xyzzy 3;
p6eval rakudo a7403f: OUTPUT«Confused at line 11, near "3 xyzzy 3;"␤current instr.: 'perl6;HLL;Grammar;panic' pc 500 (ext/nqp-rx/src/stage0/HLL-s0.pir:328)␤»
lue rakudo: multi sub infix:<xyzzy> ($a, $b) {say $a.WHAT; say $b.WHAT;}; 3 xyzzy 3;
p6eval rakudo a7403f: OUTPUT«Confused at line 11, near "3 xyzzy 3;"␤current instr.: 'perl6;HLL;Grammar;panic' pc 500 (ext/nqp-rx/src/stage0/HLL-s0.pir:328)␤»
pmichaud (rakudo doesn't allow custom operators yet) 04:19
lue alpha: multi sub infix:<xyzzy> ($a, $b) {say $a.WHAT; say $b.WHAT;}; 3 xyzzy 3;
(forgot)
p6eval alpha 30e0ed: OUTPUT«Int()␤Int()␤»
lue alpha: multi sub infix:<xyzzy> ($a, $b) {say $a.WHAT; say $b.WHAT;}; 3 xyzzy
p6eval alpha 30e0ed: OUTPUT«Confused at line 10, near "xyzzy"␤in Main (file <unknown>, line <unknown>)␤»
lue darn, I was hoping to use a workaround to allow the same name for infix and postfix.
colomon pmichaud: I need to get to bed. But if you haven't done something with this by tomorrow, I'll happily try to sort out a better approach. 04:20
lue night o/ 04:21
pmichaud colomon: well, I'm likely to head to bed also
but I might tackle it briefly
at any rate, feel free to start on it whenever :-)
colomon good luck!
lue then who be here (besides me) :(
colomon pmichaud: is Actions.pm in NQP-rx? 04:22
TimToady I am vaguely here
pmichaud colomon: yes
(assuming you mean "written in NQP")
colomon pmichaud: what sort of math is available there? it looks like Int and Num math? 04:23
pmichaud it ultimately becomes all num for the most part
TimToady well, if Int were really bigint...
pmichaud it's a limitation of parrot's math operators at the moment
lue
.oO(I'm surprised parrot doesn't come with bolton and notlob operators)
04:24
.oO(in PIR at least)
rakudo: say "hello".flip 04:25
p6eval rakudo a7403f: OUTPUT«olleh␤»
colomon rakudo: say 1.1000000000000000000000000000000 04:26
lue rakudo: say True ~~ 42;
p6eval rakudo a7403f: OUTPUT«Nominal type check failed for parameter '$a'; expected Int but got Num instead␤current instr.: 'perl6;Rat;gcd' pc 316077 (src/gen/core.pir:37051)␤»
rakudo a7403f: OUTPUT«0␤»
lue that is wrong!
rakudo: say False ~~ 42;
p6eval rakudo a7403f: OUTPUT«0␤»
colomon lue: are you thinking of it backwards? True is not a kind of 42... 04:27
lue rakudo: say 42 ~~ True;
p6eval rakudo a7403f: OUTPUT«1␤»
lue rakudo: say 42 ~~ False;
p6eval rakudo a7403f: OUTPUT«0␤»
pmichaud colomon: the tricky part to dec_number is being able to decide when we should construct a rat, and when we should stick with a Num.
lue It should still come out 1 the other way, though.
pmichaud ~~ isn't commutative.
lue .rnd(autonomous anarcho-syndicalist commune) 04:28
colomon pmichaud: actually, looking at that result above, I really think infix:</> is the way to go instead of Rat.new.
pmichaud colomon: right now, it would always end up calling infix:</>(Int, Num) then 04:29
which would always produce a Num, I think.
colomon hmmm?
Rat.new takes two Ints.
pmichaud colomon: after making the $I2 -> $N2 conversion, it gets an Int and a Num 04:30
04:30 meppel left
colomon oooo. 04:30
what I'm thinking of fixes the one problem but not the other.
pmichaud or, if you don't make the $I2 -> $N2 conversion, you get two ints, but go out-of-range whenever the denominator has more digits than can fit into an int
as I said, the tricky part is deciding when to construct a rat, and when to stick with a num
colomon pmichaud: I don't think that's quite right. 04:31
hmmm...
TimToady it's always supposed to make a rat
colomon rakudo: say 1.100000000000000000000000000000
p6eval rakudo a7403f: OUTPUT«PAST::Compiler can't compile node of type BigInt␤current instr.: 'perl6;PCT;HLLCompiler;panic' pc 137 (compilers/pct/src/PCT/HLLCompiler.pir:101)␤»
TimToady unless there an e
pmichaud ...and unless it goes outside of 64-bit ratness?
colomon TimToady: that's not right, it's only... what pmichaud said.
TimToady spec says Rat64, but with a .Str that allows the whole thing, including conversion to FatRat 04:32
lue I'm gonna work on the jnthn omnisub tomorrow. I have the feeling that after I do, I could make my own P6 Periodic Table...
TimToady S02:3181
pmichaud I don't think we can do FatRat until we have bigints, and bigints aren't likely in the next two or so months 04:33
so we just live with being out-of-spec there, I suspect.
colomon is tired and thinking in circles. 04:35
instead of $base being 10, 100, 1000, etc., it should be 1, 2, 3, I think. I wouldn't worry about getting more digits than you can count with a 32-bit int. 04:37
pmichaud sure, but you still run into issues when base > 32
actually, when base > 10 04:38
because we still can't construct an int that large
colomon but $exp can go larger than 10 and still work, right?
04:39 mssm left
pmichaud because it's a num and not an int 04:39
I can get it so that we construct valid nums for long strings of digits; as I said -- the tricky part is deciding when it's safe for us to construct a rat 04:40
either that or our Rats need to be able to have num/den that can easily go outside of the range of ints
(i.e., set num/den to be Num/Float instead of Int/Integer 04:41
colomon can you calculate $int * (10 ** $base) + $frac as a Num and see if it fits in an Int?
in NQP-rx, I mean?
got to go to bed now, too tired to think....
pmichaud sure, can do that
but I think you mean $int + $frac / (10 ** $base) 04:42
oh, for the later one... hmm 04:43
I'm not sure I want to be doing that exponentiation step on every dec_number literal, though :-|
TimToady literals don't have to be fast 04:44
pmichaud ...and every string-to-number conversion :-)
but yes, we could do a table lookup or something if we had to 04:45
oh!!!! 04:46
colomon: you're right, infix:</> might be the more correct approach here.
msg colomon in dec_number, try changing $I2 to $N2 and then switch the call to Rat.new to instead be &infix:</> 04:52
phenny tell colomon in dec_number, try changing $I2 to $N2 and then switch the call to Rat.new to instead be &infix:</>
phenny: tell colomon in dec_number, try changing $I2 to $N2 and then switch the call to Rat.new to instead be &infix:</> 04:53
phenny pmichaud: I'll pass that on when colomon is around.
pmichaud (ETOOMANYMESSAGEBOTS)
04:54 justatheory joined
lue must.....eat...spoonful of...... pure......caffeine! 04:55
how does phenny know when someone's around when there's no indication they aren't (except for the lack of talking) 04:57
Tene lue: phenny only responds to messages sent to the channel.
pmichaud phenny remembers nicks, waits for the next time the person with that nick speaks
lue ah.
pmichaud phenny: tell lue like this 04:58
phenny pmichaud: I'll pass that on when lue is around.
Tene So, if someone sent a message to me with phenny, phenny would deliver it as soon as I spoke.
lue I get it. I don't need an example :)
phenny lue: 04:58Z <pmichaud> tell lue like this
lue ah! I said I didn't need an example!
pmichaud tell that to phenny :)
Tene phenny: tell lue that you're sorry for providing an example
phenny Tene: I'll pass that on when lue is around.
lue phenny: tell pmichaud I don't need an example!
phenny lue: I'll pass that on when pmichaud is around.
lue: 04:58Z <Tene> tell lue that you're sorry for providing an example
lue fun with phenny 04:59
phenny: tell hugme it's great to have you back! 05:00
phenny lue: I'll pass that on when hugme is around.
diakopter lue: around here, op status doesn't mean anything except "you're on a mostly persistent connection and you're here often enough to kick spammers". But since a few days after freenode switched to a new ircd, there's been no spam problem, so I move to deop everyone but TimToady (or something)... 05:03
lue Alright. I just like having op status :D 05:04
diakopter yeah.. that's generally why, for years, nobody was op nearly all of the time
lue I would, however, love to mass-kick everyone in the user list (to my right) who never does anything except stay logged in 05:05
TimToady why? 05:06
05:06 gabiruh joined
TimToady they're our friends 05:06
Tene Hmm... that counts as a vote against yourself for op privs.
lue I don't know, honestly. (I haven't been here long enough to know most of the guys who never show)
Tene Some people just like watching.
I lurked for a long time before I started contributing.
lue I wouldn't REALLY kick them. That would take a lot of typing and backlash :(
Tene There are plenty of other channels that I just lurk in.
TimToady there is no pecking order here 05:07
Tene Hmm. Looks like I don't have privileges to modify the access list for #perl6 anyway. 05:09
05:11 nihiliad left
lue probably the only thing i'd do with chanop is rename pugssvn to cyberman :D 05:11
diakopter I (still) hope you're (still) kidding 05:12
Tene Hmm. By my reading of this, nobody here has has access to modify the access list, only freenode-staff.
diakopter I think audreyt does
Tene lue: You know you can't do that, right?
arlinius can't rename users with op status :P
Tene diakopter: not anymore. she's not even set as founder anymore.
diakopter oh, ok
Tene freenode-staff is set as founder
pmichaud I contacted the freenode staff to try to regain some channel control (with mst++'s help) but heard no response.
phenny pmichaud: 04:58Z <lue> tell pmichaud I don't need an example!
pmichaud I'll likely try again.
Tene and as successor. 05:13
diakopter arlinius: no one can rename *anyone* else
05:13 hercynium joined
diakopter oh, that's what you were saying 05:13
Tene diakopter: staff can force nick changes on some ircds.
lue I wonder how masak's doing with the TARDIS, and where that progress is...
diakopter Tene: 05:14
arlinius sure, but you can (theoretically) give a command to a bot to tell it to rename itself
lue phenny: tell masak the past wants him to come back here and answer some questions about the TARDIS
phenny lue: I'll pass that on when masak is around.
arlinius it just has nothing to do with being a channel op
but yeah, that's basically what i was saying
lue I would think you could change the names of _bots_. Not people, but bots... 05:15
Tene lue: no difference, as far as IRC is concerned.
pmichaud: proposal on who to have set as founder and successor?
pmichaud I was just going to set me as founder to begin with, then anyone else as successor. 05:16
I don't need to be founder -- I was just the person who agreed to try to make something happen :)
Tene nods.
pmichaud my first act would likely be to find someone to pass it off to :)
lue Hard tossup between pmichaud and TimToady: founder of P6, or founder of Rakudo? hmmm
Tene lue: founder just means privileges to amdinister the channel in additional ways. 05:17
lue and the title of Admin (like how I like just having the title of op) 05:18
s/Admin/Founder/
05:19 justatheory left
Tene #freenode says that we need to freenode.net/group_registration.shtml which I'm currently reading. 05:20
lue let's pillage the offices! ...and register as a group. (oh wait, not that kind of group registration) 05:21
pmichaud yes, that's what I did before :) 05:23
lue check out freenode.net/group_pillage.shtml. I think that's what we should do :) 05:25
arlinius we should not find a page on a server? :) 05:26
lue also vikingguide.info/freenode_strategy_C3.html :)
Tene pmichaud: #freenode says that only you can inquire about a group registration form you've submitted. :P 05:27
lue the term is *en*quire, not inquire (I'm not british, but still)
pmichaud that was many weeks ago -- I'd have to go back and track it down
diakopter they keep records of them; if you submitted it, they have it (allegedly)
probably some mailing list 05:28
pmichaud where do I inquire?
diakopter I msg'd you
lue: why do you think "the term is *en*quire, not inquire" 05:34
lue enquire is informal, inquire is formal (in British English, no distinction in American) 05:35
Such as: I enquire you about your bananas, the FCC inquires you about your pirate radio. 05:36
arlinius hrm 05:37
diakopter Oxford English Dictionary has this for "enquire": An alternative form of INQUIRE. The mod. Dicts. give inquire as the standard form, but enquire is still very frequently used, esp. in the sense ‘to ask a question’.
lue And, despite my not being british (i'm american), I have developed the tendency to type humourous instead of humorous.
diakopter also www.askoxford.com/asktheexperts/faq...ge/enquire 05:38
arlinius lue: what they're talking about could be described as a formal inquiry anyway 05:39
lue that's redundant (askoxford proves my point, actually) 05:40
(i'm weird that way, you find me harp on the strangest points sometimes :D)
05:41 Achilles333 joined
arlinius how current are the docs in the rakudo git repository's docs directory? 05:42
05:44 am0c left
pmichaud time for sleep here 05:45
05:48 gfx joined 05:58 am0c joined
lue anyone here? (leafing through fortune-mod to pass the time) 06:18
Tene I am. 06:19
lue (still leafing through fortune-mod...sigh) 06:20
arlinius I guess guide_to_setting applied to alpha and is (partly?) obsolete in master? 06:38
06:46 am0c left 07:00 am0c joined 07:02 eternaleye left 07:10 eternaleye joined
lue it is called night, and I have found it to be good. I call it... 07:40
...goodnight
07:41 lue left 08:38 iblechbot joined 08:44 lejon joined 08:47 gfx left
lejon Hello, anyone here? 08:56
09:05 athenot left 09:07 Achilles333 left 09:15 mberends joined
mberends hi lejon 09:16
lejon hi there
09:16 mssm joined
mberends it would be nice if you could come to conferences.yapceurope.org/hack2010dk/ 09:17
09:18 IllvilJa joined
lejon Looks great, but don't think I can make it, I'm happy if I get the evenings to play around with p6... 09:20
09:20 Guest55249 joined
mberends fine, the conferences tend to stimulate a lot of extra interest in a region anyway. stay in touch... 09:23
09:24 Su-Shee joined
mberends rakudo: .say for @*INC # newly added 09:25
p6eval rakudo a7403f: OUTPUT«/home/p6eval/.perl6/lib␤/home/p6eval//p1/lib/parrot/2.1.0-devel/languages/perl6/lib␤lib␤.␤»
Su-Shee good morning
mberends hi Su-Shee
rakudo: run 'echo $PERL6LIB' 09:27
p6eval rakudo a7403f: OUTPUT«lib␤»
mberends ok
09:41 eternaleye left 09:43 gbacon joined 09:51 eternaleye joined 09:58 lejon left 10:04 Guest55249 left 10:26 orafu left, orafu joined 10:38 Trashlord joined, pmurias joined
pmurias ruoso: hi 10:38
Trashlord I think I have a hard drive that's about to fail 10:39
well, not about to, but it will sometime in the near future
mberends Trashlord: start using a new hard drive *before* the old one dies, it's much easier to recover stuff that way 10:43
Trashlord it's just music, it's already backed up on an external drive 10:44
I knew its life is going to end soon, so I bought an external and backed up everything, just in case
can't afford to lose 40GB of music, heh
but well, I think I'll order a new drive anyway
IDE drives should be pretty cheap
mberends I'm starting to use Ubuntu One as cloud storage 10:45
Trashlord I don't really like cloud storage
feels like my data isn't really mine
kinda paranoid about it
mberends it's not suitable as primary storage, but probably useful as a spare copy 10:46
10:58 redicaps left
pmurias mberends: how's vill doing? 11:13
mberends pmurias: it's dormant, I have decided to concentrate on Rakudo * until that is released, and LLVM upgrades to 2.7 at the end of March, with some incompatible API changes 11:17
11:30 jnthn joined
mberends \o jnthn 11:32
11:35 mkyser left 11:36 iblechbot left 11:43 uniejo joined
jnthn hi, mberends 11:56
Infinoid dalek can't seem to find the "ng" branch feed any more. Is that expected? 12:00
jnthn Infinoid: It has ceased to exist. 12:01
Infinoid: Became master.
Infinoid awesome, I'll stop trying to track it then
jnthn :-)
mberends Infinoid: it has gone to meet its Maker. It is an ex-branch ;-)
jnthn Infinoid: Are commits from Rakudo master being reported again now too? 12:08
Infinoid: Yesterday it appears they weren't...but maybe that's resolved now.
12:08 Sarten-X2 joined
colomon o/ 12:09
phenny colomon: 04:53Z <pmichaud> tell colomon in dec_number, try changing $I2 to $N2 and then switch the call to Rat.new to instead be &infix:</>
jnthn hi colomon
colomon hello! 12:10
Infinoid jnthn: I think the plugin crashed due to not finding the ng feed 12:12
working on that now.
jnthn Infinoid: Cool, thanks.
Infinoid (and adding the sanity checks I promised to add, regarding input checking for bad feed data) 12:13
mberends fresh Rakudo checkout does not build on freshly installed Ubuntu 9.10 :-( 12:14
jnthn so hopes it's not that they have That Version Of GCC 12:15
(Though unlikely.)
mberends gcc 4.4.1-4ubuntu9
jnthn Oh, phew. 4.1.2/4.1.3 are the ones that had the issue. 12:16
Su-Shee yes. I had this.
12:17 payload joined
jnthn It's surprising, because compilers are normally perfect peices of software without bugs. 12:17
;-) ;-) 12:18
mberends its last gasp is "Killed make: *** [perl6.pbc] Error 137" from perl6.pbc --target=pir src/gen/core.pm > src/gen/core.pir
Su-Shee well I solved the problem competently by installing a different minor of gcc. ;)
jnthn Killed?
Ouch.
mberends yep, it musta been very sore 12:19
jnthn Out of memory or something?
mberends unlikely, but will start gathering more info from a new run 12:21
jnthn Are you working with Parrot HEAD or the one from PARROT_REVISION? 12:22
mberends PARROT_REVISION, from Configure.pl --gen-parrot
12:23 dalek left, dalek joined
lisppaste3 mberends pasted "Rakudo build failure on Linux/x86" at paste.lisp.org/display/95736 12:23
12:26 wknight8111 joined
Infinoid Everything about dalek should be perfect now. If not, please feel free to scream at me about it 12:27
mberends thanks Infinoid++ 12:28
jnthn Exit code 137: The job was killed because it exceeded the time limit. 12:30
oh, wait, that might not be a general meaning... 12:31
mberends ah, thanks jnthn++. (Note to self: get a fasta computa)
(it was relatively unknown that the Rakudo build process has Attention Deficit Disorder) 12:33
wknight8111 good morning #parrot
jnthn fail.
colomon wknight8111: good morning, but this is #perl6 12:34
wknight8111 colomon: Ah, damnit
too early!
mberends ENEEDCOFFEE
jnthn wknight8111: No, I don't think you can characterize Perl 6 that way. ;-)
mberends: Dunno if it is a time-out style issue though. 12:35
mberends: Try deleting a chunk of core.pm and see if it works. ;-)
mberends jnthn: but it fits the Killed message. Doing new fresh builds on x86 and amd64 right now. 12:36
jnthn
.oO( Do u limit the time it can run for? :-) )
12:37
mberends that kinda stifles the hope of getting Rakudo into Android any time soon :(
mberends has no limits
12:40 am0c left
jnthn mberends: Well, there has been ponderings of splitting up the build process, but it creates its own complications. 12:40
OTOH we do have sub classes workingish now. 12:41
colomon Hmmm... could you have Parrot running on Android and do Perl 6 to PIR conversion on a big machine?
mberends that sounds like a good hackathon brainstorming topic, along with modularized testing
jnthn colomon: Yes, true. 12:42
colomon would love to have a good excuse to get an Android...
mberends colomon: good idea. My Android cost me £0.01, plus a 24 month contract...
colomon nice price! 12:43
mberends It's an LG GW-620 from t-mobile uk
colomon I'm pretty sure I could convince Verizon to give me a good price for a Droid. But still probably $100 or so. 12:46
uniejo also considers buying an Android - Waiting to see HTC Desire in the shops.
mberends ah, the failing Ubuntu environment has no swap space, and "only" 1GB RAM :-/ 12:48
12:48 lisppaste3 joined 12:49 ggoebel joined
uniejo mberends: If you have disk space you can create a temp swap file and attach to the swap space. 12:50
mberends uniejo: ok, will do that as soon as the latest checkout crashes again 12:51
(there is a partition created for swap, but not yet mkswap'ed) 12:52
uniejo Ok, that should make it work. 12:53
12:54 am0c joined
mberends the parrot process running perl6.pbc has a very volatile virtual memory size, from around 250MB to 380MB. And it just died the same way. 12:55
at least the volatility indicates that GC is working properly
uniejo remember in the early days where recommended swap space used to be less than 200MB. Now i prefer to have about 2G of swap space. It kund of makes the difference between a perl script crashing after doing a lot of processing + data, and doing a slow finish due to swapping. 12:56
mberends a slow finish trumps a crash every time 12:57
colomon may need help momentarily getting the PAST right for an infix:</> operation.... 12:59
uniejo colomon: Sorry. I do not think that I have enough PAST knowledge to help. What is your problem? 13:05
colomon I'm trying to embed a call to infix:</> in Actions.pm.
But it actually seems to have "worked" on first try. 13:06
uniejo Great.
13:06 Guest85017 joined
mberends swap space solved the build problem. parrot perl6.pbc peaked at 593MB 13:06
jnthn Wow! 13:08
colomon: PAST::Op.new( :pasttype('call'), :name('&infix:</>'), ...args... ) or some such. :-) 13:09
colomon I did 13:10
make PAST::Op.new( :name('&infix:</>'), :pasttype('call'),
$int * $base + $frac, $base
);
which seems to work. Except that it doesn't actually do the right thing.
jnthn The PAST production looks sane.
colomon yeah, no, it's the algorithm that's broke. 13:11
> say 1.1 13:20
1.1
> say 1.11111111111111111111111111111
1
> say (1.11111111111111111111111111111).WHAT
Num()
> say (1.1).WHAT
Rat()
uniejo just tested memory usage for a one liner -e 'sleep(100)'. Perl6 uses about 38792 kb and perl 5 about 1260 kb. Rss size from `ps -eo pid,user,args,rss | grep sleep` 13:24
13:27 Chillance joined 13:36 xinming_ is now known as xinming, cgra joined 13:41 cgra left 13:43 lichtkind joined 13:44 lejon joined
lejon Hi all! 13:44
Does anyone know if there is a standard idiom for doing "file slurp" in perl 6?
lichtkind hai lejon
slurp 13:45
lejon Ah!
:)
lichtkind $content = slurp $filename;
or @content_lines = slurp $filename;
lejon Cool! And that is a "built in" now? (I.e don need to "use" anything...) 13:46
lichtkind yes mam
lejon Super cool! :)
lichtkind but i dont know if its implemented already in rakudo
lejon ok... that would be a pity! :) 13:47
since that's what I'm using...
lichtkind lejon: yes but perl 6 is huge lang, it cant be done all
lejon: yes its very practical
lejon Yep, I do understand that!
so "slurp" will work both on filenames and filehandles I guess? 13:48
slurp is indeed implemented in Rakudo!! Yay!! :) 13:49
Wat cool!
I mean, Way cool!
colomon lichtkind: I don't think @content_lines = slurp $filename works? Or at least, not the way you'd expect? 13:51
lichtkind lejon: ah does ist also work on handles?
colomon I would expect that to be @content_lines = lines($filename); (which is lazy...)
lichtkind colomon: i think i sae that once in synopses 13:52
colomon $filehandle.slurp works.
lejon colomon is correct 13:53
but slurp $filehandle did not work...
colomon lejon: is that in the spec? It would be easy enough to add....
lichtkind yeah after reading svn.pugscode.org/pugs/docs/Perl6/Sp...ary/IO.pod 13:54
lejon dont know, actually...
uniejo Lines work. 'my @lines = lines "README"; say @lines[2]'
lichtkind i think colomon++ is right indeed
lejon I'm testing it in rakudo as we speak :)
lichtkind i seen
colomon lines($filehandle) and lines($filename) should both work, I think.
lichtkind and eager lines will push the laziness out of lines :) 13:55
lejon really super nice, I always missed that in Perl 5 13:56
colomon It's amazing the things you learn implementing enough to get tests to pass. ;)
lichtkind colomon: i dont understand 13:57
uniejo Remember that lines in Perl 6 already have the line feed removed, except for slurp.
lichtkind uniejo: very cool 13:58
colomon lichtkind: I implemented the lazy version of lines and the sub version that takes a filename, both so that we could get more tests passing in spectest. :)
lichtkind colomon great 13:59
snarkyboojum colomon++ :)
colomon well, and I've been waiting lazy lines for about a year now, since I worked out that it would make processing big files drastically more efficient. :) 14:00
but that still doesn't quite work, because for isn't lazy yet.
lichtkind colomon: but with rakudo ng it is? 14:02
colomon lichtkind: rakudo is rakudo ng now.
or the other way around, I guess.
I believe pmichaud++ doesn't have lazy for working yet. 14:03
lines is lazy, if you did something like lines("hugefile").grep(/something-to-look-for/).eager, it would only use the memory needed to store the lines that matched the grep, not the entire file. (module garbage collection issues) 14:04
uniejo The branches moved like this on last swap: master => alpha and ng => master 14:05
colomon but for lines("hugefile") -> $line { whatever } will still read the entire file into memory at once, I believe.
pmichaud no, lines() is lazy. 14:10
lejon Does anyone have and hints or pointers on how to debug Perl 6 grammars?
colomon pmichaud: right, but is for lazy yet?
I thought you'd disabled that last I heard.
mberends lejon: start with small things that work, then test everything you add 14:11
lichtkind mberends: cheers
mberends: i lost you yesterday
mberends lichtkind: prost
lichtkind had network problems
mberends: :)
jnthn In theory, isn't for essentially just sugar for map these days? 14:12
pmichaud for isn't lazy yet.
yes, for is just sugar for map
jnthn OK, and we have lazy map, so "in theory" it should be easy. ;-) 14:13
pmichaud essentially for something { block } ===> list(something).map({ block })
I haven't switched it because we don't have 'sink' yet.
jnthn Ah
Yeah, it'd occurred to me that to do it now would mean a hack that tacks .eager on the end...
But probably better to wait for sink context. 14:14
pmichaud also, we need .map to be smart enough to handle next/last/redo exceptions.
(re: lastofthecarelessmen.blogspot.com/2...atch.html) After a bit of discussion on this last night, I'm thinking we don't really know how array binding works yet. :-( 14:16
jnthn Ouch :-( 14:18
pmichaud 14:09 <lejon> Does anyone have and hints or pointers on how to debug Perl 6 grammars? 14:23
lejon: rakudo (master, not alpha) also has a <?DEBUG> rule that traces the progress of the grammar.
I guess I should add grammars back into master today :0|
afk for a bit 14:24
lejon Aha, cool! Will try it
Thanks for that!
colomon Is there some reason why we can't just say that if you assign an iterator to a @var, it becomes a lazy Array? 14:25
err, except that it makes writing lazy subs impossible without directly addressing the iterator.
yeah, this is Trouble with a capital T. 14:26
(well, the sub could be lazy, but the full Array would be built in memory at some point.)
lejon sorry for my ignorance here but would the #25 Minneapolis release be on the "Master" track? 14:27
colomon was also pondering that perhaps Iterators should derive from Mu rather than Any, but since Iterators are Iterable, that just makes another mess...
lejon i.e support the <?DEBUG> rule?
colomon lejon: #25 was under the old master. which I guess makes it more likely to support <?DEBUG> than #26... 14:29
lejon ok, thanks, added it as the first rule, but I don't really see any effect of it... hmm... 14:30
colomon sorry, I'm fairly grammar ignorant. 14:31
lejon :)
colomon > say 1.777777777777777777777 14:33
0.99999999999861
is not an improvement. :(
14:37 masak joined
masak oh hai, #perl6 14:37
phenny masak: 05:14Z <lue> tell masak the past wants him to come back here and answer some questions about the TARDIS
masak Tene: I think we might have discussed this before, but if so, I've forgotten. where and why are you blocking on spec wrt macros?
rakudo: say True ~~ 42 14:38
p6eval rakudo a7403f: OUTPUT«0␤»
14:38 uniejo left
colomon masak: o/ 14:39
jnthn colomon: As approximations go...that one sucks.
14:39 uniejo joined
jnthn :-/ 14:40
colomon jnthn: yes.
pmichaud <?DEBUG> doesn't exist in alpha 14:41
(so it's not in Minneapolis) 14:42
colomon ah.
does it exist in master?
pmichaud yes. 14:43
but grammars don't exist in master yet
thus 14:23 <pmichaud> I guess I should add grammars back into master today :0|
colomon darned if you do, darned if you don't. :)
pmichaud I'm fine with saying that binding an iterator to a @var creates an Array; but that opens up all sorts of other issues. 14:44
14:44 masak left
colomon yeah, I figured that out for myself. :( 14:44
it seems like a very thorny problem.
mberends pmichaud: rod.create( :back(self) );
pmichaud one of the nastier ones being that the elements of the array still need to be bound to the elements of the iterator -- i.e., they aren't copies.
(which is different from array assignment, where the elements are copies) 14:45
jnthn I still do wonder if we're letting iterators leak out too much.
pmichaud jnthn: we may be, but I think that aspect is actually orthogonal to this problem :-| 14:46
jnthn But I guess we can't help that.
pmichaud my guess at this point is that we're trying to be a bit too clever in saying that @-sigil binds to anything Positional 14:47
because most people expect @ to behave like Array, and not every Positional acts like an Array
lejon pmichaud: ok, I see, I just started experimenting with this yesterday so I'm not entirely clear on the different tracks... :) 14:48
pmichaud lejon: in absence of <?DEBUG> -- the recommendation is to do as mberends suggested: use small incremental changes to the grammar and test frequently.
jnthn Well, I see it as a conflict between desire to keep values reified, or just to produce them and throw them away. 14:49
Or at least it's partially that.
When the iterator is bound the @a, we expect it to have Seq-ish semantics.
pmichaud yes, partially that
lejon *nod* I started playing with one of the example grammars ("CSSGrammar")... just to get into it..., will try to break things down...
pmichaud but we also want things bound to @a to have throw-it-away semantics 14:50
which Seq doesn't have.
colomon pmichaud: right, that's the real sticking point in my mind.
pmichaud which tells me that @ should in fact mean "Array" and not just "Positional" 14:51
14:51 lejon left, lejon joined
lejon oops.. 14:51
colomon I don't see how that follows?
pmichaud colomon: if we want throw-it-away semantics, we need to be able to shift
actually, rephrase 14:52
colomon ah, didn't understand what you meant by throw-it-away. maybe.
TimToady maybe Seqs are mutable/immutable in the same sense as Strs
so you could shift one, but the identity changes
pmichaud most people expect @a to remember all of the values until explicitly told to forget one, thus if we want throw-it-away semantics we need to be able to shift 14:53
TimToady: yes, I'd been brainstorming something like that a short while ago (offline, not on #perl6)
but then it feels like we should just use Array. Or perhaps the difference between Seq and Array becomes the way its elements are bound 14:54
TimToady perhaps we should stick with more of a p5ish model of mutability until we find the optimizer needs Seq and immutable Strs 14:56
then negotiate
pmichaud in addition to binding to iterators, we want to be able to handle binding to other positionals as well. for example, my @a := 1..100000;
if @a is bound to a range (which does Positional), we still want to be able to process the elements with throw-it-away semantics 14:57
so that somewhat implies that @a is something other than the Range directly
(p5ish model) yes, that seems like a possibility also 14:58
TimToady maybe we somehow need to unify arrays and iterators, such that getarg is the same as shift 15:00
and since arrays track known/unknown
you don't get positional elements till you request them
pmichaud I think that helps, yes, but I'm not sure it resolves the dilemma fromt he post
*from the
TimToady and any shift on a pure iterator just pulls straight from the queue
haven't backlogged 15:01
pmichaud (the one from last night)
i.e., if @a is bound to an iterator, people still expect +@a to not consume the iterator
TimToady it wouldn't, if that's considered a reifying operation
only shift consumes it
pmichaud in which case the iterator "has memory" by default, or @a is something other than an iterator 15:02
TimToady +@a would only copy the internal extender iterator into reified values, logically
pmichaud so then @a is really an Array
TimToady evey array is a reified section plus an iterator
either of which can be empty
pmichaud right, I'm saying that @a isn't an iterator, then. 15:03
lisppaste3 colomon pasted "What's worrying me..." at paste.lisp.org/display/95738
pmichaud (it's an iterable, but not an iterator)
TimToady it is if you shift it
fundamentally unifies shift and getarg 15:04
pmichaud sure, I was in favor of that from the beginning (weeks ago)
TimToady so there is not getarg anymore
or getarg is shift, and get can unpack a 'sub-shift'
pmichaud I'm just trying to figure out what really happens when we bind to a @-sigiled variable
15:06 Trashlord left
TimToady if everything is using the Array interface, it becomes simple again 15:06
pmichaud right, so my @a := gather { ... }; means that @a is in fact an Array, and not the lazy iterator thing returned by gather (more) 15:07
or, gather returns an Array with its lazy portion already established
TimToady @a is a lazy iterator thing returned by gather that knows the Array interface already
colomon "already established"? 15:08
TimToady an iterator is just an array with no reified part (yet)
pmichaud but I'm not sure what to do with my @a := 5..1000;
or an array is just an iterator with a reified part :-) 15:09
TimToady well, we still probably need the concept of getting an iterator from an iterable, but in this case it would present an Array interface as soon as it's an iterator
pmichaud for reference, I mused about .shift and .get some time ago: irclog.perlgeek.de/perl6/2010-01-23#i_1923841 15:10
it does tend to want an interface other than return EMPTY, though.
TimToady but I think shift is really getarg, and get can pull stuff out of @a[0]
maybe 15:11
could be the other way
I guess p5 is more get == shift
i.e. flattening
pmichaud so, in the case of my @a := 5..1000; the binding actually grabs an iterator from the range?
(or otherwise builds an Array that has a Range in its lazy portion?) 15:12
TimToady well, any binding of immutable to mutable either has to fail or copy somehow 15:14
maybe such a binding turns into assignment?
pmichaud well, we don't exactly want assignment
because with my @a := @b; the elements of @a need to be the same as @b 15:15
TimToady but you want to poke a RangeIterator into the Array imaginary bit
jnthn TimToady: Do you see @ as implying mutability as well as Positional?
TimToady I think that's what we're being driven toward currently
jnthn OK
pmichaud mutability for the array, but not necessarily for its elements 15:16
jnthn Yes - that's a good distinction to draw.
pmichaud i.e., we can shift the array, but not necessarily modify the elements in the array
jnthn nod
TimToady and a Str is an Array of NFG chars, probably 15:17
presumably compact
I think it's okay to have intermediate lazy iterator types, as long as they're only ever hidden in the imaginary part of an array 15:18
pmichaud so, is there a method that gets called on an object that says "return something I can bind to an array?"
I'd be very happy if we could hide all of our iterators behind Array 15:19
TimToady from the standpoint of human engineering, I think that would be a win too
pmichaud well, that's why I'd be happy :)
TimToady I shudder every time .WHAT returns GatherIterator
pmichaud same here.
lichtkind does .get also autochomp?
pmichaud but a question: if .shift is the normal way to iterate over elements of an Array, how do we signal end-of-iteration? 15:20
15:20 meppl joined
TimToady let's trying unifying them, then, and if it's the right decision, other things should get simpler, though Array itself has to always know both parts 15:20
same way?
pmichaud so, shifting an empty array returns Empty ?
TimToady yeah
pmichaud that feels weird, but okay. Same for .pop ? 15:21
TimToady we need to take the best parts about Arrays and Iterators and smush them together
and people who use +@array to mean ?@array will need to learn that ?@array doesn't have to count all the elements
lichtkind colomon: does .get also autochomp?
TimToady whiel +@array does
*while
pmichaud yes, I noticed that also. (more) 15:22
colomon lichtkind: pretty sure yes.
pmichaud I almost wrote that as a comment to the post, but couldn't find a diplomatic way to say it :)
colomon really?
pmichaud (it was late) 15:23
colomon Not the diplomatic bit, the ?@array bit.
pmichaud sure
?@array simply means "is the array empty?" We can figure that out by just producing a single element (or not) 15:24
+@array means "how many elements do you have?" That requires producing them all.
lichtkind colomon: thanks
colomon I don't recall ever seeing that used, there are a lot of places in the core where that would come in handy....
pmichaud in the posting, the code said
sub sum(@a) { +@a ?? @a.reduce(...) !! 0 }
much better would've been ?@a instead of +@a
TimToady well, it's still the case that you usually just want to do what you're doing and check for Empty afterwards
pmichaud and since the part before ?? is in boolean context already, one could even omit the ? and/or + altogether 15:25
TimToady and we haven't really solved the get vs getarg problem yet
pmichaud TimToady: correct
my guess is that getarg is really a shift on a Slicel
TimToady don't think it can be that simple 15:26
colomon pmichaud: My perception has been that @a in boolean context tests definedness rather than quantity of elements.
TimToady param binding is currently defined in terms of get vs getarg on the same sequence 15:27
colomon: no, it tells that the array isn't empty
colomon TimToady: I don't mean in theory, I mean in practice.
pmichaud TimToady: then in general, things like gather, map, etc. tend to return Slicels instead of Arrays, and binding to an Array flattens the Slicel
TimToady an empty array is defined
jnthn colomon: .Bool by default looks at .defined, but for arrays it should be overrideen.
lichtkind colomon: thanks for helping me with www.perlfoundation.org/perl6/index....0227005830
TimToady but false
jnthn s/dee/dde/
lichtkind mberends: still there? 15:28
TimToady have to go shower, but will think about shift vs flat/slice semantics
colomon rakudo: my @a; @a ?? say "True" !! say "False"
TimToady afk &
pmichaud okay. I'll start on an Array/Iterator unification
p6eval rakudo a7403f: OUTPUT«True␤»
pmichaud rakudo is wrong there. 15:29
colomon pmichaud: but that's why I've been using +@a or @a.elems in code for that. :)
pmichaud then it's been wrong for a long time.
alpha: my @a; say @a ?? 'True' !! 'False';
p6eval alpha 30e0ed: OUTPUT«False␤»
pmichaud but apparently not too long :)
colomon rakudo: my @a; ?@a ?? say "True" !! say "False" 15:30
p6eval rakudo a7403f: OUTPUT«True␤»
pmichaud rakudo is still wrong there :-)
alpha: my @a; ?@a ?? say 'True' !! say 'False'
p6eval alpha 30e0ed: OUTPUT«False␤»
pmichaud alpha is right again
colomon What can I say, I've been programming in ng for four months now. :) 15:31
pmichaud as I've been saying, using @a.elems is code smell
because we're forcing something lazy to become eager
colomon .elems is pretty necessary for dealing with negative index arguments in array functions. 15:32
but yeah, lazy is good.
pmichaud sure, in that case it's fine
.elems when explicitly needing to talk about positionals is probably okay 15:33
but .elems just to check for emptiness, or to process elements n-at-a-time is wrong
dalek kudo: 67f51f7 | moritz++ | src/cheats/match-bool.pm:
cheat in Regex::Match.defined
15:34
kudo: d4df605 | moritz++ | t/spectest.data:
more passing test files
kudo: 1a5d342 | moritz++ | Test.pm:
[Test.pm] diag() actual type of failed isa_ok() test
colomon So, are there tests for Array.Bool out there somewhere? 15:39
Seq.Bool, I mean. 15:42
15:42 Psyche^ joined 15:46 Patterner left, Psyche^ is now known as Patterner
pmichaud I don't know if there are or not. There need to be :) 15:50
colomon I've got it coded up. 15:51
multi method Bool() {
self!fill(1) ?? Bool::True !! Bool::False;
}
It tests okay by hand.
15:54 dual left
colomon So, is it kosher to have side effects in iterators for tests? 15:56
Or perhaps more sensibly, do we have a testing method that can test whether or not an iterator has been completely iterated? 16:01
16:02 iblechbot joined 16:08 pmurias left
mberends lichtkind: pong 16:13
lichtkind ah 16:14
16:15 Guest85017 left
pugssvn r29886 | colomon++ | [t/spec] Some basic tests for Seq.Bool / Array.Bool. 16:15
mberends colomon: git pull before you commit, t/spectest.data just pushed 16:19
colomon mberends++
dalek kudo: 7ef1ac2 | (Martin Berends)++ | t/spectest.data:
[t/spectest.data] re-enable S28-named-variables/inc.t, all 3 pass (@*INC)
16:20
diakopter hm 16:23
mberends is there an example anywhere of a tied hash written in PIR? 16:29
jnthn mberends: Did we ever ascertain that just taking an instnace of the Env PMC and passing it to '&CREATE_HASH_LOW_LEVEL' and sticking what's returned in the namespace wouldn't work? 16:33
mberends jnthn: we never tried exactly that, you did warm that it might go *boom* ;) 16:34
jnthn It might, but it fight be FANTASTIC.
*might
mberends the env PMC is standing by... 100. 99. 98. 97... 16:35
colomon jnthn: t/spec/S32-scalar/defined.t has two failures, looks like it might be Nil?
rakudo: say defined(Nil) 16:39
p6eval rakudo 67f51f: OUTPUT«0␤»
jnthn colomon: erm 16:41
TimToady went and spec'd that this is True, iirc
Unfortunately, I'm a bit...bewildered...still on that.
Since along with $foo.?does_not_exist returns Nil
That menas things like
$foo.?does_not_exist // 2 # breaks 16:42
We rely on that working somewhere in the setting.
It may be that the code in the setting has wrong expectations.
colomon I'm very confused by the spectest results, but none of it seems to be related to what I just did... 16:43
dalek kudo: f2975bf | (Solomon Foster)++ | t/spectest.data:
Add new test file S32-array/bool.t.
kudo: d42198a | (Solomon Foster)++ | src/core/Seq.pm:
Implement Seq.Bool.
jnthn colomon: I changed Nil to be undefined yesterday.
hang on, let me re-read the spec ommit
to be sure I actually understood it
colomon but it looks like the test that is failing is testing for Nil to be undefined... 16:44
jnthn oh.
Since method calls are performed directly on
+any object, C<Nil.defined> returns C<True> just as C<().defined> does.
colomon not ok 13 - variable $foo is now undefined again
$foo = Nil; 16:45
ok(!defined($foo), 'variable $foo is now undefined again');
jnthn hmm
rakudo: my $foo = 42; say defined($foo); $foo = Nil; say defined($foo) 16:46
p6eval rakudo 7ef1ac: OUTPUT«1␤1␤»
jnthn rakudo: say defined(Nil)
p6eval rakudo 7ef1ac: OUTPUT«0␤»
jnthn rakudo: my $foo = Nil; say $foo.WHAT
p6eval rakudo 7ef1ac: OUTPUT«Seq()␤»
jnthn Oh.
mberends jnthn: it's half of FANTASTIC (FANTA). %*ENV didn't go boom, but it's read-only ;-) 16:47
jnthn Lemon or orange?
:-)
mberends sweet lemon
jnthn mmm
Would go well with stroopwafels. 16:48
.oO( Yay, I goes to Holland for a couple of days next week! )
mberends aw, that was my surprise for you ;)
colomon anyway, I had four spectests fail, so our tests have gotten messy again.
jnthn colomon: Fails thare are there without your patches?
OK, probably my-- fault.
16:49 dual joined
jnthn mberends: What happens when you try to write to it? 16:49
"Cannot assign to readonly..."?
colomon I dunno, I made changes and then did a pull --rebase, so I don't know before and after.
mberends xactly 16:50
colomon let me revert locally and see...
jnthn mberends: I think I know why, I've not a solution immediately to hand.
mberends jnthn: there may be a way to add a role that intercepts the writing
jnthn Yes
Maybe 16:51
Well
mberends shall I commit the read-only code?
jnthn It's osrt of an assign/binding mis-match too.
Yes, it's progress.
It enables CGIs! ;-)
mberends yes, and microbenchmarks
jnthn \o/ 16:52
16:52 justatheory joined
pmichaud (Nil and defined) I'm pretty sure that it should be defined. 16:54
jnthn pmichaud: I can go with that, I just need an answer on my .? question :-)
That is, if I do $foo.?does_not_exist and get Nil back, how do I test if a method was called or not, and then provide the alternate value? 16:55
pmichaud I'm not sure that .?does_not_exist should really be returning Nil. 16:56
jnthn Awww! 16:57
pmichaud (Yes, I know it got speced that way... I'm just not sure it works out)
jnthn Yeah, it all worked out nicely when Nil was undefined, which is why it all made sense to me at the time. :-)
pmichaud well, until a few weeks ago we had .?does_not_exist returning undef/failure 16:58
jnthn Yeah
But failure was deemed "too strong" or something.
(That is, you wrote .?)
(So you said it's OK if the thing isn't there)
16:59 ggoebel left
pmichaud well, would someone do .*method // 2 ? 17:00
17:00 ggoebel joined
dalek kudo: 40f0e06 | (Martin Berends)++ | src/glue/run.pir:
[glue/run.pir] add a crafty read-only %*ENV suggested by jnthn++
17:00
jnthn Maybe not, but the use-cases differ. 17:01
colomon jnthn: yup, all failures without my patch, too.
*happen
jnthn .* = call all available things - I'm expecting some (maybe empty) list of results.
Same with .+
With .? it makes sense that you'd usually want to substitute another value if there wasn't one returned. 17:02
erm
pmichaud this sounds like the same issue we had at one point with +/*/? in regexes
jnthn if there wasn't a method to call
There may be an analogy, yes.
pmichaud perhaps .? should always return a list
just like <xyz>? always creates an array 17:03
jnthn Hm
pmichaud if so, then
jnthn Then you can just use ||
17:03 Achilles333 joined
pmichaud my $result = $obj.?no_such_method[0] // 2 17:03
jnthn Yeah
That [0] feels like a smell though.
pmichaud well, it's what we do in regexes
jnthn Yeah, and I trip over it there too. :-) 17:04
pmichaud so that would be more consistent
jnthn Yes, consistent I agree on.
Though I can agree to inconsistency through difference use case too, so... :-)
17:05 ggoebel left 17:10 xomas_ joined 17:14 ggoebel joined 17:16 ggoebel left, lejon_ joined 17:18 lejon left, lejon_ is now known as lejon 17:19 lue joined
lue hello! 17:22
17:24 ggoebel joined 17:29 Achilles333 left
pmichaud lue: o/ 17:31
17:31 xomas_ left
lue o/ 17:31
(geez it's quiet right now...)
pmichaud yes, I think the latest round of "omg the spec is changing" kinda threw everyone off for a bit. :) 17:32
TimToady: a few thoughts about array/iterator/etc. 17:33
(coming over several input lines) 17:34
lue the spec did what?
pmichaud - I think we might want to go back to the notion of 'List' as a fundamental type 17:35
dalek kudo: b4ccaa0 | (Solomon Foster)++ | src/core/A (2 files):
Switch to ?@array in a couple of places.
pmichaud - List itself can do shift/unshift/push/pop, so its "mutable" in that sense
- in this sense, List would replace our current notion of Seq 17:36
17:36 Trashlord joined
pmichaud - the main difference between List and Array is that List holds references to the things it iterates (e.g., if iterating a list of containers), while Array copies the values 17:36
- the primary meaning of @ is "does List" (and Array ~~ List) 17:37
- we might be able to retain the notion of @ as being "does Positional", but we then need to figure out what we want to do with something like my @a := 1..10000; 17:38
lue I don't know why, but seeing Seq makes me think of sed and some cool-looking character in a Capcom game...
pmichaud - although I guess we have to figure out the meaning of my @a := 1..100000; anyway, as it's clear @a has to be bound to a List and not to the Range directly. 17:39
- (end of thoughts for now)
lue rakudo: my @a=0..*; @a[Inf]=3; say @a[Inf]; 17:42
p6eval rakudo 40f0e0: OUTPUT«Cannot use negative index on arrays␤current instr.: '&die' pc 16676 (src/builtins/Junction.pir:347)␤»
lue ...what?
rakudo: my @a=0..*; @a[+Inf]=3; say @a[+Inf]; 17:43
p6eval rakudo 40f0e0: OUTPUT«Cannot use negative index on arrays␤current instr.: '&die' pc 16676 (src/builtins/Junction.pir:347)␤»
lue ô.ō
moritz_ rakudo: say Inf < 0
p6eval rakudo 40f0e0: OUTPUT«0␤»
pmichaud afk # lunch 17:45
arnsholt rakudo: Inf > 0
p6eval rakudo 40f0e0: ( no output )
arnsholt rakudo: say Inf > 0
p6eval rakudo 40f0e0: OUTPUT«1␤»
lue I expected an error with my array code, but not a negative index error! 17:46
17:49 nihiliad joined
moritz_ lue: please file a bug report 17:50
17:50 ggoebel left 17:51 ggoebel joined
lue where doth I 'file' this, how you call it, 'bug report' ? 17:53
moritz_ lue: send a mail to [email@hidden.address] 17:54
moritz_ gets lots of spectest failures :(
17:55 ggoebel left
lue I'm not used to filing a bug report for rakudo. Usually, I find a bug, we discuss it, and someone starts to fix it :D 17:58
17:58 TiMBuS joined
moritz_ lue: time to get used to it 17:58
lue: it's not hard
lue: just copy&paste what you did, and the explanation that the error message is simply wrong 17:59
18:02 payload left
colomon rakudo: say Inf.Int 18:05
p6eval rakudo 40f0e0: OUTPUT«-9223372036854775808␤»
18:05 amindfv left
lue ...wow, it's not sending. (Maybe that's a sign) :D 18:07
colomon pmichaud: my only objection to your new List idea is it still prevents us from writing memory-efficient lazy subs without diving down to the iterator level. 18:09
18:09 ggoebel joined
lue I think I'll leave rakudobug for other people to use. I can't send the email (honest!) :) 18:11
18:12 ggoebel left 18:16 athenot joined
jnthn colomon: Is the problem that sub foo(@x) { @x.grep(/bar/) } at some point will reify everything? 18:16
colomon: Or put differently:
colomon jnthn: yes, that's what I'm worried about.
lue jnthn: o/ read last night's backlogs? :)
jnthn for foo(lines($file)) -> $line { ... } 18:17
lue: I hear I gets a sub.
:-P
lue oh yes. And uncovering several key details about P6 subs in the process...
colomon exactly. I'm worried that ....
jnthn colomon: Yeah, I was just tracing where we reify and keep all the stuff around. 18:18
colomon for lines($file).grep(/bar/) -> $line { ... }
will be much more efficient than the foo version.
(well, actually I'm worried that the foo version will be less efficient, but you know what I mean)
jnthn colomon: It occurs to me that the problem isn't so much inside the sub itself (that grep would be lazy), but that the thingy the sub returns will keep the data around. 18:19
As the for loop iterates over it.
colomon jnthn: the grep would be lazy, but if @x reifies as it is iterated, it will create a potentially huge array which is completely unnecessary. 18:20
18:20 eternaleye left
jnthn colomon: Right 18:20
colomon I would assume the result of the grep (in foo) would be lazy as well.
jnthn colomon: Was just working through at one point we hit the problem.
But agree we hit it. Hmm. 18:21
colomon It just looks like we might be very lazy and still waste boatloads of memory.
jnthn Right, which is a srs DO NOT WANT.
I agree that ideally developers shouldn't have to drop to iterator semantics just to factor a grep or two out into a sub. 18:22
colomon so the goal is to make sub baz(@x) { @x.grep(/bar/) Z @x.grep(/quux/) } work without making your foo waste memory. 18:23
jnthn 's brain implodes. 18:25
lue what about foobar then :D 18:26
jnthn: at least it wasn't the mess of an *ex*plosion :) 18:28
18:29 eternaleye joined
jnthn Yes, I am occasionally considerate. 18:30
colomon I'm starting to suspect there may be no way to do it (short of clever optimizations). 18:33
jnthn colomon: Yes, it's a tricky one. 18:34
lue I would love to help, but I do not know anything of this problem :( 18:39
18:41 abra joined
colomon jnthn: are we working too hard at this? 18:42
sub foo(@x is iter) { @x.grep(/bar/); }
If you declare "is iter", then your @x is really an iterator, without memory. 18:43
If you don't, it becomes a Seq or something, with full memory.
TimToady no, if shift == get, then we don't have a problem with arrays keeping stuff around 18:44
colomon TimToady: er, yes we do. 18:45
TimToady no, we don't
colomon oh, I see.
no, wait. 18:46
jnthn doesn't see it.
colomon see the @x.grep Z @x.grep example
versus just @x.grep once.
how can you write grep so that it consumes @x in the second case and not in the first?
jnthn Right. In the first we only want to consume the values in the iterator once. 18:47
Implying we need to somehow keep them around
In the second case we don't need to keep them around, but how to know?
TimToady unfortunately, can't talk right now... 18:48
jnthn np 18:51
lue getting the jnthn() sub to do everything is a stretch... especially when one wants to use use infix, postfix, etc. 18:57
19:04 abra left
lue alpha: multi sub infix:<jnthn>($a, $b){say "$a only a test $b";};multi sub postfix:<jnthn>($a){say "$a !";};say 3 jnthn 4; say "hi"jnthn; 19:09
p6eval alpha 30e0ed: OUTPUT«Confused at line 10, near "jnthn;"␤in Main (file <unknown>, line <unknown>)␤»
pmichaud colomon: false
18:08 <colomon> pmichaud: my only objection to your new List idea is it still prevents us from writing memory-efficient lazy subs without diving down to the iterator level.
lue alpha: multi sub infix:<jnthn>($a, $b){say "$a only a test $b";};multi sub postfix:<jnthn!>($a){say "$a !";};say 3 jnthn 4; say "hi"jnthn!;
p6eval alpha 30e0ed: OUTPUT«3 only a test 4␤1␤hi !␤1␤»
pmichaud colomon: we can still do memory-efficient lazy subs, since we can do List.shift 19:10
lue rakudo: say ((1,2,3) + (4,5,6)) 19:11
p6eval rakudo b4ccaa: OUTPUT«6␤»
lue alpha: say ((1,2,3) + (4,5,6)) 19:12
p6eval alpha 30e0ed: OUTPUT«6␤»
pmichaud essentially, if you treat @variable like an array, then it keeps elements around. if you continually shift elements, it acts like an iterator.
lue ô.ō
so, I'm guessing you'd never use + on arrays (either that or that's an error)
pmichaud sure, you can do that -- it just means "how many elements in the array?"
jnthn pmichaud: Maybe I'm just being slow... Any chance you could take our foo and bar examples and explain where / how it's treated like array and iterator in each of them? 19:14
pmichaud looking for the examples
sub foo(@x) { @x.grep(/bar/) } # this one? 19:15
jnthn yes 19:16
sub baz(@x) { @x.grep(/bar/) Z @x.grep(/quux/) }
That's the other one
pmichaud: Assume that we call them both with something like lines($fh) 19:17
lue alpha: multi sub circumfix:<≤≥>($a){say $a;}; ≤"e"≥
p6eval alpha 30e0ed: OUTPUT«Syntax error at line 10, near "\u2264\"e\"\u2265"␤in Main (file <unknown>, line <unknown>)␤»
pmichaud well, the second one clearly reifies @x and keeps it around, otherwise it can't work at all.
lue alpha: multi sub circumfix:<≤ ≥>($a){say $a;}; ≤"e"≥
p6eval alpha 30e0ed: OUTPUT«e␤»
jnthn pmichaud: Right, which is fine. 19:18
lue alpha: multi sub circumfix:<jnthn jnthn>($a){say "do something with $a";}; jnthn"e"jnthn;
p6eval alpha 30e0ed: OUTPUT«do something with e␤»
jnthn What is it about bar that means we reify, and about foo that means we don't?
lue alpha: multi sub circumfix:<jnthn jnthn>($a){say "do something with $a";}; jnthn5jnthn;
p6eval alpha 30e0ed: OUTPUT«do something with 5␤»
jnthn That's my "missing puzzle piece" as it were. :)
pmichaud it depends on what @x is. 19:19
hmmm.
assuming that we do foo($fh.lines) 19:20
$fh.lines is going to return us a List 19:21
it'll be lazy
that list gets bound to @x
we then turn around and call @x.grep, which creates another iterator on the list bound to @x 19:22
grep then works on that iterator. Each iteration does indeed cause @x to reify
so our original List coming back from $fh.lines grows and doesn't lose elements, because we're never shifting it. 19:23
I think that's likely the correct answer here. But the fact that this example causes @x to stick around doesn't mean it's impossible to write one that doesn.t
*doesn't
colomon is back 19:24
pmichaud this particular example is different from what we would get if we had done $fh.lines.grep(/bar/) -- in that case, we don't keep the elements around. 19:25
lue \o \o Hello again, colomon! o/ o/
colomon pmichaud: That's exactly my point.
pmichaud what, that a sub call would work differently from a method call?
or that binding a variable to an object means the object behaves differently in a different context? 19:26
colomon No, that if you do things immediately they can be memory-efficient lazy, but if you refactor them into a sub call they're suddenly memory-wasting lazy.
jnthn pmichaud: iiuc, then:
$fh.lines.grep(/bar/) # doesn't keep stuff around
pmichaud colomon: they're memory-wasting lazy because you bound to a list variable 19:27
jnthn sub foo(@x) { @x.grep(/bar/); foo($fh.lines)
pmichaud sub foo($list) { $list.grep(/bar/); } # not wasting
jnthn Ahh...
But then sub bar($list) { $list.grep(/x/) | $list.grep(/y/) } # epic fail?
pmichaud (I think.)
jnthn gah! 19:28
pmichaud jnthn: yeah, not sure about that one.
jnthn s/|/Z/, sorry
(to my credit, they are next to each other on my keyboard :-))
pmichaud (to your discredit, they're next to each other on your keyboard. Get a real US keyboard :)
colomon :)
jnthn My keyboard is British and thus has awesome national deb^W^Wsomething. 19:29
:-)
lue jnthn: you must be using dvorak :D
jnthn lue: No, querty
er 19:30
qwerty
.oO( now *that's* embrassing to mis-spell )
lue just glide your index finger over the first 6 letters. qqwerty :) (double-q result of glide)
jnthn pmichaud: I can see the arguments for those answers. It just feels perhaps a little surprising.
pmichaud jnthn: I'm not sure of my answers at the moment, they don't make sense. 19:31
colomon I still think my "is iter" suggestion is the clean way out of the situation. By default everything is safe and reifies to Seq/Array. If you declare "is iter" then you get a pure Iterator with the resultant benefits and drawbacks.
Though I suspect someone can come up with a better name that "is iter".
pmichaud instead of "is iter" I think I'd prefer it to just go to a scalar and you do your own explicit shifting 19:32
jnthn In a sense, the problem is that we want to have our iterator and eat it. 19:33
And whether it's "is iter" or "use $ not @" essentially it's a case of giving the user an option of which to do. 19:34
It just feels like a quirky one to explain.
pmichaud quirky to explain that there's a more memory-efficient way of writing certain constructs?
jnthn Well, you get some quite different semantics along with it too (like, only try to use this thingy once). 19:36
I guess we tend to use @ when referring to lists of things, so maybe "use $ instead to say how to deal with this whole bunch of things rather than reify" makes some sense.
colomon no, quirky that if I pass a hash as a scalar, it acts like I'd passed %hash, but if I pass "an array" it may or may not act like I'd passed @array.
jnthn colomon: Thanks, that's what I was trying to say but failing. 19:37
pmichaud oh, I suspect some of this impacts hashes as well
but yes, I get your point
consider:
my $lines = $fh.lines; $lines.grep(/bar/) 19:38
19:38 xomas joined
colomon I'd almost rather break the assumption that the user doesn't see Iterator and force them to declare Iterator $a for this functionality. 19:38
pmichaud colomon: in all of my exeamples, the user doesn't see Iterator
that's not the point/issue.
*examples
my $lines = $fh.lines; say $lines.WHAT; # List 19:39
colomon pmichaud: right, I'm saying IMO it might be better to have the user see Iterator, rather than magically invoking it if they do certain things.
pmichaud I'm reasonably sure that making the iterators visible by default is non-perlish
colomon please continue with your examples, I'm dying of curiosity here. :) 19:40
pmichaud I'm just guessing that we end up keeping things around more often than we suspect 19:41
jnthn Yeah, I see...if that one would keep things around too... 19:42
In a sense, "if you want to not keep things around, never bind or assign" 19:43
pmichaud I wonder how p5 distinguishes something like grep(/x/, <FILE>) from grep(/x/, @a) 19:44
or if it distinguishes them
moritz_ it does not 19:46
pmichaud so, grep(/x/, <FILE>) slurps the entire file into memory as it's processing?
moritz_ yes
pmichaud well.... there ya go.
moritz_ which is why people write while(<FILE>) { ... } rather than for(<FILE>) { ... }
pmichaud yes, but we'd prefer that for lines() { ... } not do that, I suspect. 19:47
moritz_ correct
pmichaud since for lines() { ... } is the preferred replacement for while ....
19:47 lifeng joined
pmichaud I'm not sure how to reconcile the two conflicting views here. 19:47
19:48 moritz_ sets mode: +o jnthn, moritz_ sets mode: +o colomon
lue If I knew what the heck you guys were talking about (I'm not a backlog guy), I could try to impart awesome middle ground :) 19:48
moritz_ lue: if you really cared, you could actually backlog this once :-) 19:49
lue alright. I'm just afraid of becoming insane (uncharacteristic of me to be afraid of that, but...)
colomon pmichaud: it seems to me we're already halfway there, since it seems we've all agreed that iterators should bind in an array-like fashion to @a, and there should also be a way to make that not happen.
pmichaud rakudo: sub foo(@x) { say +@x ?? @x.elems !! 'noway'; }; foo((1,2,3));
p6eval rakudo b4ccaa: OUTPUT«3␤»
pmichaud oh, wait 19:50
rakudo: sub foo(@x) { say +@x ?? @x.elems !! 'noway'; }; foo((1,2,3).map({$_}));
p6eval rakudo b4ccaa: OUTPUT«0␤»
pmichaud lue: ^^^
colomon: I don't like the idea that the array-like/iterator-like property belongs to the container, though. 19:51
moritz_ always thought that .elems and prefix:<+> evaluated eagerly - should they?
colomon moritz_: yes.
pmichaud moritz_: the problem is that the first +@x exhausts the iterator, leaving nothing for @x.elems
19:52 xomas left
moritz_ pmichaud: so it should not only exhaust the iterator, but replace it by an array... or something? 19:52
colomon rakudo: sub foo(@x) { say +@x; say +@x; }; foo((1,2,3).map({$_}));
p6eval rakudo b4ccaa: OUTPUT«3␤0␤»
pmichaud well, we need some way of knowing that @x keeps its elements around.
19:52 new_order left
pmichaud I don't think we want to have some strange list of operations that cause an iterator to become an array/seq 19:53
(while others do not)
colomon pmichaud: I do agree that we're not in complete agreement on how to signal array-like vs iterator-like, yes. :)
moritz_ so... a list keeps both its items and potentially and iterator around, with an API to ask for that iterator? 19:54
moritz_ probably missed too much of the discussions from the last weeks to be of any use
pmichaud moritz_: it's basically restarted again last night
so you're not too far behind at all
I can certainly imagine something like 19:55
moritz_ that's a bit bad :(
lue and the argument is about what it should return?
pmichaud sub foo(@x) { @x.iterator.grep(/bar/) } # consumes @x as we go
versus @x.grep(/bar/) which leaves the values of @x in place
colomon It's a spin-off of masak's insane Exegesis updating notions, if you trace it back far enough. :)
moritz_ pmichaud: sounds sane-ish 19:56
jnthn I'm a lot less comfortable with that than "use $" 19:57
oh wtf
I'm a lot MORE comfortable with that than "use $"
colomon agreed.
though I'm not sure .iterator is the right magic word.
pmichaud of course, then someone becomes surprised when foo(@a) leaves @a empty
bbiab -- errand 19:58
colomon (at least, right now it is non-distructive)
ack, good point.
ruz hi 19:59
lue oi ruz!
$_ is 'it', correct? (mind you, I have never programmed anything in perl before :) ) 20:01
moritz_ lue: yes
lue rakudo: say ((1,2,3).map({$_}) 20:04
p6eval rakudo b4ccaa: OUTPUT«Confused at line 11, near "say ((1,2,"␤current instr.: 'perl6;HLL;Grammar;panic' pc 500 (ext/nqp-rx/src/stage0/HLL-s0.pir:328)␤»
lue rakudo: say ( (1,2,3).map({$_}) )
p6eval rakudo b4ccaa: OUTPUT«123␤»
lue rakudo: say ( (1,2,3).map({$_}) ).perl
p6eval rakudo b4ccaa: OUTPUT«MapIterator.new()␤»
lue rakudo: say ( (1,2,3).map({$_}).str ) 20:05
p6eval rakudo b4ccaa: OUTPUT«Method 'str' not found for invocant of class 'MapIterator'␤current instr.: '_block14' pc 29 (EVAL_1:0)␤»
lue rakudo: say str( (1,2,3).map({$_}) )
p6eval rakudo b4ccaa: OUTPUT«Could not find non-existent sub &str␤current instr.: '_block14' pc 29 (EVAL_1:0)␤»
lue (fun with experiments)
20:06 athenot left
lue rakudo: say +(1,2,3) 20:06
p6eval rakudo b4ccaa: OUTPUT«3␤»
lue rakudo: sub foo(@x) { say +@x ?? @x.elems !! 'noway'; }; foo((1,2,3).map({$_})) #ought to output 3 then, right? 20:07
p6eval rakudo b4ccaa: OUTPUT«0␤»
lue alpha: sub foo(@x) { say +@x ?? @x.elems !! 'noway'; }; foo((1,2,3).map({$_})) #ought to output 3 then, right?
p6eval alpha 30e0ed: OUTPUT«3␤»
jnthn Right, that's The Issue.
alpha had an easier time getting ti right because it didn't also do laziness. 20:08
lue I'm assuming then the hard part is fixing it, not finding what it should be fixed to :)
colomon lue: no, actually the hard part is figuring out what it should do. 20:09
lue is taking a break from P6 and learning how to model in Blender (still available here, though)
colomon because sometimes you want it to behave like alpha does, and sometimes you want it to behave like master does. 20:10
lue Oh, now your asking if it should be 3, or if that was always wrong?
too bad you can't badger the programmer in the middle of execution and ask "what do you mean?"
20:12 hercynium left
colomon lue: the issue here is basically what happens when you iterate over a large structure. 20:13
errr, not a large structure, but a logically large structure. 20:14
So, imagine iterating over all the lines in a 2gig text file, or the range 1..1000000000
lue alpha: sub foo(@x) { say +@x ?? @x.elems !! 'noway'; }; foo((1...10).map({$_})) #ought to output 3 then, right?
p6eval alpha 30e0ed: OUTPUT«10␤»
lue oh!
wait, that's alpha :D 20:15
rakudo: sub foo(@x) { say +@x ?? @x.elems !! 'noway'; }; foo((1...10).map({$_}))
p6eval rakudo b4ccaa: OUTPUT«0␤»
colomon so if you say something like (1..100000000000).grep({is-prime($_)}), you don't want it generating an Array with 100000000000 elements in it. 20:16
You want it to send each element individually down to grep, and only store the ones that are prime.
lue (suggestion #1) how's about a loop using the range as the parameters? 20:18
colomon lue: the thing is, this already *works* in Rakudo master. 20:20
(well, there is no is-prime function, but if there were, it would work the way we'd like it too.)
it works because of the iterator setup. when you do the grep, it asks the Range for an iterator, and then iterates over that. 20:22
This works really well.
But it interacts very weirdly with passing @rray arguments to functions. 20:23
pmichaud 19:46 <moritz_> which is why people write while(<FILE>) { ... } rather than for(<FILE>) { ... } 20:24
19:46 <pmichaud> yes, but we'd prefer that for lines() { ... } not do that, I suspect.
actually, it'd be "okayish" if for lines() { ... } also stored the values it read. That doesn't affect laziness at all, just memory consumption.
but yes, we would prefer for lines() { ... } to work on a 2gb file without eating up all available memory 20:25
lue would tossing the values into a temporary file of some sort be a valid action (brainstorming) 20:27
20:28 miksss joined
colomon pmichaud: I can't decide if your .iterator proposal is perfect, or if it needs an additional step which means the iterator is only consumed if the original object was itself an iterator. 20:28
20:28 miksss left
colomon errr, which is already how it works, maybe? 20:28
pmichaud colomon: I'm not entirely comfortable with .iterator
20:30 nihiliad left
pmichaud perhaps it has more to do with bound versus unbound lists 20:30
(1..10000).map(...) # unbound
my @a := 1..10000; @a.map(...) # bound 20:31
the unbound list consumes elements as it's processed, the bound list save elements as they're processed
colomon what is my @a = 1..10000; bound or unbound? 20:32
pmichaud that's an assignment, so @a ends up with a copy anyway
colomon !?
pmichaud the 1..10000 gets mostly-eager-evaluated anyway on assignment
(an optimizer might choose not to evaluate, but the spec says assignment is mostly eager) 20:33
jnthn I guess if people want to write lazy constructs spread out more nicely, that's what the pipe operators are for.
pmichaud yes, and the pipes also make a bit of a bound-versus-unbound distinction 20:34
my @a <== pipe... # lazy capture into @a
but being able to distinguish bound-versus-unbound would mean that something like for lines() { ... } can consume the iterator, while my @a := lines(); for @a { ... } wouldn't 20:35
it doesn't resolve the sub foo(@x) { @x.grep(/bar/); } issue, though. 20:36
lue .oO(the jnthn omnisub will end up being an entirely different project on its own... (more) 20:37
20:37 nihiliad joined
jnthn wonders if $x will cut it 20:37
pmichaud (i.e., this case would end up keeping all of the elements of @x around)
lue ... I think it'd even need its own team!)
pmichaud hmmm, \$x
jnthn Well, \$x means "jfbi" :-)
lue (our salute to references! ō\)
pmichaud but we still need a way to make it slurpy, I think. 20:38
lue alpha: my $x=3; my $y=\$x; $y=4; say $x;
p6eval alpha 30e0ed: OUTPUT«3␤»
jnthn Ah.
That's...trickier.
lue alpha: my $x=3; my $y=\$x; $($y)=4; say $x;
p6eval alpha 30e0ed: OUTPUT«3␤»
lue how would you do what I'm trying to do? (change $x thru reference) 20:39
jnthn my $y := $x; # binding
pmichaud alpha: my $x = 3; my $y := $x; $y = 4; say $x;
jnthn But we didn't implement it yet in master.
p6eval alpha 30e0ed: OUTPUT«4␤»
jnthn I don't think...
pmichaud no, it's not in master yet.
jnthn rakudo: my $x = 3; my $y := $x; $y = 4; say $x;
p6eval rakudo b4ccaa: OUTPUT«:= binding of variables not yet implemented␤current instr.: '&die' pc 16676 (src/builtins/Junction.pir:347)␤»
pmichaud I'm somewhat waiting for the binding of iterators/lists semantics to shake out 20:40
jnthn rakudo: my $x = 3; my ($y) := $x; $y = 4; say $x;
p6eval rakudo b4ccaa: OUTPUT«Cannot assign to readonly value␤current instr.: '&die' pc 16676 (src/builtins/Junction.pir:347)␤»
jnthn heh heh.
pmichaud hmm, that's weird.
jnthn rakudo: my $x = 3; my ($y is rw) := $x; $y = 4; say $x;
p6eval rakudo b4ccaa: OUTPUT«No applicable candidates found to dispatch to for 'trait_mod:<is>'␤current instr.: '_block14' pc 29 (EVAL_1:0)␤»
jnthn bah :-) 20:41
pmichaud I would've expected the := nyi message
lue alpha: my $x = 3; my $y := $x; $y = 4; say $x;
p6eval alpha 30e0ed: OUTPUT«4␤»
jnthn pmichaud: No, because binding against a sig on the lhs works.
lue \o/ for alpha.
pmichaud jnthn: oh, evil.
jnthn Parens => we parse a sig there => signature binding.
pmichaud goes to see "how" that works.
jnthn oh noes
lue change of topic... success. Thank you for using the 楽土 parser
jnthn pmichaud: I didn't put anything in EXPR. :-) 20:42
pmichaud okay. I don't think that := should be syntactic, though. 20:43
maybe it has to be, but STD doesn't have it that way. 20:44
jnthn Depends what you mean by :=
pmichaud infix:<:=>
jnthn It dispatches to := as a normal multi-sub
So that part isn't syntactic.
pmichaud but the "bindish_check" part is.
jnthn The syntactic decision is just that we actually want the signature, not just a list.
I did ponder writing Signature!STORE 20:45
pmichaud I still claim this is incorrect but won't push it now. I'll just reserve an "I told you so" for later :-)
jnthn :-P 20:46
pmichaud yes, Signature!STORE is more of what I have been thinking would be proper.
jnthn It's OK, I'm used to them (and used to them being completely justified). :-)
Yeah, but...I didn't like it. :-)
When .once() is implemented in PAST, I'll be happier. :-)
Tene phenny: tell masak "For a given grammatical category, a default parsing rule or set of rules is used". The spec doesn't discuss where this "default parsing rule" is defined.
phenny Tene: I'll pass that on when masak is around.
20:51 wknight8111 left
pugssvn r29887 | colomon++ | [t/spec] Bring num.t up-to-date a bit, and fudge it for Rakudo. 20:53
Tene phenny: tell masak That was the big omission, at least. Search the logs for mention of that quote to find my discussion with TimToady about it.
phenny Tene: I'll pass that on when masak is around.
lue (masak's gonna get a lot of messages...) 20:55
Tene phenny: tell masak I hear you're going to get a lot of messages. Good luck with that.
phenny Tene: I'll pass that on when masak is around.
pmichaud afk for a while 20:56
lichtkind good night 20:57
Tene lue: I looked at scrollback, and those two (three now) are the only messages queued for masak so far. What are you talking about, a lot of messages?
lichtkind good night 20:58
20:58 uniejo left
lue goodnight lichtkind o/ 20:58
Tene g'night lichtkind
lichtkind thanks 20:59
pmichaud jnthn: how about using a capture, as in sub foo(|$x) { $x.grep(/bar/) }
lue Tene: you say hi, and three messages blare out at you. It'll seem like a lot of messages at first.
Tene lue: no, that's pretty normal around here.
21:00 lejon_ joined
moritz_ at least for masak++ :-) 21:00
21:00 lejon left, lejon_ is now known as lejon
lue rakudo: say 1++ 21:00
p6eval rakudo b4ccaa: OUTPUT«Cannot assign to readonly value␤current instr.: '&die' pc 16676 (src/builtins/Junction.pir:347)␤»
lue alpha: say 1++
p6eval alpha 30e0ed: OUTPUT«Unable to set lvalue on PAST::Val node␤in Main (file <unknown>, line <unknown>)␤»
jnthn pmichaud: Well, it'll delay any contextualization I guess.
Tene phenny: tell masak Ah, nevermind, I was misinformed. Looks like it's only me in your messages so far.
phenny Tene: I'll pass that on when masak is around.
pmichaud then if the argument to foo() was already bound, it has the array semantics, if the argument to foo() was unbound, grep can throw things away as it processes them
foo(@a) # list bound, so @a remembers reified elements 21:01
lue Tene: i left a message for him! :)
pmichaud foo(1..10000) # range unbound, so iterator tosses elements as grep processes them
and if you do
sub foo(|$x) { $x.grep(/bar/) Z $x.grep(/foo/) }
you deserve whatever mayhem you get.
jnthn pmichaud: What will .grep do when called on a capture? 21:02
.list?
(first)?
pmichaud I suspect it iterates over the positionals, yes.
so yes, .list
jnthn Heh, evil :-)
It probably does the right kinda thingy.
pmichaud well, in general .grep and .map already do .list or .iterator on the invocant
jnthn *nod*
May have to teach capture about .iterator 21:03
But .list it knows well. :-) 21:04
pmichaud well, I suspect .iterator goes away in all of this
or at least becomes very uncommon
.list is the normal "give me your elements as an iterable list" in this scencario
*scenario
jnthn Yes, good point.
It feels feasible.
pmichaud so everything tends to return List instead of *Iter
jnthn I like that.
21:04 wknight8111 joined
jnthn Seeing MapIterator etc leaking out has been kinda...hmm. 21:05
pmichaud right, we all feel that's wrong
21:05 IllvilJa left, lichtkind left
pmichaud so @a.map({...}).WHAT # List 21:05
jnthn That would make me (and the test suite, I suspect) has a happy.
pmichaud me also.
jnthn What about Seqs? 21:06
pmichaud and if you invoke @a.map({...}).some_other_method the List returned from .map is unbound, and thus its return values aren't held anywhere (although @a's are held of course, because @a is bound)
jnthn guesses Seq goes away now and we're back to List and Array.
pmichaud I don't see a need for Seq in this scenario
right.
which would also make me happier. 21:07
colomon \o/
pmichaud or, Seq is a List that doesn't support shift/unshift
jnthn just realized that "What about Seqs?" said out loud at a hackathon could make our discussions seem more interesting than they really are.
pmichaud oh, I always pronounce "Seqs" like "seeks"
jnthn I hadn't been. 21:08
colomon jnthn: I'd pro... what pmichaud said.
jnthn I'll start now.
pmichaud since it's short for "sequence"
dalek kudo: 1201479 | (Solomon Foster)++ | t/spectest.data:
Turn on S02-builtin_data_types/num.t.
pmichaud although it has been fun to pronounce Seq as "non-Sequiter"
er, SeqIter
jnthn lol
pmichaud anyway, my guess is that the hierarchy might be Array ~~ List and List ~~ Seq 21:09
and Seq is something that reifies elements but has no shift/unshift
lue let's hope none of the rakudo code is PIRmanent :)
pmichaud (so it's _completely_ immutable)
List isa Seq, but also provides shift/unshift so it can act like an iterator 21:10
jnthn That could work out.
pmichaud Array isa List, but it keeps copies of element values instead of being bound directly.
pmichaud hopes that the unbound/bound distinction cuts the knots. 21:12
jnthn It feels right, and I like how captures - a mechanism that naturally delays evaluation - seems to fit naturally into this solution. 21:13
pmichaud TimToady: see above re bound/unbound lists, and let us know if you think it's a promising avenue to pursue or a likely dead end. 21:14
time for me to run some other errands to prepare for trips 21:15
bkeeler Hmm, interesting backlog today
21:15 mssm left
lue bkeeler: o/ quite. 21:15
bkeeler rakudo: say map { $_, $_ * 2 } 1..5 21:16
p6eval rakudo b4ccaa: OUTPUT«Confused at line 11, near "say map { "␤current instr.: 'perl6;HLL;Grammar;panic' pc 500 (ext/nqp-rx/src/stage0/HLL-s0.pir:328)␤»
bkeeler rakudo: say map { $_, $_ * 2 }, 1..5
p6eval rakudo b4ccaa: OUTPUT«22222␤»
bkeeler Gah, habits
Seems like getting List into the action would help that, taking advantage of the parcel flatting in List.get 21:17
pmichaud bkeeler: yes, quite.
bkeeler: it'll have to wait until we figure out exactly what Lists are, though :)
bkeeler hehe 21:18
pmichaud another possibility: Array ~~ List and List ~~ Seq
er, scratch that
lue therefore, Array ~~ Seq
pmichaud Array ~~ List and List ~~ Iterable
Iterable just returns values but forgets them
bkeeler Sounds reasonable
pmichaud List remembers the values it iterates 21:19
Array copies the values it iterates
oh, I know what I meant
then most functions return Iterable, but binding an Iterable converts it into a List
(can change the names here) 21:20
colomon wonders if he can turn 24979 passing tests into 25000+ before the hockey game is over...
lue if you can, set the hockey game to be play and .25x speed :) then you'll have enough time... 21:21
pmichaud the idea being that one type is for "unbound iterator" and a derived type is for "bound iterator", and Array is further derived from the last one
lue s/play and/played at/
21:21 IllvilJa joined
bkeeler Plus you might actually stand a chance of seeing the puck 21:21
lue nah, you'd need .125x speed :) 21:22
bkeeler pmichaud: It makes sense to me
21:22 TiMBuS left, parrot joined
colomon it's not that hard to see... though I admit I really liked it when they did that experiment with computer enhancing the puck a decade or so ago. :) 21:22
bkeeler I was trying to making sense of Seq Array & List, and wasn't having much luck until this discussion
lue I think the main goal of this discussion is to make it last days :) 21:23
pmichaud definitely not. 21:25
colomon jnthn: is ~(%($pair)), "when\tnow\n", 'hash stringification'; # Method 'hash' not found for invocant of class 'Pair'
pmichaud I'd like it to be done :-) 21:26
jnthn colomon: Just needs Pair.hash writing.
colomon should it be Pair.hash or Pair.Hash?
jnthn Bothish.
erm
:-)
Oh 21:27
Actually
moritz_ rakudo: {a => 1}.isa(Hash)
jnthn I wonder if you can get away with returning self in .hash
p6eval rakudo b4ccaa: ( no output )
moritz_ rakudo: say {a => 1}.isa(Hash)
p6eval rakudo b4ccaa: OUTPUT«0␤»
moritz_ rakudo: say {a => 1}.WHAT
p6eval rakudo b4ccaa: OUTPUT«Hash()␤»
jnthn It may be hashish enough :-)
moritz_ rakudo: say Hash.isa(Hash)
jnthn But anyway, we probably need .hash and .Hash
p6eval rakudo b4ccaa: OUTPUT«Method 'isa' not found for invocant of class 'RoleHOW'␤current instr.: 'perl6;Any;isa' pc 9675 (src/gen/RoleToClassApplier.pir:540)␤»
moritz_ jnthn: I think it's because Hash is a role, not a class...
colomon jnthn: both of which return self? 21:28
jnthn No
colomon that's the kind of complicated Rakudo hacking I can handle. :)
jnthn colomon: Make a hash.
my %h = self; # may work ;-)
moritz_: That last issue is, yes. 21:29
colomon wait, if %(Pair) doesn't work, why should %h = self work?
jnthn They're doing different things.
%(Pair) calls Pair.hash
my %h = self does something like 21:30
%h := Hash.new
%h!STORE(self)
Or similar.
colomon k
trying now.
21:30 pmurias joined
colomon jnthn: maximum recursion depth exceeded 21:33
IllvilJa US vs Canada in male Hockey in Vancouver. Better not watch it to preserve SOME faith in mankind... ;-)
jnthn FAIL.
moritz_ Unable to coerce value for '$str' from Str to EMPTY; no coercion method defined 21:34
current instr.: 'sprintf' pc 252305 (src/gen/core.pir:12088)
that's from S02-literals/listquote-whitespace.t
IllvilJa (According to my son, some US player almost managed to 'throw' a Canadian guy into the lap of the US players who are sitting waiting 'on reserve'... intresting game... Don't worry, no more spoilers for those who want to watch)
jnthn Ugh.
21:35 mberends left
colomon trying {self} now. 21:35
moritz_ rakudo: say <abc\de>.perl
p6eval rakudo b4ccaa: OUTPUT«"abc\\de"␤» 21:36
moritz_ rakudo: printf "%02x", ord "\\";
p6eval rakudo b4ccaa: OUTPUT«Could not find non-existent sub &printf␤current instr.: '_block14' pc 29 (EVAL_1:0)␤»
moritz_ rakudo: say sprintf "%02x", ord "\\";
p6eval rakudo b4ccaa: OUTPUT«5c␤»
moritz_ rakudo: printf "%02x", ord "/"; 21:37
p6eval rakudo b4ccaa: OUTPUT«Could not find non-existent sub &printf␤current instr.: '_block14' pc 29 (EVAL_1:0)␤» 21:38
moritz_ rakudo: my $vis = sprintf "%02x", ord '/' 21:39
p6eval rakudo b4ccaa: ( no output )
moritz_ that's the line that dies in listquote-whitespace.t
... sometimes 21:40
and sometimes it lives
jnthn moritz_: I think it's a random fail.
moritz_ weird
jnthn yeah
colomon jnthn: should the stringification of a hash really end with a newline?
jnthn colomon: I think so
moritz_ sometimes it can't coerce to Perl6Scalar, sometimes to ObjectRef
colomon We're getting that wrong, then.
jnthn is it not like key\tvalue\nkey\tvalue\n 21:41
colomon not ok 34 - hash stringification
# got: "when\tnow"
# expected: "when\tnow\n"
jnthn moritz_: Yes, that's what makes me think something may be Very Very Wrong.
moritz_: sprintf.rakudo does similar things to me.
oh 21:42
hmm
moritz_: I think I see what's wrong. 21:43
Trying to fix. 21:44
pugssvn r29888 | moritz++ | fudge defined.t for rakudo 21:45
r29889 | moritz++ | [t/spec] correct catch_type_cast_mismatch.t and improve fudging for rakudo 21:46
moritz_ oops, that commit to defined.t was probably out of date 21:47
pugssvn r29890 | moritz++ | test for RT #72872, Mu eqv Mu
21:51 lejon left
pugssvn r29891 | moritz++ | [t/spec] test for RT #72790: $obj.?nonexistent() should return Nil, not some scalar, undefined value 21:52
jnthn moritz_: Think sprintf patch has worked :-) 21:53
colomon isn't going to spectest until jnthn has his patch in... 21:55
lue rakudo: my $s=1; say $s++ 21:56
p6eval rakudo 120147: OUTPUT«1␤»
lue rakudo: my $s=1; say ($s++)
p6eval rakudo 120147: OUTPUT«1␤»
pugssvn r29892 | moritz++ | [t/spec] test for RT #72286: self should not be writeable
colomon rakudo: my %a = { a => 5, b => 72 }; say ~%a 21:59
p6eval rakudo 120147: OUTPUT«maximum recursion depth exceeded␤current instr.: 'parrot;P6protoobject;VTABLE_name' pc 1296 (runtime/parrot/library/P6object.pir:764)␤»
colomon oh good, that's not my fault.
lue rakudo: sub hi($a) { say $a; say $a.WHAT; }; hi(3); hi((3,4,5));
p6eval rakudo 120147: OUTPUT«3␤Int()␤3␤Parcel()␤»
lue rakudo: sub hi($a) { say $a; say $a.WHAT; }; hi((3,4,5)); 22:00
p6eval rakudo 120147: OUTPUT«3␤Parcel()␤»
lue rakudo: sub hi(@a) { say @a; say @a.WHAT; }; hi(3); hi((3,4,5));
p6eval rakudo 120147: OUTPUT«Nominal type check failed for parameter '@a'; expected Positional but got Int instead␤current instr.: 'hi' pc 203 (EVAL_1:79)␤»
lue roar.
rakudo: sub hi($a) { say $a[2]; say $a.WHAT; }; hi((3,4,5)); 22:01
p6eval rakudo 120147: OUTPUT«5␤Parcel()␤»
lue rakudo: multi sub prefix:<jnthn>($a){say $a;}; multi sub infix:<jnthn>($a, $b){ say $a, "+", $b;}; jnthn3; 3jnthn4; 22:03
p6eval rakudo 120147: OUTPUT«Confused at line 11, near "3jnthn4;"␤current instr.: 'perl6;HLL;Grammar;panic' pc 500 (ext/nqp-rx/src/stage0/HLL-s0.pir:328)␤»
jnthn colomon: pushed
colomon jnthn: danke.
lue rakudo: multi sub prefix:<jnthn>($a){say $a;}; multi sub infix:<jnthn>($a, $b){ say $a, "+", $b;}; jnthn3; 3 jnthn 4;
p6eval rakudo 120147: OUTPUT«Confused at line 11, near "3 jnthn 4;"␤current instr.: 'perl6;HLL;Grammar;panic' pc 500 (ext/nqp-rx/src/stage0/HLL-s0.pir:328)␤»
jnthn
.oO( what on earth is lue doing with my name )
colomon unfortunately, I just realized my Pair.hash function was borked.
rakudo: my %a = { a => 5, b => 72 }; say ~%a 22:04
lue roar. you'd think there'd be some sort of way to distinguish between infix, prefix, and postfix within rakudo when using the same name multiple times...
p6eval rakudo 120147: OUTPUT«maximum recursion depth exceeded␤current instr.: 'parrot;P6protoobject;VTABLE_name' pc 1296 (runtime/parrot/library/P6object.pir:764)␤»
jnthn rakudo: my %a = { a => 5, b => 72 }; say "alive"
p6eval rakudo 120147: OUTPUT«alive␤»
jnthn rakudo: my %a = { a => 5, b => 72 }; say %h.perl
p6eval rakudo 120147: OUTPUT«Symbol '%h' not predeclared in <anonymous>␤current instr.: 'perl6;PCT;HLLCompiler;panic' pc 137 (compilers/pct/src/PCT/HLLCompiler.pir:101)␤»
jnthn rakudo: my %a = { a => 5, b => 72 }; say %a.perl
p6eval rakudo 120147: OUTPUT«{"a" => 5, "b" => 72}␤»
jnthn rakudo: my %a = { a => 5, b => 72 }; say %a.^methods(:local)
p6eval rakudo 120147: OUTPUT«pushdeletepostcircumfix:<{ }>␤»
lue jnthn: just trying out things, and your name was used mainly because that's what the testing is for (the omnisub) :D 22:05
jnthn rakudo: say EnumMap.^methods(:local)
p6eval rakudo 120147: OUTPUT«ACCEPTSfmtiteratornewIntvaluesNumperlCaptureofinvertkeyspostcircumfix:<{ }>reversecontainspairsexistskv␤»
jnthn colomon: oh, oddness
22:05 parrot left
jnthn colomon: But looks like EnumMap.Str is NYI 22:05
dalek kudo: 4d8935e | jonathan++ | src/pmc/p6lowlevelsig.pmc:
Add missing mark.
lue rakudo: say +3; say 3+4; say 4+
p6eval rakudo 120147: OUTPUT«Confused at line 11, near "say 4+"␤current instr.: 'perl6;HLL;Grammar;panic' pc 500 (ext/nqp-rx/src/stage0/HLL-s0.pir:328)␤»
lue rakudo: say +3; say 3+4;
p6eval rakudo 120147: OUTPUT«3␤7␤»
jnthn colomon: Granted it's a bad way to fail though. 22:06
colomon jnthn: the reason I wasn't getting a newline for ~Hash was because I was actually getting ~Pair.
jnthn Ah.
lue it works when I use +, but custom operators whine about that kind of stuff.
jnthn colomon: I don't think Pair needs the newline.
lue (+3 and 3+4, but not jnthn3 and 3jnthn4)
colomon jnthn: that's what I figured.
jnthn lue: It's because + is not alphanumeirc.
lue that.... shouldn't matter 22:07
jnthn It does.
:-)
lue: consider $a eq $b vs $aeq$b :-)
colomon jnthn: also, here's another one...
rakudo: my %a = { a => 5, b => 72 }; say %a.Sgr
p6eval rakudo 120147: OUTPUT«Method 'Sgr' not found for invocant of class ''␤current instr.: '_block14' pc 29 (EVAL_1:0)␤»
colomon rakudo: my %a = { a => 5, b => 72 }; say %a.Str
p6eval rakudo 120147: ( no output )
colomon la la la la la 22:08
lue I can define prefix:<@> and infix:<@> but not prefix:<xyzzy> and infix:<xyzzy> (THAT doesn't make sense)
jnthn lue: You *can* define them
You just need spaces. :-)
lue looky here: (more)
rakudo: multi sub prefix:<jnthn>($a){say $a;}; multi sub infix:<jnthn>($a, $b){ say $a, "+", $b;}; jnthn 3; 3 jnthn 4;
p6eval rakudo 120147: OUTPUT«Confused at line 11, near "3 jnthn 4;"␤current instr.: 'perl6;HLL;Grammar;panic' pc 500 (ext/nqp-rx/src/stage0/HLL-s0.pir:328)␤»
lue alpha: multi sub prefix:<jnthn>($a){say $a;}; multi sub infix:<jnthn>($a, $b){ say $a, "+", $b;}; jnthn 3; 3 jnthn 4;
jnthn alpha: multi infix:<lue>($a, $b) { say "omg" }; 3 lue 4
p6eval alpha 30e0ed: OUTPUT«3␤3+4␤» 22:09
alpha 30e0ed: OUTPUT«omg␤»
lue that didn't work yesterday!
jnthn lue: Note works in alpha, but not yet master.
colomon: eww
lue alpha: multi sub prefix:<jnthn>($a){say $a;}; multi sub infix:<jnthn>($a, $b){ say $a, "+", $b;}; multi sub postfix:<jnthn>($a){say "+",$a;}; jnthn 3; 3 jnthn 4; 4 jnthn; 22:10
p6eval alpha 30e0ed: OUTPUT«Confused at line 10, near "jnthn;"␤in Main (file <unknown>, line <unknown>)␤»
lue I can't define an infix & postfix with the same name, that's the real problem.
jnthn lue: Try with alpha.
lue look up. I did :)
jnthn lue: oh, wait
Yeah 22:11
No, you can't do that.
That's just a language rule though.
(Perl 6 does one-pass parsing.)
lue and I can't use a tricky workaround in infix to fake a postfix either :(
moritz_ if you could, the parser wouldn't know if it exepcts an operator or a term after that postfix-or-infix thing
jnthn When the parser doesn't know those things, it gets upset and goes and cries in the corner. 22:12
lue STOP CRYING then
jnthn Even when it finishes, it doesn't know how to parse it still. :-)
lue at least let me see if rhs = nothing, then I can fake a postfix :)
(check backlogs -- I tried already) 22:13
arlinius isn't the one-pass parse rule broken other place(s) anyway though (at least in spec, if not current implementation)? 22:14
22:14 meppl left
lue alpha: multi sub infix:<xyzzy>($a, $b) {$b~~undef ?? say "postfix" !! say "infix";}; 3 xyzzy 4 22:16
p6eval alpha 30e0ed: OUTPUT«infix␤»
lue alpha: multi sub infix:<xyzzy>($a, $b) {$b~~undef ?? say "postfix" !! say "infix";}; 3 xyzzy
p6eval alpha 30e0ed: OUTPUT«Confused at line 10, near "xyzzy"␤in Main (file <unknown>, line <unknown>)␤»
arlinius alpha: multi sub infix:<xyzzy>($a, $b) {$b~~undef ?? say "postfix" !! say "infix";}; 3 xyzzy Nil
p6eval alpha 30e0ed: OUTPUT«postfix␤»
colomon has now paused the hockey game....
arlinius :P
lue it'd be nice to not force the user to type Nil for my workaround... WAIT!
alpha: multi sub infix:<xyzzy>($a, $b=Nil) {$b~~undef ?? say "postfix" !! say "infix";}; 3 xyzzy
p6eval alpha 30e0ed: OUTPUT«Confused at line 10, near "xyzzy"␤in Main (file <unknown>, line <unknown>)␤»
lue darnit 22:17
jnthn Nice try. :-P
arlinius alpha: multi sub infix:<xyzzy>($a, $b=Nil) {$b~~undef ?? say "postfix" !! say "infix";}; infix:<xyzzy>(3)
p6eval alpha 30e0ed: OUTPUT«Confused at line 10, near ":<xyzzy>(3"␤in Main (file <unknown>, line <unknown>)␤»
jnthn oh colomon... :-)
> my %h = a => 1, b => 2; say %h.Str
"b" => 2
"a" => 1
I has patch.
:-)
colomon \o/
jnthn colomon: Want me to spectest it and push it?
colomon: Or want me to paste it and you can pop it in with what you're up to? 22:18
colomon please?
jnthn ...was that to spectest and push? :-)
jnthn spectests
IllvilJa Folks, I'm messing around with Catalyst (which implies messing around with Moose and friends). Installing the Catalyst framework in a Perl 5 'fresh' environment require (IMHO) insane amounts of CPAN modules to be installed (269 modules on one of my gentoo boxes for instance...). Anyone who dares to speculate how much of that goes away once Catalyst is ported to Perl 6? 22:19
jnthn Well, much of Moose is kinda built-in. :-) 22:20
22:20 iblechbot left
IllvilJa Another way to put the question, how 'much' of Catalyst's 269 module dependencies are there only to 'turn perl 5 into perl6' ;-)? 22:20
jnthn has no idea :-)
269?!
lue alpha: multi sub infix:<xyzzy>($a, $b=Inf) {$b~~Inf ?? say "\o/" !! say "/o\";}; 3 xyzzy
p6eval alpha 30e0ed: OUTPUT«say requires an argument at line 10, near " \"/o\\\";}; "␤in Main (file src/gen_setting.pm, line 2593)␤»
moritz_ IllvilJa: aptitude install libcatalyst-perl # no CPAN fiddeling required :-) 22:21
jnthn was expecting 100 or so. :-)
lue alpha: multi sub infix:<xyzzy>($a, $b=Inf) {$b~~Inf ?? say "\\o/" !! say "/o\\";}; 3 xyzzy
p6eval alpha 30e0ed: OUTPUT«Confused at line 10, near "xyzzy"␤in Main (file <unknown>, line <unknown>)␤»
lue sobs
bkeeler rakudo: multi xyzzy($loc) { say "Nothing Happens." }; multi xyzzy($loc where { $loc ~~ "inside building"|"debris room" }) { say "Poof!" }
IllvilJa Yes. Well, it is a so called 'e-build' in gentoo, which pulls in 268 other e-builds as dependencies (every CPAN-module get's it's own e-build).
p6eval rakudo 120147: ( no output )
IllvilJa I suspect that the gentoo folks 'by default' pulls in a lot of stuff considered useful to the 'causal Catalyst developer'. 22:22
pugssvn r29893 | colomon++ | [t/spec] Refudge for Rakudo.
22:22 snarkyboojum left
IllvilJa So the most used plugins get installed at the same time (authorization, authentication etc). 22:22
jnthn bkeeler: You maybe get away with multi xyzzy($loc where "inside building"|"debris room") { ... }
bkeeler Ah yes, thanks 22:23
jnthn Whatever is RHS of where in a signature is just smart-matched against.
IllvilJa But yes, Catalyst is fun and cool, but a lot of the simplicity it gives to you is due to a quite complex install. With some luck, the installation complexity is automated (as in the genoo/e-build case, or when using the 'cpan' module on a more 'normal' linux hos).
22:23 xabbu42 joined
pugssvn r29894 | moritz++ | [t/spec] some rakudo unfudges 22:24
IllvilJa But I'm looking forward to use Catalyst on Perl6. Hey, cannot that be used as a metric for when Perl6 is 'ready'? That Catalyst runs on it?
On production boxes?
lue
.oO(Is there any time ~~ is not better than == ?)
arlinius lue: yes, when you want == :P
jnthn When you mean ==
lue: When you know you want a numerical comparrision. 22:25
lue rakudo: say 3 ~~ 3;
p6eval rakudo 120147: OUTPUT«1␤»
bkeeler Coolness, got signatures working in my grammar partch. rule foo($a) { 'foo' { say "A is $a" } 'bar' } etc etc
colomon bkeeler: \o/
jnthn \o/ 22:26
bkeeler++
At some point, we should pipe it through pmichaud --code-review --apply-if-ok :-)
bkeeler Yep. I made some changes after the first review, but I'm about ready for a second 22:27
jnthn Cool
bkeeler Should write a few tests first though
jnthn tests are good
lue pmichaud --code-review --ok="apply" --not-ok="ask" -Ofun
jnthn \o/ 22:28
colomon BTW, I'm pretty sure I've got 25,000+ tests passing now. 22:30
jnthn \o/
bkeeler \o/ colomon++
jnthn colomon++
colomon there were a lot of tests in pair.t.
jnthn gah, commit rejected! 22:31
lue ō\ we salute you, colomon
colomon jnthn: sorry about that.
IllvilJa find $RAKUDO_SOURCE_HOME -name=\* --exec pmichaud --code-review --ok="apply" --not-ok="ask" -Ofun --coffe-supply=/dev/espresso-maker
If necessary to trick poor michaud into reviewing the entire source... 22:32
lue error: unknown paramter: coffe-supply (did you mean coffee-supply) :)
jnthn colomon: 'tis OK :-)
pmichaud
.oO(I have it on good knowledge that pmichaud doesn't drink much coffee :)
IllvilJa Ah... s/coffe/coffee/g. Hm, looks awfully perl5-ish... how do you express that in Perl 6 BTW? 22:33
pmichaud I think the last time I drank coffee was 2002.
lue pmichaud --send-complaints-to=/dev/null
pmichaud maybe even 2001.
jnthn pmichaud: wow!
IllvilJa Yes, /dev/null is underrated, useful for tons of things.
jnthn pmichaud: Tea? 22:34
dalek kudo: 1667377 | (Solomon Foster)++ | src/core/Enum.pm:
Last version of Pair.hash was completely broken; this one is uglier but seems to work better.
kudo: fca8574 | (Solomon Foster)++ | t/spectest.data:
Turn on S02-builtin_data_types/pair.t.
kudo: f4fdba4 | (Solomon Foster)++ | src/core/Enum.pm:
Add Enum.hash.
pmichaud Tea, yes. Mostly Dr Pepper for caffeine
IllvilJa pmichaud: so which year will you have the cup of coffe for THIS decade? One cup a decade seem to be a healthy way to go :-D.
IllvilJa considering go make another pot of addictive, full caffeine grade, coffee 22:35
colomon I don't think I've ever had a full cup of coffee....
lue pmichaud --code-review --ok="apply" --not-ok="ask" --send-complaints-to=/dev/null --caffeine-source="/dev/autocaffiene" -Ofun
colomon Hockey is going to overtime! SWEEEET!
lue yes, ain't it amazing? 22:36
bkeeler has a plumbed in espresso machine in his kitchen
jnthn :-O
That sounds almost as good as a plumbed in beer pump.
arlinius bkeeler: you like liquid ash-tray?
bkeeler Err no thanks
But I love a good espresso 22:37
arlinius oh, I thought you said you had an espresso machine :P
lue > jnthn --fix-code="rakudo/master" --when="now" --quality="A+"
Completed in .4 seconds
22:37 mssm joined
jnthn lue: Yeah, I do that all the time, it's just the spectest runs that slow me down. :-P 22:37
bkeeler And yes, I also have a "kegerator" as they're called in the states 22:38
colomon ....which is why we need to have another round of optimization sometime soon. :)
arlinius so make rakudo faster? :P
lue tardis --debug-file="jnthn.p6" --time-travel="enable" --ttopt="realtime"
colomon would really go for a kegerator full of Magners 22:39
lue fixed 63 errors. Will run faster in future :)
jnthn colomon: If I shave that many seconds of the spectest run again, it'll run in negative time. :-)
Then I know my patch is FAIL before I've even finished writing it. 22:40
bkeeler Mine is full of New Belgium Trippel
jnthn
.oO( sometimes I already know that anyway... )
lue I really could use masak here. the jnthn omnisub would need a dang good parser builtin...
masakbot --awaken --logon 22:41
jnthn Yeah, well, I filled mine with borovička.
colomon: Does Hash.Str working fix any tests?
colomon One, at least, but I've got to think there must be more out there... 22:42
jnthn :-)
colomon probably indicates another test file we should be turning on somewhere....
jnthn Almost finished testing.
hash.t and hash-ret.t would be great to get.
colomon yay!
jnthn But I need to not fail at implementing hash slices first.
...or get beaten to implementing them... 22:43
lue jnthn --implement="hash slices" --summon-ally="David Tennant" 22:44
oh wait, sorry 22:45
dalek kudo: 1f2bd09 | jonathan++ | src/core/EnumMap.pm:
Get EnumMap.Str (and thus Hash.Str) working again.
lue jnthn --cancel ; jnthn --implement="hash slices" --summon-ally="TimToady"
jnthn EINSUFFICIENTBEER 22:46
22:46 astrojp joined
lue jnthn --include="/dev/beer.h" 22:46
bkeeler You keep your C headers in /dev? 22:47
arlinius yeah it leaves more room for device files in /usr/include 22:48
lue I thought dev was for tools a DEVeloper needed :)
arlinius lue &> /usr/include/null
bkeeler hehe
lue aaaaaaaaaaaaaaaaaaaaaaaaaaa
22:48 lue left
arlinius ! 22:49
22:49 lue joined
lue error: lue not found. Recreating... 22:49
...done. Owner is lue. Group is lue. chmod rwxrwxr-x complete. 22:51
where is everyone? this place was hopping a few seconds ago... 22:52
diakopter . 22:56
IllvilJa Well, the finale in Hockey in vancouver with Canada vs US were just finished and the winner is.... <to be filled in by the aid of lazy evaluation when you check out the game yourself>
lue ah, the hockey game...
IllvilJa So a lot of ppl were busy either looking up the facts, or checking their options for viewing the game WITHOUT having the result spoiled in advance :-). 22:57
22:57 Su-Shee left
IllvilJa I happened to shout out the fact that Sweden ladies won over Canada in the curling finale in this channel, without thinking about those who wanted to watch it afterwards... with the thrill of the event intact. 22:58
lue rakudo: sub winner($a){$a=3 ?? say "Canada" !! say "US";}; $b=1; $b++; winner($b+1)
p6eval rakudo 4d8935: OUTPUT«Symbol '$b' not predeclared in <anonymous>␤current instr.: 'perl6;PCT;HLLCompiler;panic' pc 137 (compilers/pct/src/PCT/HLLCompiler.pir:101)␤»
lue rakudo: sub winner($a){$a=3 ?? say "Canada" !! say "US";}; my $b=1; $b++; winner($b+1)
p6eval rakudo 4d8935: OUTPUT«Canada␤Cannot assign to readonly value␤current instr.: '&die' pc 16676 (src/builtins/Junction.pir:347)␤»
IllvilJa Wonderful summary of the game ;-).
jnthn rakudo: say "The winner is {('USA', 'Canada').pick}!" 22:59
p6eval rakudo 4d8935: OUTPUT«The winner is USA!␤»
jnthn Rakudo knows.
lue Can Any North American Combat All ?
Can Any North American Defeat All ?
arlinius canaca
IllvilJa rakudo: say "The winner is {('USA', 'Canada').pick}!"
diakopter pugs: say "The winner is {('USA', 'Canada').pick}!"
p6eval rakudo 4d8935: OUTPUT«The winner is USA!␤»
pugs: OUTPUT«The winner is Canada!␤»
lue kicks the dogs 23:00
arlinius std: say "The winner is {('USA', 'Canada').pick}!"
p6eval std 29894: OUTPUT«ok 00:01 109m␤»
arlinius :)
IllvilJa Hm... we have a candidate for a spectest coming up!
lue alpha: say "The winner is {('USA', 'Canada').pick}!"
p6eval alpha 30e0ed: OUTPUT«The winner is USA!␤»
jnthn Rakudo seems pretty damm sure. :-) 23:01
Clearly Pugs hasn't caught up with the latest spec changes here.
:-)
diakopter pugs: say "The winner is {('USA', 'Canada').pick}!"
p6eval pugs: OUTPUT«The winner is USA!␤»
diakopter pugs: say "The winner is {('USA', 'Canada').pick}!"
p6eval pugs: OUTPUT«The winner is Canada!␤»
diakopter pugs: say "The winner is {('USA', 'Canada').pick}!"
p6eval pugs: OUTPUT«The winner is Canada!␤»
diakopter pugs: say "The winner is {('USA', 'Canada').pick}!"
p6eval pugs: OUTPUT«The winner is USA!␤»
IllvilJa My confidence in pugs got even better :-D. 23:02
arlinius pugs seems to be just choosing randomly with no knowledge of the game
diakopter rakudo: say "The winner is {('USA', 'Canada').pick}!"
p6eval rakudo 4d8935: OUTPUT«The winner is USA!␤»
lue alpha: say "The winner is {my $a=('USA', 'Canada').pick}; ('USA', 'Canada').pick;}!" if $a~~"Canada" { die('liar!') }
p6eval alpha 30e0ed: OUTPUT«Confused at line 10, near "{ die('lia"␤in Main (file <unknown>, line <unknown>)␤»
IllvilJa Well, given that we talk about hockey here, that's good enough for me.
lue alpha: say "The winner is {my $a=('USA', 'Canada').pick}; ('USA', 'Canada').pick;}!"; if $a~~"Canada" { die('liar!') }
p6eval alpha 30e0ed: OUTPUT«Symbol '$a' not predeclared in <anonymous> (/tmp/Zis7x7bMqH:10)␤in Main (file <unknown>, line <unknown>)␤»
diakopter heh
arlinius diakopter: maybe jnthn really *did* hardcode that one
diakopter pugs: my$a;say "The winner is {$a=('USA', 'Canada').pick;}!"; if $a~~"Canada" { die('liar!') } 23:04
p6eval pugs: OUTPUT«The winner is Canada!␤*** liar!␤ at /tmp/ltbAVHyg9D line 1, column 75-88␤»
diakopter pugs: my$a;say "The winner is {$a=('USA', 'Canada').pick;}!"; if $a~~"Canada" { die('liar!') }
p6eval pugs: OUTPUT«The winner is USA!␤»
diakopter hm
pmurias lue: the problem here is that there is a new lexical block in "{...}"
s/block/scope/
IllvilJa Well, maybe junctions would come to the rescue here. Until you have watched the game, it consists of a superposition of the probability functions of both US as well as Canada being victorious. 23:05
lue alpha: say "The winner is {our $a=('USA', 'Canada').pick}; ('USA', 'Canada').pick;}!"; if $a~~"Canada" { die('liar!') }
p6eval alpha 30e0ed: OUTPUT«Symbol '$a' not predeclared in <anonymous> (/tmp/X4Q4Ef3miP:10)␤in Main (file <unknown>, line <unknown>)␤»
IllvilJa We can mess this up really badly if we get more coffe...
IllvilJa realizes that he got a steaming cup just in front of him! Beware, #perl6!
pmurias alpha: say "The winner is {our $a=('USA', 'Canada').pick}; ('USA', 'Canada').pick;}!"; our $a;if $a~~"Canada" { die('liar!') }
p6eval alpha 30e0ed: OUTPUT«The winner is Canada; ('USA', 'Canada').pick;}!␤liar!␤in Main (file /tmp/E4gHXlRTgE, line 10)␤»
arlinius rakudo: my $winner = "USA"|"Canada"; say $winner eq "USA";
p6eval rakudo 4d8935: OUTPUT«any(1, 0)␤»
lue alpha: my $a = "Canada"&"USA"; say $winner eq "USA"; 23:06
p6eval alpha 30e0ed: OUTPUT«Symbol '$winner' not predeclared in <anonymous> (/tmp/snMQJn1brc:10)␤in Main (file <unknown>, line <unknown>)␤»
lue alpha: my $a = "Canada"&"USA"; say $a eq "USA";
p6eval alpha 30e0ed: OUTPUT«all(Bool::False, Bool::True)␤»
lue will use Explosion Principle. Wait one moment 23:07
IllvilJa You probably knew this, but at one point in the tutorial for Catalyst, the perl 5 module 'Perl6::Junctions' is used which is sort of cool.
arlinius rakudo: my $winner = "USA"|"Canada"; say ?($winner eq "USA");
p6eval rakudo 4d8935: OUTPUT«1␤»
23:07 pmurias left
IllvilJa (Which makes me even more impatient on getting Catalyst dragged up onto the perl6 steed...) 23:07
lue alpha: my $a=True; my $b=!True; my $c=(True and !True); my $canada=($a or True); say $canada 23:08
p6eval alpha 30e0ed: OUTPUT«1␤»
lue alpha: my $a=True; my $b=!True; my $c=($a and $b); my $canada=($a or True); say $canada
p6eval alpha 30e0ed: OUTPUT«1␤»
lue no, it's supposed to come out false! 23:09
.oO(explosion principle would be a good programming task)
23:10
23:12 nihiliad left
colomon jnthn: EnumMap.Str still broken, but I'll have it working properly in a minute. 23:13
Though what should it return if it is empty? 23:14
23:15 nihiliad joined
colomon alpha: my %h; say %h.Str; 23:16
p6eval alpha 30e0ed: OUTPUT«␤»
lue --form-of="windmill guy"
23:16 lue is now known as Guru-Guru
jnthn colomon: Nothing I guess. 23:16
colomon alpha: my %h = { a=>5 }; say %h.Str
jnthn rakudo: my %h; say %h.Str 23:17
p6eval alpha 30e0ed: ( no output )
rakudo 1f2bd0: OUTPUT«␤»
colomon huh, that's weird.
alpha: my %h = { a=>5 }; say %h.perl 23:19
p6eval alpha 30e0ed: ( no output )
colomon Am I doing something wrong there?
jnthn huh 23:20
No, that looks wrong.
alphabug?
:-/
rakudo: my %h = { a=>5 }; say %h.perl
p6eval rakudo 1f2bd0: OUTPUT«{"a" => 5}␤»
jnthn rakudo: my %h = { a=>5 }; say %h.Str
p6eval rakudo 1f2bd0: OUTPUT«"a" => 5␤»
colomon I've got it figured out how to make it work properly in master. 23:21
self.pairs.map({ .Str ~ "\n" }).join();
jnthn oh huh, I wrote .perl 23:23
duh!
Guru-Guru --reset
23:23 Guru-Guru is now known as lue
colomon jnthn: no worries. :) 23:24
spectesting the patch now, I don't imagine it will fail. 23:25
lue karma --target="colomon" --cause="fail on $_" 23:26
arlinius is this what you were looking for last night lue? perlcabal.org/syn/S02.html#Grammati...Categories 23:27
lue that seems to be it! \o/ (but firefox froze :( ) 23:29
arlinius firefox tends to do freeze on those pages :\
(and in general) 23:30
colomon I've found OS X Chrome works a lot better on those pages.
bkeeler They have large parts of the test suite embedded in hidden frames, take a while for firefox to render 23:31
lue just the percabal pages. Lot worse when I had firebug :)
bkeeler It's slowish on my nice Mac Pro
arlinius I get javascript errors with firefox (the continue/stop script) dialog)
23:32 snarkyboojum joined
lue me too. They ought to use CSS style:hidden and all that. 23:32
instead of frames
pugssvn r29895 | colomon++ | [t/spec] Unfudge now working test. 23:33
bkeeler They probably do, I was using the term frame a bit loosely
I haven't actually looked to see how they do it, mind you
arlinius they look like iframes 23:34
lue the hell... nobody uses those anymore! they're going to be deprecated.
arlinius <iframe id="simple_134" style="display:none;" width="100%"></iframe>
23:34 hejki joined
lue use a <div>! it's better. 23:35
arlinius div with scrolling?
lue very possible.
masakbot --awaken 23:36
dalek kudo: 588a345 | (Solomon Foster)++ | src/core/EnumMap.pm:
Switch EnumMap.Str to use .Str ~ "\n" in its map.
23:38
23:38 nihiliad left
bkeeler That's not how you wake the masakbot 23:38
lue I wonder how you define a ternary operator (?? !! conditional shortcut)
bkeeler: then how? 23:39
bkeeler You have to write your request on a piece of lutefisk and put it in his mouth
lue has the sudden urge to write a #perl6 interactive fiction ... 23:40
bkeeler It is dark. You are likely to be eaten by a Lue 23:41
pmichaud
.oO(Anything with "Perl 6" in it must be fictional.)
lue > examine car 23:42
it is the ApocolypseMobile!
> drive car 23:43
you need the Synopsis warpdrive to drive the ApocolypseMobile
bkeeler hacking rakudo is like figuring out how to get the babelfish in that silly game 23:45
lue what, in the H2G2 text game? It's not that hard (when you know)
bkeeler Of course it's not hard when you know how
It's when you don't know how that it's hard
jnthn ...knowing how is a requirement? 23:46
:-)
23:46 lue is now known as P6_IFgame
jnthn bkeeler: You find your way around after a while. :-) 23:46
P6_IFgame It is dark. You are likely to be eaten by a lue.
pmichaud You are lost in a maze of twisty ParrotMagicCorridors (PMCs), all different. 23:47
P6_IFgame pmichaud: invalid command.
pmichaud P6_IFgame: plugh
P6_IFgame pmichaud: nothing interesting happens.
23:48 xabbu42 left
P6_IFgame the lue is getting closer. 23:49
you hear several lues getting closer.
***You have died*** 23:50
23:50 P6_IFgame is now known as lue
lue yummy. :) 23:50
23:52 nihiliad joined
jnthn -> rest 23:57
lue good rest, jnthn
jnthn o/