Perl 6 - the future is here, just unevenly distributed

IRC log for #perl6, 2010-01-21

Perl 6 | Reference Documentation | Rakudo

| Channels | #perl6 index | Today | | Search | Google Search | Plain-Text | summary

All times shown according to UTC.

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

| Channels | #perl6 index | Today | | Search | Google Search | Plain-Text | summary

Perl 6 | Reference Documentation | Rakudo