»ö« | 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 wolfe.freenode.net on 30 October 2009.
00:02 meppl left
ash_ jnthn in S02-builtin_data_types/anon_block.t line #76 and line #80, are those two tests actually different? just curious 00:06
{$foo = "blah"}; vs {$foo2 = "blah"}; shouldn't the first one be a bare block without a semi-colon?
or maybe the second, well 1 of them 00:07
00:07 pmurias left 00:08 lumi left, lumi joined 00:09 ash_ left 00:10 colomon left, colomon joined 00:16 teneighty joined 00:19 mikehh left 00:20 mikehh joined 00:31 am0c joined 00:34 drbean joined 00:35 mikehh left, Trey left, Trey joined 00:37 stepnem left 00:43 mikehh joined 00:46 stepnem joined 00:47 smash_ left 00:48 justatheory left 00:49 cognominal left, mikehh left, mikehh joined 00:50 cognominal joined 00:53 colomon left 00:55 colomon joined 00:56 ihrd joined 00:57 ihrd left 00:58 colomon__ joined, colomon left, colomon__ is now known as colomon 00:59 mikehh left 01:01 cognominal left 01:02 hercynium joined 01:19 cognominal joined 01:20 am0c left 01:22 am0c joined 01:25 lumi left, lumi joined 01:28 stephenlb left 01:36 c9s__ left, payload left, am0c left, hercynium left, drbean left, dalek left, szabgab left, Patterner left, lisppaste3 left, pmichaud left, nbrown left, pugs_svn left, arnsholt left, sjohnson left, zorgnax left, sunnavy left, gbacon left, tomaw__ left, Chazz left, gabiruh left, _jaldhar left, spinclad left, _ilbot2 left, sbp left, cognominal left, stepnem left, pnate2 left, ascent_ left, gfldex left, takadonet left, jnthn left, krakan left, cotto_work left, yath left, Maddingue left, jql left, lucs left, IgnisInCaelum left, Infinoid left, wolverian left, yahooooo left, debux left, Woody2143 left, betterworld left, huf left, Juerd left, PerlJam left, saschi left, hicx174 left, elmex left, xinming left, lestrrat left, literal left, avar left, BinGOs left, eiro left, colomon_ left, patspam left, ShaneC left, PacoLinux left, rachelBROWN left, orafu left, Exodist left, go|dfish left, partisan left, araujo left, cj left, cottoo left, teneighty left, REPLeffect left, yves left, zamolxes left, mtve left, mj41 left, Tene left, RichiH left, lumi left, meteorja1 left, |Jedai| left, sahadev left, mssm left, breinbaas left, rgrau` left, Intensity left, PZt left, silug left, allbery_b left, ssm left, idemal left, eternaleye left, frew left, perigrin left, Helios-- left, pnu left, rgrau left, akl left, hatseflats left, moritz_ left, p6eval left, buubot left, c1sung left, mathw left, [particle] left, frettled left, Grrrr left, baest left, rhr left, Guest97031 left, tkr left, mdxi left, revdiablo left, kst left, vinisterx left, pjcj_ left, nsh left, ashizawa left, astinus left, kcwu_ left, IRSeekBot left, c9s left, cxreg left, hanekomu left, tarbo2_ left, omega__ left, TimToady left, Caelum left, buu left, cls_bsd left, charsbar left 01:37 pmichaud joined, lumi joined, am0c joined, cognominal joined, hercynium joined, stepnem joined, drbean joined, teneighty joined, dalek joined, meteorja1 joined, c9s__ joined, payload joined, |Jedai| joined, lucs joined, pnate2 joined, idemal joined, patspam joined, sahadev joined, eternaleye joined, cottoo joined, mssm joined, ascent_ joined, buu joined, ShaneC joined, szabgab joined, breinbaas joined, rgrau` joined, Patterner joined, Intensity joined, lisppaste3 joined, PacoLinux joined, PZt joined, mathw joined, tarbo2_ joined, moritz_ joined, Caelum joined, Grrrr joined, IRSeekBot joined, irc.freenode.net sets mode: +ooov pmichaud mathw moritz_ IRSeekBot, p6eval joined, c1sung joined, omega__ joined, tkr joined, cxreg joined, pnu joined, buubot joined, cls_bsd joined, baest joined, akl joined, mdxi joined, pjcj_ joined, kst joined, Helios-- joined, irc.freenode.net sets mode: +v p6eval, rgrau joined, hatseflats joined, silug joined, kcwu_ joined, perigrin joined, ashizawa joined, revdiablo joined, allbery_b joined, nsh joined, rhr joined, ssm joined, Guest97031 joined, hanekomu joined, vinisterx joined, frew joined, astinus joined, frettled joined, c9s joined, charsbar joined, tomaw__ joined, sbp joined, gabiruh joined, _ilbot2 joined, _jaldhar joined, zorgnax joined, spinclad joined, sjohnson joined, arnsholt joined, pugs_svn joined, gbacon joined, Chazz joined, nbrown joined, sunnavy joined, [particle] joined, Exodist joined, go|dfish joined, Tene joined, mj41 joined, zamolxes joined, RichiH joined, orafu joined, araujo joined, rachelBROWN joined, partisan joined, cj joined, mtve joined, yves joined, REPLeffect joined, TimToady joined, gfldex joined, jql joined, irc.freenode.net sets mode: +o TimToady, Maddingue joined, lestrrat joined, saschi joined, yath joined, Woody2143 joined, krakan joined, Juerd joined, Infinoid joined, PerlJam joined, yahooooo joined, wolverian joined, elmex joined, betterworld joined, takadonet joined, hicx174 joined, IgnisInCaelum joined, huf joined, jnthn joined, debux joined, cotto_work joined, xinming joined, BinGOs joined, eiro joined, avar joined, literal joined, colomon_ joined, irc.freenode.net sets mode: +oo PerlJam jnthn 01:50 araujo left 01:52 mariano joined 02:19 japhb left 02:23 mssm left, orafu left 02:24 orafu joined 02:34 ash_ joined 02:56 japhb joined 03:21 nadim_ left 03:29 araujo joined 03:31 ShaneC left
colomon_ ng: say 1; 03:35
p6eval ng d5a7de: 1␤
colomon_ ng: (1...10).grep({$_ % 3 == 2}).perl.say
p6eval ng d5a7de: []␤
colomon_ ng: (1...10).grep({$^a % 3 == 2}).perl.say
p6eval ng d5a7de: [2, 5, 8]␤
colomon_ blast, I was hoping pmichaud's move to parrot 2.0.0 might have fixed that one 03:38
sjohnson :( 03:41
Tene um... why? how would it have any effect? 03:46
03:46 cognominal left
ash_ ng: (-> $a { -> $b { $a + $b } })(4)(5); 03:46
p6eval ng d5a7de: Not enough positional parameters passed; got 0 but expected 1␤current instr.: '_block34' pc 218 (EVAL_1:103)␤
ash_ rakudo: say (-> $a { -> $b { $a + $b } })(4)(5); 03:47
p6eval rakudo 1d4928: 9␤
ash_ hmm
ng: say (-> $a { $a })(4);
p6eval ng d5a7de: sh: ./perl6: No such file or directory␤
ash_ locally that just prints 4 03:48
for some reason, putting a pointy block in a pointy block it gets an error
03:50 colomon left
ash_ well, not a parse error, but its not functioning right, hmmm 03:51
03:55 cottoo left 04:15 orafu left 04:17 orafu joined, pnate joined 04:20 pnate2 left 04:24 ash__ joined 04:28 JimmyZ joined 04:41 ash_ left 05:05 Baggiokwok joined 05:18 JimmyZ left 05:22 Baggiokwok left 05:47 zloyrusskiy joined 05:57 rekhajos joined 06:13 drbean left 06:16 pnate2 joined 06:19 c9s is now known as c9s_ 06:20 c9s_ is now known as c9s 06:28 synth joined 06:30 pnate left 06:56 k23z__ joined
k23z__ can I compile perl6 on windows ? 06:56
rakudo to be specific
or maybe I can find binaries somewherE ? 06:57
someone care to provide me with binaries for rakudo on windows ?
07:01 cotto joined
Tene k23z__: sourceforge.net/projects/parrotwin32/files/ has what you need. 07:02
k23z__: I'm not sure which combination of those files is the one you need, but they're in there somewhere. :)
I don't use win32, but that link came from rakudo.org/ which I think mentions in slightly more detail. 07:03
07:05 justatheory joined
k23z__ ok 07:05
thanks
Tene No problem. I'm glad I could help. Also, welcome to the channel! :)
07:09 justatheory left 07:11 kaare joined, kaare is now known as Guest90110 07:19 redicaps joined 07:21 rgrau` left 07:22 Su-Shee joined
Su-Shee good morning 07:22
07:24 [synth] joined 07:33 cognominal joined 07:35 Baggiokwok joined 07:39 broquaint joined 07:41 synth left 07:45 mariano left 07:53 pnate joined 07:55 TiMBuS joined 07:59 iblechbot joined 08:03 mikehh joined 08:04 vamped joined, pnate2 left 08:20 kowey joined, k23z__ left 08:33 DeanPowell joined 08:42 vamped left 08:47 riffraff joined 08:48 tylerni7 joined
moritz_ good morning 08:50
08:51 _ilbot2 left, jonasbn joined, jonasbn left 08:52 _ilbot2 joined, jonasbn joined 08:56 nadim_ joined, DeanPowell left 09:00 agentzh joined 09:03 cognominal left 09:12 dakkar joined 09:17 k23z__ joined
sjohnson hi moritz_ 09:28
(´ー` )
09:30 kowey left 09:32 k23z__ left 09:37 cognominal joined 09:47 mssm joined
jnthn oh morning 09:50
moritz_ \o/
sjohnson ( ° ー°)
09:52 hicx174 left
szbalint jnthn: still in Vienna? 09:54
jnthn szbalint: Bratislava...just went to Vienna for Vienna.pm last night.
szbalint aw. I had a free evening yesterday in Wien, too late now :S 09:55
09:56 meppl joined
jnthn Aw. 09:58
09:58 agentzh left, agentzh1 joined
frettled morning-thing! 10:00
sjohnson heh 10:06
10:08 meneldor joined
meneldor morning all 10:08
sjohnson hi hi hi 10:13
10:16 dakkar left, dakkar_ joined 10:26 Chazz is now known as zz_Chazz 10:31 Baggiokwok left 10:41 jonasbn left
xinming read the synopsis again, everytime he reads, everytime he feels the exciting future. :-) 10:54
11:02 dakkar_ is now known as dakkar, colomon joined 11:03 dakkar left, dakkar joined
colomon morning 11:08
jnthn morning, colomon 11:12
11:12 mssm left
colomon 2nd night in a row I got 7 hours uninterrupted sleep 11:12
jnthn \o/ 11:13
colomon I think this is the first time that's happened in about 18 months....
so very \o/ !
what's on the ng agenda for today? 11:14
11:16 agentzh1 left
jnthn I'm pondering either trying to do hash or trying to get a bit further with S12-*. 11:17
do Hash, that is. :-) 11:18
colomon :)
just don't drink beer and do hash at the same time, m'kay? ;) 11:19
sjohnson heh 11:20
mathw And don't code and drink beer and do hash either 11:22
jnthn I think if I was drinking beer and doing hash I'd be too relaxed to code. :-) 11:27
mathw That seems likely 11:30
11:30 Baggiokwok joined 11:32 payload left, test joined 11:33 test is now known as Guest18693
Guest18693 hi 11:34
11:34 payload joined
mathw hi 11:39
11:42 Baggiokwok left
sjohnson hi matt 11:42
11:50 rekhajos left 11:53 SmokeMachine joined
mathw hi sjohnson 11:54
11:54 payload left 11:55 mssm joined 12:00 IgnisInCaelum left, Baggiokwok joined 12:07 drbean joined 12:08 redicaps left
colomon sjohnson: my impression is Canada is getting pretty excited about the Olympics. 12:08
12:11 Guest18693 left
sjohnson colomon: yeah the Vancouver 2010 campaign has been around for a while 12:11
it's a bit of a misnomer, as i'm sure most of the things will happen in cities near Vancouver that any foreigners don't even know about 12:12
like Whistler, BC
etc
colomon thought Whistler was someplace people knew about. ;)
sjohnson ahh probably is 12:13
12:13 lumi left, lumi joined
colomon I have to admit that mostly I only know southern Ontario and eastern Newfoundland. 12:13
jnthn I've heard of Whistler. :-)
colomon \o/ 12:14
jnthn Never been to Canada though yet. :-(
colomon I think we just officially scheduled our sixth vacation of more than a week there (as a couple). 12:15
At least, I booked the motel for it. 12:16
sjohnson i landed in toronto once
colomon (Canada, that is, not Whistler.)
sjohnson on a flight to India
toronto and vancouver distance is like a 5 day drive 12:17
colomon That can't be right, can it? I would have guessed 3 days. 12:18
of course, that's based on my parents' stories of Ohio to Oregon driving time, so might be wildly off. :) 12:19
jnthn I keep thinking "ah, YAPC::NA will be in Canada some day, and then I'll go to that and make a holiday around it." :-) 12:20
colomon speaking of which, anyone know if YAPC::NA has a date yet? Columbus is in easy driving range for me... 12:21
12:23 rachelBROWN left 12:24 IgnisInCaelum joined 12:25 IgnisInCaelum is now known as Guest44473 12:29 ruoso joined
sjohnson colomon: i suppose it depends on pitstops, motels, etc 12:29
but its a long ways
12:31 riffraff left
colomon :) 12:31
12:31 [particle] left
sjohnson ( `ー´) 12:34
12:37 jerbraun joined, clintongormley joined 12:43 bluescreen joined, jerbraun left 12:44 patspam left 12:48 mssm left 12:49 mssm joined 12:51 bluescreen left 12:52 bluescreen joined 12:58 awwaiid joined 13:01 k23z__ joined
takadonet morning all 13:03
colomon morning!
takadonet colomon: how are u?
colomon great! u? 13:05
I got a good night's sleep, the sun is shining, my boy is in a good mood, ng progress is being made...
13:06 Baggiokwok left
takadonet doing good. Work is going great and ng progress is being made :) 13:11
13:11 cognominal left 13:17 k23z__ left
pmichaud good morning #perl6 13:21
last night's hacking on list assignment was full of FAIL :-( 13:22
so, I'm at it again this morning. :-)
moritz_ good morning 13:23
colomon these things always work better in the morning, in my experience. :)
colomon 's boy just ripped two keys off the MBP keyboard, meaning a trip to the Apple Store is in my near future. 13:24
13:30 allbery_b left, ssm left, ruoso left, nadim_ left, pnate left, frew left, perigrin left, idemal left, pnu left, akl left, hatseflats left, eternaleye left, Helios-- left, p6eval left, c1sung left, buubot left, moritz_ left, rgrau left, drbean left, _ilbot2 left, orafu left, c9s__ left, awwaiid left, zloyrusskiy left, araujo left, nbrown left, pugs_svn left, arnsholt left, pmichaud left, sjohnson left, hercynium left, Patterner left, gbacon left, gabiruh left, sunnavy left, spinclad left, szabgab left, _jaldhar left, am0c left, zorgnax left, zz_Chazz left, sbp left, tomaw__ left, lisppaste3 left, dalek left, clintongormley left, dakkar left, tylerni7 left, ash__ left, Exodist left, go|dfish left, partisan left, PacoLinux left, cj left, bluescreen left, Guest44473 left, [synth] left, teneighty left, mj41 left, REPLeffect left, yves left, Tene left, mtve left, zamolxes left, RichiH left, lumi left, japhb left, PZt left, sahadev left, meteorja1 left, |Jedai| left, breinbaas left, Intensity left, silug left, frettled left, rhr left, Grrrr left, mdxi left, mathw left, revdiablo left, tkr left, baest left, vinisterx left, buu left, astinus left, Caelum left, kcwu_ left, pjcj_ left, omega__ left, Guest97031 left, ashizawa left, c9s left, cls_bsd left, TimToady left, charsbar left, hanekomu left, nsh left, cxreg left, kst left, tarbo2_ left, IRSeekBot left, broquaint left, pmichaud joined, awwaiid joined, drbean joined, _ilbot2 joined, zloyrusskiy joined, orafu joined, araujo joined, am0c joined, hercynium joined, dalek joined, c9s__ joined, szabgab joined, Patterner joined, lisppaste3 joined, sunnavy joined, nbrown joined, zz_Chazz joined, gbacon joined, pugs_svn joined, arnsholt joined, sjohnson joined, spinclad joined, zorgnax joined, _jaldhar joined, gabiruh joined, sbp joined, tomaw__ joined, irc.freenode.net sets mode: +o pmichaud 13:31 bluescreen joined, clintongormley joined, Guest44473 joined, dakkar joined, tylerni7 joined, [synth] joined, ash__ joined, teneighty joined, PacoLinux joined, Exodist joined, go|dfish joined, Tene joined, mj41 joined, zamolxes joined, RichiH joined, partisan joined, cj joined, mtve joined, yves joined, REPLeffect joined 13:32 idemal joined, allbery_b joined, lumi joined, japhb joined, meteorja1 joined, |Jedai| joined, sahadev joined, breinbaas joined, Intensity joined, PZt joined, silug joined, sahadev left 13:33 TimToady joined, broquaint joined, buu joined, charsbar joined, c9s joined, frettled joined, astinus joined, vinisterx joined, hanekomu joined, Guest97031 joined, rhr joined, nsh joined, revdiablo joined, ashizawa joined, kcwu_ joined, kst joined, pjcj_ joined, mdxi joined, baest joined, cls_bsd joined, cxreg joined, tkr joined, omega__ joined, IRSeekBot joined, Grrrr joined, Caelum joined, tarbo2_ joined, mathw joined, irc.freenode.net sets mode: +ovo TimToady IRSeekBot mathw, eternaleye joined, eternaleye left 13:34 nadim_ joined, TiMBuS left, buubot joined, moritz_ joined 13:35 c1sung_ joined, ruoso joined, pnate joined, eternaleye joined, frew joined, perigrin joined, hatseflats joined, Helios-- joined, akl joined, pnu joined, c1sung joined, p6eval joined, irc.freenode.net sets mode: +v p6eval, c1sung left, eternaleye left
pugs_svn r29570 | pmichaud++ | [pm.txt]: Another spec clarification question. 13:35
r29570 |
r29570 | Pm-17: Are the builtin types such as C<Num>, C<Int>, C<Rat>,
r29570 | C<Str>, C<List>, etc. subclasses of C<Cool> or do they
r29570 | rely on C<Cool>'s method fallback mechanisms for the
r29570 | common methods? (Or, another way of asking: is
13:35 rgrau joined
pugs_svn r29570 | C<List ~~ Cool> true?) 13:35
moritz_ I'm pretty sure that List ~~ Cool is true 13:36
13:36 ssm joined
pmichaud okay. The spec and #perl6 logs I could find were fairly unclear on that point. 13:36
s/were/are/
as I read the spec currently, though, it seems weird that MyClass ~~ Cool would be false but it would still respond to Cool's methods. 13:38
(assuming the builtin types have ~~ Cool as true)
colomon I thought the entire point of having Cool was that MyClass wouldn't have all those methods? 13:39
pmichaud colomon: it doesn't have the methods, but it still responds to them
colomon (Is this S12?)
pmichaud: that seems like a distinction without much of a difference.
jnthn pmichaud: That wasn't my understanding of it.
pmichaud: You inherit from Cool if you want your class to have those methods. 13:40
pmichaud Cool is a "fallback class namespace" where the dispatcher looks if it's unable to find a method for a given object
moritz_ [S02] rough in idea of moritz_++ to have separate type for convenience loopbacks
also conjecturally put all "last-resort" multis there to see if jnthn++ freaks
jnthn pmichaud: ah, hm.
moritz_ so it seems that the method fallback is still conjectural
pmichaud so is Cool
jnthn pmichaud: Use "is Cool" on varius built-in types.
pmichaud: iiuc
pmichaud: Any is still default thing we inherit from 13:41
pmichaud: Cool ~~ Any
pmichaud jnthn: yes, I know that. That's not my question/point.
jnthn pmichaud: tbh, I don't know why we need such a fallback yet.
pmichaud: It's worth asking, but I don't think it impedes putting Cool in. 13:42
pmichaud S02:1568 says "The C<Cool> namespace also contains all multimethods of last resort;
these are automatically searched if normal multiple dispatch does not
find a viable candidate."
If this is true, then it's not necessary for builtin classes to inherit from Cool. (more)
Not only that, but all user-defined types respond to Cool methods even if they aren't defined as "is Cool". 13:43
with the point being that when you ask a user-defined type for its methods, the Cool methods don't appear.
jnthn pmichaud: The big problem with this is that all the methods in Cool would have to declare a more liberal invocant than Cool
pmichaud Sure, they'd define Any. 13:44
jnthn Otherwise the multi-dispatch is gonna fail because the invocant type won't match.
Right.
pmichaud I mean, they'd use Any as the invocant. I don't see that as a big deal.
jnthn That feels a tad odd to me, that's all.
Anyway, I think the built-in types should inherit from Cool.
pmichaud I totally agree with you/moritz that it makes sense to simply say that builtin types derive from Cool.
But then I'm wondering (1) why the spec doesn't explicitly say that, and (2) why the fallback?
jnthn And we defer worrying about the multi-dispatch fallback for a little bit. 13:45
I'm not sure.
pmichaud Thus, my request for clarification in pm.txt :-)
jnthn I'm not sure that I like the fallback idea entirely, but I don't dislike it enough (yet) to freak either. :-)
colomon That reminds me (was thinking about this the other day), Cool does Real?
jnthn ooh, Slovak class time!
back later
pmichaud colomon: I wouldn't expect that.
moritz_ colomon: no
maybe Real is Cool or so :) 13:46
pmichaud Real is just a role, iiuc.
Num does Real, Rat does Real
colomon That's more or less how Any works now, it has all the functions that Real would have.
pmichaud colomon: well, it also has a lot of the function that Str would have 13:47
colomon and they're intended to work magically.
pmichaud and that List would have
with equal amounts of magic
colomon yes, I would also expect that Cool does Str or Stringy or whatever that role is.
13:47 Lorn joined
pmichaud colomon: no, we don't want Num ~~ Stringy, I think. 13:48
13:48 k23z__ joined
colomon I thought the point of Cool was that numbers can be used like strings, and strings like numbers, where appropriate. 13:49
moritz_ colomon: yes, but it doesn't work the way you think it does
pmichaud that is the point of Cool. But we don't have to tie it to all of the roles
13:49 payload joined
moritz_ colomon: currently this works by putting the method sin() into Any 13:50
pmichaud our definitions will tend to look like "class Num is Cool does Numeric"
or, more likely
our definitions will tend to look like "class Num is Cool does Numeric does Real"
moritz_ colomon: in the future that will work by putting it into Cool instead of Any
colomon: and since Str ~~ Cool, "23".sin works
pmichaud the methods go in Cool, while Numeric/Real allow us to distinguish the object capabilities 13:51
Numeric, Stringy, Real, etc are more for type constraints than method composition, I think.
13:52 smash_ joined
smash_ hello 13:52
colomon but doesn't that lead to massive code duplication? I mean, you'll have to have Cool.sin { self.Num.sin } as well as Real.sin { self.Num.sin }.
repeated for every numeric function on reals.
pmichaud not at all
colomon oh, wait, that's wrong.
errr, no, it isn't. 13:53
pmichaud I think we'd just have Cool.sin and Num.sin
colomon I guess that would work, but it feels very very very wrong to me.... 13:54
pmichaud I suppose it could also be Cool.sin and Real.sin
anyway, code duplication of single-line delegations isn't something I worry about too much :) 13:55
takadonet smash: hello 13:56
13:57 mariuz joined 13:58 iblechbot left 13:59 Guest44473 left 14:01 IgnisInCaelum joined, IgnisInCaelum is now known as Guest38672 14:04 mariuz left 14:05 mariuz joined
colomon Maybe it's the idea "abstract role" that's tripping up my thinking? 14:05
pmichaud maybe. Maybe it's just that builtin types are weird because we want so many of them to be able to act like others :)
14:05 zloyrusskiy left
colomon Does that mean the role has no attributes, or that it is just an interface specification, with no function implementations? 14:05
moritz_ ng: say 1 14:06
p6eval ng d5a7de: 1␤
pmichaud colomon: not sure yet.
colomon I've been imagining that if your class does Real, all you need to provide is .Num and it will provide implementations of all the appropriate real number functions for you.
pmichaud the question is along the lines of "What do we expect class XYZ does Real { ... } to accomplish?"
moritz_ colomon: it sounds like you really want to inherit from Num for such a class 14:07
if you want all its arithmetic to go through .Num
colomon moritz_: but you DON'T want that, because you don't want to be carrying a extra floating point value around with you. 14:08
pmichaud moritz_: sure, but then you also get all of Num's .... what colomon++ said
colomon Think of Rat.
k23z__ have you considered making the compiler play some nice music while compiling ?
it would be way cool :)
something like "hey, hold on I'm compiling, listen to some music..."
pmichaud afk a bit 14:09
colomon There are a huge set of functions on Rat which amount to method X { self.Num.X }
those functions exactly correspond to what Real should be capable of.
moritz_ k23z__: I hate every program that plays music (unless its primary concern is to be a music or video player)
k23z__ you also hate keygens ? 14:10
I'm asking because they have this extremely cool music called chiptunes
colomon Furthermore, those functions are all covered in Real.
moritz_ k23z__: yes
14:10 [particle] joined 14:12 ignacio_ joined
k23z__ but moritz_ , the music in the keygens , it has that air of familirity 14:12
moritz_ k23z__: nope.
14:13 unknow_element joined, unknow_element left 14:14 unknow_element joined, unknow_element left 14:18 drbean left 14:19 lisppaste3 left, lisppaste3 joined 14:31 Grrrr left, TimToady left, mdxi left, rhr left, frettled left, revdiablo left, vinisterx left, tkr left, baest left, cxreg left, mathw left, broquaint left, pjcj_ left, kcwu_ left, buu left, c9s left, cls_bsd left, Guest97031 left, omega__ left, tarbo2_ left, nsh left, kst left, charsbar left, Caelum left, IRSeekBot left, ashizawa left, astinus left, hanekomu left, Guest38672 left, payload left, lumi left, breinbaas left, meteorja1 left, |Jedai| left, japhb left, PZt left, Intensity left, allbery_b left, rgrau left, perigrin left, frew left, pnate left, p6eval left, hatseflats left, akl left, Helios-- left, pnu left, ruoso left, silug left, nadim_ left, ash__ left, dakkar left, clintongormley left, tylerni7 left, cj left, partisan left, go|dfish left, Exodist left, PacoLinux left, [synth] left, bluescreen left, mtve left, teneighty left, yves left, REPLeffect left, zamolxes left, mj41 left, Tene left, RichiH left, lisppaste3 left, ignacio_ left, Lorn left, orafu left, c9s__ left, _ilbot2 left, ssm left, [particle] left, mariuz left, smash_ left, idemal left, spinclad left, arnsholt left, pugs_svn left, nbrown left, pmichaud left, szabgab left, hercynium left, am0c left, _jaldhar left, sjohnson left, zorgnax left, Patterner left, sbp left, gabiruh left, tomaw__ left, gbacon left, sunnavy left, araujo left, dalek left, awwaiid left, zz_Chazz left, k23z__ left, c1sung_ left, mssm left, Su-Shee left, Guest90110 left, cotto left, jnthn left, takadonet left, gfldex left, lucs left, krakan left, ascent_ left, yahooooo left, Woody2143 left, jql left, wolverian left, Juerd left, huf left, betterworld left, Maddingue left, cotto_work left, PerlJam left, xinming left, debux left, saschi left, Infinoid left, stepnem left, lestrrat left, elmex left, yath left, buubot left, literal left, avar left, meneldor left, BinGOs left, eiro left, colomon_ left, meppl left, krunen left, Gothmog_ left, constant left, felipe left, presh_ left, mikehh left, mikehh_ joined, Khisanth left, mathw joined, lisppaste3 joined, ignacio_ joined, [particle] joined, mariuz joined, Guest38672 joined, smash_ joined, payload joined, k23z__ joined, Lorn joined, ssm joined, rgrau joined, p6eval joined, pnu joined, akl joined, Helios-- joined, hatseflats joined, perigrin joined, frew joined, pnate joined, ruoso joined, c1sung_ joined, buubot joined, nadim_ joined, tarbo2_ joined, Caelum joined, Grrrr joined, IRSeekBot joined, omega__ joined, tkr joined, cxreg joined, cls_bsd joined, baest joined, mdxi joined, pjcj_ joined, kst joined, kcwu_ joined, revdiablo joined, nsh joined, rhr joined, Guest97031 joined, hanekomu joined, vinisterx joined, astinus joined, frettled joined, c9s joined, charsbar joined, buu joined, broquaint joined, TimToady joined, irc.freenode.net sets mode: +ovvo mathw p6eval IRSeekBot TimToady, silug joined, PZt joined, Intensity joined, breinbaas joined, |Jedai| joined, meteorja1 joined, japhb joined, lumi joined, allbery_b joined, idemal joined, REPLeffect joined, yves joined, mtve joined, cj joined, partisan joined, RichiH joined, zamolxes joined, mj41 joined, Tene joined, go|dfish joined, Exodist joined, PacoLinux joined, teneighty joined, ash__ joined, [synth] joined, tylerni7 joined, dakkar joined, clintongormley joined, bluescreen joined, tomaw__ joined, sbp joined, gabiruh joined, _jaldhar joined, zorgnax joined, spinclad joined, sjohnson joined, arnsholt joined, pugs_svn joined, gbacon joined, zz_Chazz joined, nbrown joined, sunnavy joined, Patterner joined, c9s__ joined, dalek joined, hercynium joined, am0c joined, araujo joined, orafu joined, _ilbot2 joined, awwaiid joined, pmichaud joined, irc.freenode.net sets mode: +o pmichaud, mssm joined, meneldor joined, meppl joined, Su-Shee joined, Guest90110 joined, cotto joined, presh_ joined, felipe joined, constant joined, krunen joined, Gothmog_ joined, stepnem joined, lucs joined, ascent_ joined, gfldex joined, jql joined, Maddingue joined, lestrrat joined, saschi joined, yath joined, Woody2143 joined, krakan joined, Juerd joined, Infinoid joined, PerlJam joined, yahooooo joined, wolverian joined, elmex joined, betterworld joined, takadonet joined, huf joined, jnthn joined, debux joined, cotto_work joined, xinming joined, BinGOs joined, eiro joined, avar joined, literal joined, colomon_ joined, irc.freenode.net sets mode: +oo PerlJam jnthn
pmichaud huh? We have a src/cheats/parrot/misc.txt that isn't used at all? 14:32
14:32 cognominal joined, mj41_ joined 14:33 ignacio_ left
pmichaud er, misc.pir 14:33
that's... weird, wonder where that file came from
14:34 frettled left, rhr left, Grrrr left, mdxi left, mathw left, revdiablo left, vinisterx left, tkr left, baest left, buu left, astinus left, Caelum left, kcwu_ left, pjcj_ left, omega__ left, Guest97031 left, c9s left, cls_bsd left, TimToady left, charsbar left, hanekomu left, nsh left, kst left, broquaint left, cxreg left, IRSeekBot left, tarbo2_ left, lumi left, Guest38672 left, PZt left, japhb left, meteorja1 left, |Jedai| left, payload left, breinbaas left, Intensity left, allbery_b left, pnate left, frew left, perigrin left, hatseflats left, Helios-- left, p6eval left, akl left, ruoso left, rgrau left, pnu left, silug left, ash__ left, clintongormley left, nadim_ left, go|dfish left, dakkar left, PacoLinux left, Exodist left, cj left, partisan left, tylerni7 left, bluescreen left, [synth] left, teneighty left, REPLeffect left, yves left, mtve left, zamolxes left, Tene left, mj41 left, RichiH left, mj41_ is now known as mj41
pmichaud I guess it's left over 14:34
14:34 rgrau joined, p6eval joined, pnu joined, akl joined, Helios-- joined, hatseflats joined, perigrin joined, frew joined, pnate joined, ruoso joined, silug joined, irc.freenode.net sets mode: +v p6eval 14:35 Guest38672 joined, payload joined, lumi joined, japhb joined, meteorja1 joined, |Jedai| joined, breinbaas joined, Intensity joined, PZt joined, allbery_b joined 14:36 nadim_ joined, bluescreen joined, clintongormley joined, dakkar joined, tylerni7 joined, [synth] joined, ash__ joined, teneighty joined, PacoLinux joined, Exodist joined, go|dfish joined, Tene joined, zamolxes joined, RichiH joined, partisan joined, cj joined, mtve joined, yves joined, REPLeffect joined, Exodist_ joined, zamolxes left, go|dfish left, zamolxes joined, mtve left, mtve joined 14:37 Exodist left 14:40 ignacio_ joined 14:41 mtve left 14:44 Khisanth joined 14:48 ash__ left, dakkar left, nadim_ left, clintongormley left, tylerni7 left, cj left, partisan left, PacoLinux left, tylerni7 joined, clintongormley joined, dakkar joined 14:50 TimToady joined, broquaint joined, buu joined, charsbar joined, c9s joined, frettled joined, astinus joined, vinisterx joined, hanekomu joined, Guest97031 joined, rhr joined, nsh joined, revdiablo joined, kcwu_ joined, kst joined, pjcj_ joined, mdxi joined, baest joined, cls_bsd joined, cxreg joined, tkr joined, omega__ joined, IRSeekBot joined, Grrrr joined, Caelum joined, tarbo2_ joined, mathw joined, irc.freenode.net sets mode: +ovo TimToady IRSeekBot mathw 14:53 cj joined 14:55 Baggiokwok joined 14:57 mj41 left 14:58 Guest90110 left 14:59 mj41 joined 15:10 payload left 15:11 hicx174 joined 15:12 PacoLinux joined 15:23 colomon__ joined, colomon left, colomon__ is now known as colomon 15:25 frederico joined 15:26 iblechbot joined, go|dfish joined 15:29 ash_ joined 15:31 colomon__ joined, colomon left, colomon__ is now known as colomon
ash_ so, i figured out whats wrong with a pointy block in a pointy block, now to see if i can find why 15:31
colomon so what's wrong with it?
pmichaud argggh, getting lists and arrays to work is being endless FAIL for me :-| 15:32
something is fundamentally wrong here.
mathw :( 15:33
dalek kudo/ng: d5a8d9c | pmichaud++ | src/cheats/parrot/ (4 files):
Move some obsolete files out of the active build directories.
ash_ i looked at the generated pir code for (-> $a { -> $b { $a + $b } })(4)(4);
jnthn ash_++ # looking at that problem
ash_ the outer block isn't returning the block inside, its executing it 15:34
jnthn Oh
OK, some odd code-gen issue then. :-/
pmichaud it must think it's an immediate block
jnthn Aye.
Curious why it does that for nested ones.
15:35 Baggiokwok left
ash_ its like 2 lines, its doing capture_lex $P3 \n $P4 = $P3() \n .return ($P4) 15:35
pmichaud perhaps it does it for non-nested one also
ash_ just 1 line needs to change in the genrated code
pmichaud pmichaud@orange:~/ng$ ./perl6
> -> { say 'hello' }
hello
I'm guessing it does it for all pointy blocks
ash_ ng: say (-> $a { 'hi' })(4); 15:36
p6eval ng d5a7de: hi␤
pmichaud that's not a bare block :-)
ng: -> $a { say 'hi' }
p6eval ng d5a7de: Not enough positional parameters passed; got 0 but expected 1␤current instr.: '_block22' pc 86 (EVAL_1:45)␤
pmichaud ng: -> { say 'hi' }
p6eval ng d5a7de: hi␤
ash_ ah
frettled
pmichaud I wonder if a pointy block is always a declaration -- i.e., not executed immediately (unless the other construct requires it) 15:37
moritz_ would make sense 15:38
pmichaud I'll try that. 15:39
15:42 cognominal left
ash_ for reference, anon sub's work fine if you do the same thing 15:43
ng: say (sub ($a) { sub ($b) { $a + $b } })(4)(4);
p6eval ng d5a7de: 8␤
ash_ may or may not mean anything though
pmichaud yes, because 'sub' forces the blocktype to be set to declaration
15:43 cognominal joined
pmichaud I've just patched -> to do the same (I think, spectesting now) 15:43
15:44 justatheory joined
pmichaud > say (-> $a { -> $b { $a + $b } })(4)(4); 15:44
8
ash_ pmichaud++ woot, want to try t/spec/S02-builtin_data_types/anon_block.rakudo 15:46
15:46 mariuz left
ash_ its the test i was trying to get working 15:46
pmichaud All tests successful.
pushed fix to github
jnthn \o/ 15:47
15:47 Psyche^ joined, nihiliad joined
pmichaud ash_: thanks for finding that and giving such a good diagnosis -- made it easy to fix :) 15:47
ash_ no worries, if i find more i'll let someone know
pmichaud is the specific example you gave in the test file? perhaps it should be? 15:48
frettled pmichaud++ - excellent
pmichaud ah, I see it -- test #18
tests++
15:49 KyleHa joined, Patterner left, Psyche^ is now known as Patterner
pmichaud laziness sure makes list assignment a lot more interesting 15:50
dalek kudo/ng: ee71f1e | pmichaud++ | src/Perl6/Actions.pm:
Force bare pointy subs to be treated as declarations instead of
15:51
pmichaud ($a, @b) = (@c, $a) # example
frettled o_O
15:53 ab5tract joined
pmichaud we can't just take the first element of @c, put it in $a, and then copy the rest of the rhs into @b, because @b should get the value of $a before the assignment 15:53
colomon yow 15:54
pmichaud we can't just iterate the rhs and make copies of everything before doing the assignment, because @c could be infinit
*e
(or otherwise lazy)
anyway, I think I have that problem worked out for now... but it's still bizarrely interesting to deal with 15:55
15:55 payload joined
pmichaud right now I can't even get simple arrays to work properly. 15:55
ng: my $a = 5; my $b = [$a]; $a++; say $b.perl; # wrong
p6eval ng ee71f1: [6]␤
pmichaud I know what the bug is in the code, but all of the fixes I'm trying break things horribly
looks like I'll have to rethink the current implementation of map, list, and array 15:56
mathw Who wanted laziness? :) 15:57
It is cool, but it'd be a lot easier if we didn't have it
pmichaud oh, I suspect it's waterbed theory
15:57 ashizawa joined
pmichaud we can make the implementation easier without it, but we then push the complexity to the users 15:57
which is the wrong approach :)
PerlJam it's star trek: the needs of the many (users) out weigh the needs of the one (pmichaud) :-) 15:58
colomon is just glad he didn't tackle list assignment himself over the weekend... 16:00
frettled :) 16:02
pmichaud ng: my $a = (3,(4,5),6); say $a.perl 16:03
p6eval ng ee71f1: (3, 4, 5, 6)␤
pmichaud ng: my $a = List.new(3,(4,5),6); say $a.perl 16:04
p6eval ng ee71f1: (3, 4, 5, 6)␤
pmichaud ng: my @a = List.new(3,4); say @a.perl
p6eval ng ee71f1: [(3, 4)]␤
pmichaud ng: my @a = List.new(3,4); say @a.elems
p6eval ng ee71f1: 1␤
pmichaud ng: my @a = (3,4).list; say @a.elems 16:05
p6eval ng ee71f1: 2␤
ash_ ng: my @a = List.new(1, 2, 3).list; say @a.perl; 16:06
p6eval ng ee71f1: [(1, 2, 3)]␤
ash_ .list relies on @ context, which i don't think is functioning the way its supposed to
pmichaud I think List.new is bogus 16:07
colomon in concept or execution?
pmichaud execution
why isn't it just: method new(*@args) { @args } 16:08
ash_ my fault, i didn't know it could be that simple...
pmichaud oh, I know why
because that would return an Array
colomon because when you do that it fails miserably.
it's worse than that, it didn't actually ever get called.
pmichaud well, the problem with the current implementation is that it's not evaluating args in list context 16:09
er, that's not it. hrm.
ash_ ng: class Foo {}; augment class Foo { method new(*@args) { say 'hi' } }; my $a = Foo.new(1, 2); 16:10
p6eval ng ee71f1: ( no output )
ash_ is why i didn't augment List with a new method
for some reason, when you augment the class, it didn't get the new new
thats why i went with a .pir version in builtin/List.pir 16:11
pmichaud okay... reworking
ash_ as for the exact implementation, i was trying to do it the way you normally do, i didn't know i could return the @args
pmichaud well you can, but as I mentioned, @args would probably end up being an Array
and we want a List
ash_ trying to use bless and the like, since it gets inherited into Array, so i wanted to make sure it works with Array and List 16:12
16:12 IgnisInCaelum joined, ab5tract left 16:13 IgnisInCaelum is now known as Guest8010
ash_ btw, was pmichaud should augment be able to add a 'new' method? I don't see why not... if so, then i think augment may not be functioning the way you'd expect it to 16:13
16:14 Guest8010 left
pmichaud ash_: I agree that looks like a bug. Although you might want 'new' to be a multi there. 16:14
ash_ ng: class Foo {}; augment class Foo { multi method new(*@args) { say 'hi' } }; my $a = Foo.new(1, 2);
p6eval ng ee71f1: ( no output )
pmichaud ng: class Foo {}; augment class Foo { multi method bar(*@args) { say 'hi' } }; Foo.bar(1,2);
p6eval ng ee71f1: hi␤
16:14 Guest38672 left
pmichaud ng: class Foo {}; augment class Foo { multi method new(*@args) { say 'hi' } }; Foo.new(1,2); 16:15
p6eval ng ee71f1: ( no output )
pmichaud I'm guessing there's a method cache problem on 'new' there.
jnthn Method cache? :-/ 16:16
There's a problem of some kind though.
ash_ the default new does *@args, *%kwargs
pmichaud I did say it was a guess :-)
ash_ ng: class Foo {}; augment class Foo { method new(*@args, *%kwargs) { say 'hi' } }; my $a = Foo.new(1, 2);
p6eval ng ee71f1: ( no output )
16:16 Exodist_ is now known as Exodist
jnthn pmichaud: Heh. I didn't realize there was a method cache. ;-) 16:16
pmichaud there might not be one. But didn't we have some sort of multidispatch cache somewhere?
jnthn Yeah, but adding a new method is meant to invalidate it. 16:17
ash_ ng: class Foo {}; augment class Foo { method new(*@args, *%kwargs) { say 'hi' } }; my $a = Foo.new(1, 2, :b<a>);
p6eval ng ee71f1: sh: ./perl6: No such file or directory␤
ash_ locally that still has no output
pmichaud right, so I'm guessing the multidispatch cache isn't being invalidated then
ash_ so... i never really figured out what was wrong, but i just thought i'd let someone that knows more about ng know
jnthn pmichaud: I'll try and hunt it down. 16:18
16:19 ignacio_ left
pmichaud > my @a = List.new(1,2); say @a.perl; 16:20
[1, 2]
better.
jnthn :-) 16:21
dalek kudo/ng: 57a8065 | pmichaud++ | src/builtins/List.pir:
Refactor List.new a bit; set 'flatten' flag so that lists created
16:25
pmichaud jnthn: I'm toying again with the idea of having all containers (including things held in arrays) as being Perl6Scalar, instead of the value type directly. 16:26
16:26 alester joined 16:27 alester left
jnthn pmichaud: hm 16:28
16:28 alester joined
jnthn pmichaud: We can haz extra GC overhead, that's the only issue... 16:28
pmichaud well, there's a dereferencing cost also
jnthn pmichaud: Rationale?
pmichaud well, the copy approach has its own GC overhead cost as well 16:29
because we end up making temporary clones that get thrown away
jnthn pmichaud: That is true, plus the copy costs.
frettled More powerful computers will take care of this within 1 femtillion years.
pmichaud we also incur the cost of asking each object "what is your value type"
jnthn pmichaud: It may well work out the same.
frettled Or was that pentillion? I forget.
16:29 alester is now known as Andy
jnthn Or perhaps better. 16:29
16:30 Andy is now known as alester
pmichaud if we can avoid the "value type" request, that might be a huge win 16:30
frettled jnthn: isn't it a bitch how doing things _properly_ almost always has a performance overhead? :)
jnthn :-P
pmichaud: There may well be.
pmichaud: I guess the forwarder PMC ain't too heavy either
And if the Parrot folks ever do generational GC, then we'd not end up scanning them all for long-lived aggregates so often. 16:31
16:31 alester left
frettled On a more serious note, it could perhaps be alleviated a bit by (ab)using multithreading a bit more, but I'm not _quite_ sure how to solve that technically. 16:31
16:31 alester joined, alester left, alester joined
frettled GC in a different thread is possible, but what about the other stuff, hmm. 16:31
pmichaud I'll think about it more over lunch 16:32
I just know that having the two different types of objects feels icky, and I *know* there's a performance overhead from asking objects about their value types when copying 16:33
16:34 alester left 16:35 alester joined
jnthn pmichaud: Aye, there is. 16:36
[particle] is back. where should i start?
jnthn pmichaud: Anyway, no objections.
16:40 pmurias joined
ash_ jnthn, any other test files giving errors that you know of that should be passing? 16:40
16:41 lumi left, lumi joined
jnthn ash_: There's one test failing in S14-role/parameterized-basic.t 16:41
ash_: But I fear it may be trixky.
ash_: That one test is the only thing keeping us from a full pass though.
ash_ i can at least look at it 16:42
jnthn (in that test file)
ash_: IIRC it's to do with type parameters being used in siggies.
The answer may be that we need to clone the signature so it captures the correct type thunk closure. 16:43
That's my first guess anyway.
oh
you can clone the signature forming routine instead perhaps 16:44
16:44 mssm left
jnthn Anyway, it may be something like that. It's my first guess, and knowing if it's what the actual problem is helpful, and a patch is even better. :-) 16:44
16:44 ab5tract joined
TimToady blurs into existence, in a Schrödinger's Catly way. 16:47
ash_ changing class rooms & 16:48
16:49 ash_ left
frettled TimToady: We're grateful that you blurred _into_ existence. 16:51
16:52 uniejo joined 16:55 meneldor left 17:03 cls_bsd left
jnthn afk, krcma 17:08
17:12 ash_ joined 17:14 cognominal left 17:15 ignacio_ joined 17:19 cotto_work left, cotto_work joined
pmichaud afk, lunch 17:21
17:22 lumi left 17:25 payload left, lumi joined
pugs_svn r29571 | lwall++ | [S03,S07] bring list assignment descriptions into better alignment for pmichaud++ 17:25
ash_ ng: role F[::T] { method x(T $a) { say $a.WHAT; } }; class Foo does F[Int] { }; Foo.new.x(1); Foo.new.x('str'); 17:32
p6eval ng 57a806: Int()␤Nominal type check failed for parameter '$a'; expected { ... } but got Str instead␤current instr.: 'perl6;F[::T];x' pc 409 (EVAL_1:156)␤
Tene ng: class Foo {}; augment class Foo { method new(Int $n) { say 'lol' } }; Foo.new(5); 17:39
p6eval ng 57a806: ( no output )
Tene ng: class Foo {}; augment class Foo { multi method new(Int $n) { say 'lol' } }; Foo.new(5);
p6eval ng 57a806: ( no output )
17:39 colomon left
ash_ wow, crazy bug jnthn, look at this: 17:43
ng: role F[::T] { method x(T $a) { return 'T was ' ~ T ~ ' and ' ~ $a.WHAT; } }; class Foo does F[Int] { }; class Bar does F[Str] { }; say Foo.new.x(10); say Bar.new.x('str'); say Foo.new.x('str');
p6eval ng 57a806: T was Int() and Int()␤T was Str() and Str()␤T was Int() and Str()␤
ash_ If you use a parametric type 2 times, it changed the definition of 1 of them after you use it, like, the Bar.new.x('str') changed Foo.new from Int to Str for some reason 17:44
well, to accept Str instead of enforcing to Int only
but it only seems to do it if you use the role twice 17:45
17:45 phil joined
Tene ng: role F[::T] { method x(T $a) { return 'T was ' ~ T ~ ' and ~ $a.WHAT; } }; class Foo does F[Int] { }; say Foo.new.x('lol'); 17:47
p6eval ng 57a806: sh: ./perl6: No such file or directory␤
Tene ng: role F[::T] { method x(T $a) { return 'T was ' ~ T ~ ' and ~ $a.WHAT; } }; class Foo does F[Int] { }; say Foo.new.x('lol');
p6eval ng 57a806: sh: ./perl6: No such file or directory␤
Tene ng: role F[::T] { method x(T $a) { return 'T was ' ~ T ~ ' and ~ $a.WHAT; } }; class Foo does F[Int] { }; say Foo.new.x('lol'); 17:48
p6eval ng 57a806: sh: ./perl6: No such file or directory␤
Tene ng: role F[::T] { method x(T $a) { return 'T was ' ~ T ~ ' and ~ $a.WHAT; } }; class Foo does F[Int] { }; say Foo.new.x('lol'); 17:49
p6eval ng 57a806: sh: ./perl6: No such file or directory␤
ash_ ng: role F[::T] { method x(T $a) { return 'T was ' ~ T ~ ' and ' ~ $a.WHAT; } }; class Foo does F[Int] { }; say Foo.new.x('lol');
p6eval ng 57a806: sh: ./perl6: No such file or directory␤
Tene *sigh*
ash_ err, well Tene i think you are missing a ' after and
it runs locally if you add a ' after and
> role F[::T] { method x(T $a) { return 'T was ' ~ T ~ ' and ' ~ $a.WHAT; } }; class Foo does F[Int] { }; say Foo.new.x('lol');
Nominal type check failed for parameter '$a'; expected { ... } but got Str instead
Tene ng: role F[::T] { method x(T $a) { return 'T was ' ~ T ~ ' and ' ~ $a.WHAT; } }; class Foo does F[Int] { }; say Foo.new.x('lol'); 17:50
p6eval ng 57a806: Nominal type check failed for parameter '$a'; expected { ... } but got Str instead␤current instr.: 'perl6;F[::T];x' pc 393 (EVAL_1:152)␤
Tene ng: role F[::T] { method x(T $a) { return 'T was ' ~ T ~ ' and ' ~ $a.WHAT; } }; class Foo does F[Int] { }; say Foo.new.x(5); say Foo.new.x('lol');
p6eval ng 57a806: T was Int() and Int()␤Nominal type check failed for parameter '$a'; expected { ... } but got Str instead␤current instr.: 'perl6;F[::T];x' pc 431 (EVAL_1:158)␤
17:50 phil left
pugs_svn r29572 | lwall++ | [misc/pm.txt] some vaguely authoritative answers to recent pmichaud++ questions 17:51
17:55 sukomalo joined 17:57 sukomalo left 18:00 yahooooo left, cdarroch joined
PerlJam that error message is LTA too "expected { ... } but got Str instead" 18:03
18:03 lumi left, lumi joined, payload joined 18:06 ShaneC joined 18:07 dakkar left 18:10 ruoso left 18:14 [synth] left 18:16 rgrau` joined 18:23 ruoso joined
pmichaud goes to read spec updates (TimToady++) 18:29
From r29571: When copying into an array destination, the list assignment is 18:33
+"mostly eager"; it requests the list to evaluate its leading iterators
+(and values) to the extent that they are known to be finite, and
+then suspend, returning the known values.
This seems at odds with the "mostly eager" definition in S07: Obtain all items, but does not try to eagerly evaluate when known to
be infinite.
"known to be infinite" != "not known to be finite" 18:34
so, do we suspend when we know something to be infinite, or when we can't prove it's finite? 18:35
or, to avoid the double negatives -- do we suspend as soon as we can't determine that something is finite, or when we can positively determine that something is infinite 18:36
(to me, "mostly eager" would imply the latter -- i.e., we iterate until we know something is infinite.) 18:37
18:39 lumi_ joined, lumi left
frettled . o O (Oooh, I love semantics.) 18:40
pmichaud: perhaps we should separate between: lazy, mostly lazy, somewhat eager, mostly eager, and eager? :D 18:42
pmichaud frettled: only if assignment is in fact "somewhat eager"
frettled "somewhat eager" could be "indifferent", of course
pmichaud if assignment is "mostly eager" in the sense of "assign values until reaching a known infinite", then I don't know that we need the additional distinction 18:43
or, if "mostly eager" is in fact "obtain all items until reaching something that isn't known to be finite", then we don't need the additional distinction
frettled yep
it seems to me that there is a potential use for the distinction, that a programmer might sometimes want one behaviour over the other 18:44
pmichaud well, we have some additional operators for that :-)
frettled :)
pmichaud my question is more about "what does array assignment do" :-)
frettled I think that in most cases, we want it to be the second meaning 18:45
It ought to be more predictable as well.
pmichaud second meaning being...?
frettled "obtain all items until reaching something that isn't known to be finite" 18:46
pmichaud ah
so, in that case
my @a = $file.lines();
would not consume the entire file
because it would stop at the first sign of the iterator
18:46 jferrero joined
pmichaud (unless the iterator itself can somehow determine that the file is of finite length) 18:46
ash_ how would you eagerly load the file lines then? just curious 18:47
PerlJam ash_: my @a = eager $file.lines();
pmichaud ash_: I suspect: my @a = eager $files.lines()
frettled pmichaud: hmm, yes...
ash_ gotya
so... can a List be infinite? or are infinite containers always arrays or a special container? 18:48
pmichaud Lists can be infinite, yes.
[particle] what's @a's length after my @a = $file.lines(); ?
pmichaud ENOLENGTHINPERL6
[particle] yes, i know
but i forget the proper term
elements?
ash_ +@a
pmichaud but if you mean @a.elems, then that would cause the file to be consumed at that point
ash_ or @a.elems
[particle] perfect
18:49 cognominal joined
pmichaud which could then hang at that point if the file was in fact infinite :-) 18:49
[particle] so 'my @a = $file.lines()' is lazy
frettled heh
PerlJam [particle]: maybe
ash_ my @a = $socket.lines(); say +@a; # timeout :P
[particle] laziness is a virtue
pmichaud my @a = $files.lines() being lazy would surprise P5 programmers, yes.
frettled I like it. 18:50
pmichaud we would also end up with weird things like
PerlJam frettled: you like surprising programmers?
pmichaud my @a = ($files.lines(), $b*2)
frettled PerlJam: :)
pmichaud oh, wait
my @a = ($files.lines(), $b)
when does $b get evaluated?
[particle] i prefer that the computer procrastinates, just like i do. it's what i expect.
PerlJam [particle]++ :) 18:51
frettled heh
[particle] pmichaud: hopefully there's a way to warn about that, and suggest 'eager'
pmichaud my $b = 5; my @a = ($file.lines(), $b); $b = $b + 1; say @a[*-1]; # 5 or 6?
frettled In the case of file parsing, I think that programmers will expect there to be an easy, concise way of saying that you want to slurp it all without knowing the length in advance.
pmichaud frettled: that was .lines, iirc :-) 18:52
frettled pmichaud: yep
ash_ ng: my $a = (1, 2, 3); for @($a) { say $_; }
p6eval ng 57a806: 1 2 3␤
ash_ ng: my $a = (1, 2, 3); for @($a) { say $_.perl; }
p6eval ng 57a806: (1, 2, 3)␤
pmichaud ng: my $a = (1,2,3); for $a.list { say $_.perl; } 18:53
p6eval ng 57a806: 1␤2␤3␤
pmichaud ng: my $a = (1,2,3); say $a.WHAT; 18:54
p6eval ng 57a806: List()␤
frettled pmichaud: seriously, though, I'm of two minds; in the general case, I think it would be less surprising if we had a "somewhat eager" behaviour, but in some special cases -- such as processing input -- it's more convenient that it's different. But I don't like special cases, so, er. :)
ash_ sweet, didn't realize that worked
.list that is
pmichaud that's supposedly what @(...) does
ash_ well, then i'd call @(...) a liar :P 18:55
pmichaud although S03:2116 says otherwise :-( 18:56
18:56 rjh joined
pmichaud according to S03:2116, @(...) is the same as "list (...)" 18:56
or "list ..."
ash_ well shouldn't the list prefix cause .list? 18:57
pmichaud no
list prefix simply evaluates its arguments in list context
and $a in list context never flattens
18:57 jonasbn joined
ash_ well, i'll just have to remember to use .list on scalars sigil's then 18:58
pmichaud well, @$a should be the same as $a.list
but nyi
18:59 smash_ left
ash_ ah, whats different between @$a and @($a) then? i mean, i kinda thought list context of something would make it sorta iterate-able (is that a word?) 19:00
pmichaud @$a tells $a "return yourself as a list" 19:02
while "list $a" says "evaluate yourself in list context"
(and currently the spec indicates that @($a) is the same as "list $a"
jonasbn pmichaud: ping me when you have some time to discuss the Copenhagen hackathon
pmichaud jonasbn: will you be around tomorrow?
jonasbn yes
pmichaud that might be better for me
jonasbn super 19:03
I might have more details settled by then
pmichaud excellent
ash_: so, given my $a = [1,2,3]
(list $a).elems == 1
(@$a).elems == 3
19:04 synth joined, Chillance joined
ash_ i guess i didn't understand what list context meant 19:05
pmichaud yes, it's a difficult distinction (took me a long time to understand the difference, and even today I sometimes pick the wrong one) 19:06
19:07 vinisterx left 19:08 vinisterx joined
frettled oh! 19:09
I think I get it; in list context, you look at it as one thing, not at individual elements.
pmichaud in list context, you flatten it if it's a flattening object 19:10
and scalar variables never flatten by default
my $a = (1,2,3); say (list $a); # 1
my @b = (1,2,3); say (list @b); # 3
oops 19:11
forgot the .elems
my $a = (1,2,3); say (list $a).elems; # 1
my @b = (1,2,3); say (list @b).elems; # 3
frettled So, hmm, my @b = (1,(2,3),4); say (list @b).elems; # 4?
pmichaud sure, but @b.elems would be 4 also :-) 19:12
frettled d'oh :)
[particle] my $a = (2,3); my @b = (1,$a,4); say (list @b).elems; #3
pmichaud [particle]: correct 19:13
frettled but with my @a = (2,3); ..., it would be 4?
[particle] aye
frettled Then I think I may have understood flattening a bit.
pmichaud but in these last two cases, it's because the assignment to @b is doing the flattening 19:14
ash_ so really list and @() are for flatteningthings ?
pmichaud for flattening things that flatten in list context
frettled :)
pmichaud (I'm still not entirely certain about @() yet)
ash_ the spec says list and @() are funcitonally the same except @() takes $/ as a default parameter 19:15
PerlJam Lists and Arrays are very fundamental. It seems a shame that the semantics surrounding them haven't been nailed down so that they can be explained to a newbie
pmichaud sorry, I meant @(...) 19:16
@() means $/.list
PerlJam why have the exception though?
ash_ spec: S03 regarding list: Forces the subsequent expression to be evaluated in list context. A list of Captures will be transformed into a flat list. Equivalent to @(...) (except that empty @() means @($/), while empty list() means an empty list). 19:17
PerlJam thinks the @() exception should go away
pugs_svn r29573 | pmichaud++ | [pm.txt]: A confirmation request for TimToady++ / others. 19:18
r29573 |
r29573 | Pm-18: (Confirmation request) S03:2111 indicates that the C< @(...) >
r29573 | sigil contextualizer is the same as the C<list> listop. Is this correct?
r29573 | In particular, given C< my $a = [1,2,3]; >, then C< @($a) > is 1 and
r29573 | C< @$a > is 3 ? (For some reason I had been thinking that @($a) would
r29573 | act more like $a.list than list($a) .)
pmichaud ugh, forgot .elems or + again 19:19
afk, errand
pugs_svn r29574 | pmichaud++ | [pm.txt]: Typo correction in question. 19:20
ash_ coming from a complete newb in this respect. list context, in plain english, makes me think it takes the object and converts it to a list, so i was expecting @($a) to do something like wrapper the .List function or .list, in short, i expected, saying $a = 1, 2, 3; for @($a) { say $_ } to iterate through 1, 2, 3 19:21
frettled When I read "list context", I understand it as "treat the thing as if it was a list". I don't expect conversion until I assign it. 19:23
That is, if I have an RHS (right hand side) of an expression that's in list context, I ought to use a list thingy on the LHS. 19:24
and vice versa, of course
ash_ well, if list context returned the object it was given in list form, then when you use it in a for loop, i thought it would iterate the list form, again, i think i am misunderstanding list context though 19:25
PerlJam ash_: I don't think so. 19:28
19:28 k23z__ left
ash_ rakudo: my $a = 1, 2, 3; for @($a) { say $_ } 19:33
p6eval rakudo 1d4928: 1␤2␤3␤
ash_ ng: my $a = 1, 2, 3; for @($a) { say $_ }
p6eval ng 57a806: 1 2 3␤
ash_ also contributed to my view of @()
pmichaud rakudo has it wrong (per the spec) there. 19:35
ash_: perhaps it makes more sense to think of @(...) in the sense of @($a, 3)
i.e., we expect @($a, 3) to have two elements, even if $a is itself a list
19:36 Chimo joined
ash_ ng: my $a = 1, 2; for @($a, 3) { say $_.perl } 19:36
p6eval ng 57a806: (1, 2)␤3␤
ash_ so, like that, right?
pmichaud according to the current spec, yes. 19:37
ash_ yeah, i see that now, that makes sense
pmichaud I'd prefer that we wait for confirmation of the meaning of @(...) and stick to @$a, list($a), and/or $a.list
frettled :)
pmichaud in the case of something like for @($a) { say $_.perl } the @(...) is redundant 19:38
(per the current spec)
frettled aha
ash_ well, list(List.new(1, 2, 3)) is wrong then, so you know
frettled Would this make any sense:
ash_ ng: for list(List.new(1, 2, 3)) { say $_.perl }
p6eval ng 57a806: (1, 2, 3)␤
frettled $a = (1, 2); $b = (4, 5); for @($a, 3, $b) { say $_.perl } 19:39
pmichaud you're correct, list() has that wrong.
ash_ my fault on that one then 19:40
19:40 Chimo left
ash_ err, wait, i didn't write list, never mind, woot, not my fault :P i only did List.new 19:42
which was also wrong :-\
19:44 astinus left, scion joined, scion is now known as astinus 19:45 stephenlb joined
ash_ do any of the loop constructs have a specific method they use? like 'for' for instance? 19:46
pmichaud 'for' is really 'map' 19:47
for ... { block } is really the same as list(...).map({block})
(it's not that way yet in rakudo/ng, but it will be.)
ash_ so, if you had an object that implemented a .map function, and you did for $my_obj { } it would reference the .map? 19:48
pmichaud no
because it does the .map on list($my_obj)
i.e., $my_obj is first evaluated in list context 19:49
which will create a list containing $my_obj
ash_ so... making your own iterator using gather is probably the 'right way' of doing something like that then? (ie: $my_obj.each({ }); 19:50
where each is using a gather construct or something
pmichaud well, you can still create your own .map -- it just isn't used by default with "for"
or you can define how $my_obj.list() works 19:52
(i.e., it can return an iterator that 'for' then uses)
ash_ then you'd call it like: for $m_obj.list() { }
or @$ i suppose 19:53
pmichaud yes, or for @$m_obj { ... }
exactly
Tene or: for $obj.magic_iter_lol() { ... }
ash_ hm, is there something that functions like the with operator in python? just curious 19:54
pmichaud given?
given $expr { ... }
oh, that's a bit different 19:55
ash_ but, you can override a function callback, is what i mean, so if you have a thread condition for instance, and you use with my_obj: it aquires the lock, then releases it at the end of the block
or any of the other various uses of with
dalek kudo/ng: 839da4d | pmichaud++ | src/builtins/List.pir:
Make sure that list() returns a List that is fully initialized and
19:56
pmichaud I don't know if there's any exact analogue in Perl 6. 19:57
19:57 lumi_ left
ash_ it wouldn't be hard to make something like that if i wanted to use one in my own code, i was just wondering if there was something along those lines built in 19:57
19:57 lumi joined
Tene ash_: can you post an example? 19:59
ash_ of? 20:00
Tene I'm not familiar with python's 'with'
ash_ sure, one sec 20:02
20:02 athaba joined
ash_ well, docs.activestate.com/activepython/3...w/2.6.html has some good examples see the section titled: PEP 343: The ‘with’ statement 20:02
they use it with a file at one point, with open('/etc/passwd', 'r') as f: it automatically opens and closes the file when it first enters and later exits the with block, or the lock example acquires and releases the conditional 20:03
its really just sugar 20:04
but sometimes that means i get to write 2 less lines of code here or there
another nice use of it i have seen is in a ORM the use it for transactions, so it starts the transaction when you enter the with statement, and applies it if you make it to the end of the statement 20:08
20:08 athaba left
pugs_svn r29575 | pmichaud++ | [pm.txt] Followup question to Pm-16 answer (see diff for details). 20:12
pmichaud given $f = open('/etc/passwd') { LEAVE { $f.close }; ... } 20:13
or, even
given open('/etc/passwd') { ...; LEAVE { .close } } 20:14
and the opened file is in $_
ash_ yeah, like i said, i can do the same thing or, extend the grammar if need be, i was more just curious since i haven't come across something that behaves like that
pmichaud if open('/etc/passwd') -> $f { ...; LEAVE { .close } } 20:15
er
if open('/etc/passwd') -> $f { ...; LEAVE { $f.close } }
and the else clause handles the case of the file not opening successfully :-)
20:15 ab5tract left
pmichaud given open('/etc/passwd') { for .lines { .... }; LEAVE { .close } } 20:16
20:17 lisppaste3 left
pmichaud given open('/etc/passwd') || die "open fail" { for .lines { .... }; LEAVE { .close } } 20:17
something like those :-) 20:18
20:18 Guest97031 left
ash_ see the only difference from that and python's with is any object can register a callback function for when you use it (its __enter__ and __exit__ ) 20:18
jnthn ash_: Yes, the "crazy bug" that we're hunting is exactly that. :-)
ash_: It's not so crazy - we just use closure semantics to make it work.
ash_: But we're missing some cloning to keep the right static chain attached somewhere. 20:19
ash_ jnthn i think its in role compose or classhow compose btw
jnthn ash_: Doubt it.
20:19 ShaneC left
jnthn ash_: Or at least, you maybe could fix it there, but it'd be the wrong place. 20:19
pmichaud ng: for list(List.new(1,2,3)) { say $_.perl }
p6eval ng 57a806: sh: ./perl6: No such file or directory␤
jnthn ash_: We call .clone on the Method objects which should be enough... 20:20
but apparently it's not
pmichaud ng: for list(List.new(1,2,3)) { say $_.perl }
p6eval ng 839da4: 1␤2␤3␤
pmichaud \o/
jnthn pmichaud: Yay!
20:20 jan_ joined
pmichaud that might also have been the bug that was plaguing me last night/earlier today with list assignment 20:21
I'll have to go back and try again
ash_ jnthn, what about in !select in the role then? 20:22
thats when it applies the Int in Foo[Int]
well, it does postcircumfix:<[ ]> which calls self.!select
20:24 lisppaste3 joined
jnthn ash_: Right, but the .clone is emitted in src/Perl6/Compiler/Role.pm 20:25
ash_: The select is what gets us to the role body.
ash_: Note that we end up running the body of a role Foo[::T] { } once for each type parameterization that is used.
ash_ is there a reason the --target=pir would have a sub with 2 :anon's? its apparently not an error, just seems odd 20:27
pmichaud it may be that rakudo is adding an :anon flag, and then PAST is adding another 20:29
jnthn Does seem odd. 20:30
jnthn gotta go again now - back later
pmichaud afk, errand 20:31
ash_ perl6 --target=pir -e "role Foo { }" then find the definition of Foo[] it consistantly has 2 :anon, not a bug just an oddity
20:43 colomon joined 20:49 synth left 20:51 mikehh_ left 20:52 mikehh_ joined 20:56 bluescreen left 20:57 _jaldhar left 21:00 lisppaste3 left 21:02 vinisterx left, lumi left 21:03 lumi joined, mikehh_ left 21:04 mikehh_ joined, mssm joined 21:05 uniejo left 21:08 mikehh_ left, mikehh_ joined 21:09 bluescreen joined, perlbotz joined, jonasbn left, perlbotz left 21:11 cognominal left 21:17 mikehh_ left 21:18 mikehh_ joined 21:20 mssm left 21:24 cotto left 21:25 k23z__ joined 21:33 patspam joined 21:34 ash_ left 21:35 pmurias left 21:37 cotto joined, mikehh_ left 21:40 lumi left, lumi joined 21:45 bluescreen left 21:46 ruoso left 21:52 ignacio_ left, SmokeMachine left 21:54 ash_ joined 21:55 clintongormley left 22:00 lumi left, lumi joined 22:01 yahooooo joined 22:08 Su-Shee left 22:15 perlpilot joined 22:16 perlpilot left 22:17 KyleHa left 22:22 lisppaste3 joined 22:28 lumi left, lumi joined, patspam1 joined, patspam left 22:33 mariano joined 22:36 iblechbot left 22:38 patspam joined 22:39 patspam1 left 22:55 synth joined 22:57 cognominal joined 23:00 lumi left, lumi joined 23:03 Chillance left 23:05 mssm joined 23:06 mariano left 23:19 jferrero left 23:20 payload left 23:28 payload joined 23:29 stephenlb left 23:32 stephenlb joined 23:35 lumi left, lumi joined 23:37 idemal left
dalek kudo/ng: c36717d | pmichaud++ | src/builtins/Array.pir:
Fix circumfix:<[ ]> to properly copy (STORE) values in an Array,
23:40
kudo/ng: 47ef21b | pmichaud++ | src/builtins/ (3 files):
Adjust List!generate to always (lazily) flatten RPAs and Parcels

them. This fixes empty [] to create an empty Array, as well as reduce the number of places that we need to set the 'flatten' flag.
kudo/ng: 89fb627 | pmichaud++ | src/builtins/ (2 files):
Enable basic list assignment. Doesn't seem to work yet with
pmichaud jnthn: we seem to be FAIL on list declarations... any clues? 23:44
ng: my ($a, $b);
p6eval ng 839da4: Redeclaration of symbol $a at line 1, near ";"␤current instr.: 'perl6;HLL;Grammar;panic' pc 500 (src/stage0/HLL-s0.pir:328)␤
pmichaud I may be able to take a look at it a bit later.
Tene pmichaud: Out of curiosity, what was the main desire for tt389 (keep methods out of namespaces)? 23:45
I've got it down to 3 test failures. 23:46
The p6object one is awkward to debug, though. :( 23:47
23:51 stephenlb left 23:52 stephenlb joined 23:57 lumi left, lumi joined