Perl 6 - the future is here, just unevenly distributed

IRC log for #perl6, 2010-06-28

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:11 hercynium joined #perl6
00:17 yinyin joined #perl6
00:29 songmaster joined #perl6
00:41 masonkramer joined #perl6
01:09 patspam joined #perl6
01:14 [Coke] joined #perl6
01:32 sorear Has anyone tried to translate the YamlReference grammar to Perl 6?
01:39 PZt joined #perl6
01:44 sorear TimToady: Does a method call always have to account for the possibility that said method will be overriden with a version that has "is rw" arguments?
01:45 sorear ie class Foo { method bar(int $x) { ... }; }; sub sam(Foo $a) { ...; $a.bar($y); ... }; ...; ...; ...; eval 'class Foo2 is Foo { method bar(int $x is rw) { ... }; }'
01:59 bgoggin joined #perl6
01:59 hmmm joined #perl6
02:09 agentzh joined #perl6
02:22 hmmm About Perls 6, and the choice between loading Parrot or Haskell to try it, what's advised foe Win32?
02:22 hmmm foe==for, typo...
02:23 [Coke] rakudo works fine on win32.
02:23 [Coke] SFAIK.
02:23 hmmm no Parrot for Rakudo on Win32?
02:24 hmmm maybe no haskell needed for PUGS also on Win32?
02:25 hmmm Though i do like Haskell, and mayy load it anyways...
02:29 masonkramer joined #perl6
02:30 lkk- joined #perl6
02:31 [Coke] yes, parrot builds on win32.
02:32 [Coke] if you don't have a compiler, you can just grab strawberry perl.
02:32 [Coke] I have no idea what the current state of pugs is.
02:36 ash_ joined #perl6
02:57 alester joined #perl6
02:58 justatheory joined #perl6
03:04 dalek rakudo: 9993ee9 | pmichaud++ | src/builtins/Parcel.pir:
03:04 dalek rakudo: Refactor Parcel assignment to be lazier, use &infix:<=>.  Fixes RT #75950.
03:04 dalek rakudo: review: http://github.com/rakudo/rakudo/commit/9993ee94f21def7ddc198602b43202c494185b61
03:05 tylercurtis joined #perl6
03:09 rcsheets joined #perl6
03:09 tylercurtis Is there anything in Perl 6 like the "[1]" in APL's "+/[1]m"(i.e., something that modifies operators/functions on arrays by causing them to operate on a different axis of a multi-dimensional array than they normally would, in this case, on the first axis(columns, if it's a matrix))?
03:09 [particle] not in the spec, you'd have to build that
03:09 jaldhar joined #perl6
03:11 tylercurtis I didn't expect there would be. Thanks.
03:12 [particle] p6 stole some things from apl, but not that one
03:20 hmmm I see, parrotWin32+Rakudo is the needed combo for Perls6 on Win32.
03:20 lkk- joined #perl6
03:21 hmmm PUGS looks like a version in December... interesting.
03:21 hmmm L8R, thxs!
03:30 Bigshot joined #perl6
03:35 ash_ tylercurtis: how does that [1]m work in your example from APL?
03:35 pmichaud sub abc(@pos) { say @pos.elems };   abc([1, 2, 3]);   # valid, outputs 3?
03:36 pmichaud that should probably say "valid?"
03:37 TiMBuS joined #perl6
03:37 ash_ 3 looks right to me...
03:38 ash_ rakudo: sub abc(@pos) { say @pos.elems };  abc([1, 2, 3]); # what does rakudo say?
03:38 p6eval rakudo d16a2f: OUTPUT«3␤»
03:40 pmichaud sub abc(@pos) { say @pos.elems };  'a' ~~ /./;  abc($/);  # valid?  outputs 0?
03:41 ash_ $/ has no captures in the current regex, so... sure...
03:42 tylercurtis ash_: normally, "+/m" would sum the last axis(rows) of the matrix, so, if m were "1 2 3\n4 5 6", it would be "5 7 9"(I think, I don't have an actual APL interpreter on hand), but "+/[1]m" would sum the first axis(columns) of the matrix, so, given the same value for m, it would be "6 15"(or maybe "6\n15", again, no APL implementation on hand). I think.
03:52 ash_ so your selecting the first column of the matrix, (say ((1, 2, 3), (4, 5, 6), (7, 8, 9))) and you want to add the first column?
03:53 lue pmichaud: how's variable refactor going? I noticed the commit earlier.
03:56 pmichaud lue: it's going a bit slower than I'd like.... there's lots of pieces that have to be fixed.
03:56 pmichaud lue: but each piece I fix seems to close another ticket or two :)
03:56 lue it's sounds like something I would be interested in. Something about modifying a fundamental part of the interpreter I guess. :)
03:56 lue rakudo: say ((1, 2, 3), (4, 5, 6), (7, 8, 9)).perl
03:57 p6eval rakudo d16a2f: OUTPUT«((1, 2, 3), (4, 5, 6), (7, 8, 9))␤»
03:57 lue (hrm, I could swear () flattened...)
03:57 pmichaud it does flatten in item context
03:58 pmichaud rakudo:  say ((1, 2, 3), (4, 5, 6), (7, 8, 9)).item.perl
03:58 p6eval rakudo d16a2f: OUTPUT«(1, 2, 3, 4, 5, 6, 7, 8, 9)␤»
03:58 ash_ wouldn't @m[0;*] give you a slice with the first column (assuming my @m[3;3])
03:59 lue Ah well. For safety, I'll always use []
03:59 lue rakudo: my @a = [ [1,2,3], [4,5,6], [7,8,9] ]; say @a[0;*].perl
03:59 p6eval rakudo d16a2f: OUTPUT«Method 'Num' not found for invocant of class 'Block'␤  in 'infix:<<>' at line 283:CORE.setting␤  in 'infix:<<>' at line 555:CORE.setting␤  in 'postcircumfix:<[ ]>' at line 1083:CORE.setting␤  in main program body at line 1␤»
03:59 ash_ master doesn't do multi-dimensional arrays currently
04:00 ash_ i forget if alpha did or not...
04:00 ash_ pugs: my @a[3;3];
04:00 p6eval pugs: OUTPUT«*** ␤    Unexpected ";"␤    expecting "_", fraction, exponent, term postfix, operator or "]"␤    at /tmp/SbgnSqgOkL line 1, column 8␤»
04:00 ash_ alpha: my @a[3;3];
04:00 p6eval alpha 30e0ed: OUTPUT«Confused at line 10, near "[3;3];"␤in Main (file <unknown>, line <unknown>)␤»
04:00 ash_ std: my @a[3;3];
04:00 p6eval std 31481: OUTPUT«ok 00:01 109m␤»
04:01 ash_ yeah, i think thats just not yet implemented
04:01 pmichaud rakudo has never done multdim arrays
04:01 tylercurtis ash_: What "+/[1]m" does is add all of the columns together.  with ((1,2,3), (4,5,6), (7,8,9)), the result should be (1+4+7, 2+5+8, 3+6+9).
04:01 ash_ oh, like that, got ya
04:01 lue .oO(Then I guess matrix multiplication is out of the question)
04:02 ash_ @m.grep: { [+] @_ }; #?
04:03 ash_ me shrug just thinking
04:03 * ash_ shrug*
04:03 ash_ does grep flatten?
04:06 tylercurtis rakudo: my @m = [1,2,3], [4,5,6], [7,8,9]; @m.map([+] *).perl.say
04:06 p6eval rakudo d16a2f: OUTPUT«(6, 15, 24)␤»
04:07 ash_ there ya go, thats not to bad
04:09 pmichaud rakudo:  say (1,2,3) Z (4,5,6) Z (7,8,9);
04:09 p6eval rakudo d16a2f: OUTPUT«No applicable candidates found to dispatch to for 'infix:<Z>'. Available candidates are:␤:()␤:(Any $lhs, Any $rhs)␤␤  in main program body at line 11:/tmp/eSDz5bCi4S␤»
04:09 pmichaud urgh.
04:10 pmichaud rakudo:  say (1,2,3) Z (4,5,6);
04:10 p6eval rakudo d16a2f: OUTPUT«142536␤»
04:12 * lue gets the crazy idea that Z is supposed to chain
04:12 pmichaud it's supposed to be list associative, iirc
04:13 pmichaud we probably need variadic slice context
04:15 pmichaud rakudo:  say ((1,2,3) Z (4,5,6)).perl;
04:15 p6eval rakudo d16a2f: OUTPUT«(1, 4, 2, 5, 3, 6)␤»
04:15 pmichaud that's wrong also, I think.
04:15 pmichaud should be parcels
04:17 ciphertext pmichaud: see http://rt.perl.org/rt3/Ticket/Display.html?id=75818
04:18 pmichaud fixing the two-arg form is pretty easy.
04:18 pmichaud I'm wondering if I can do the three-arg form.
04:18 pmichaud (er, n-arg form)
04:29 eternaleye joined #perl6
04:39 tylercurtis rakudo: ([>>+<<] ([1, 2, 3], [4, 5, 6])).perl.say
04:39 p6eval rakudo d16a2f: OUTPUT«[[5, 7, 9]]␤»
04:39 tylercurtis rakudo: ([>>+<<] ([1, 2, 3], [4, 5, 6], [7, 8, 9])).perl.say
04:39 p6eval rakudo d16a2f: OUTPUT«Sorry, sides are of uneven length and not dwimmy.␤  in 'hyper' at line 113:CORE.setting␤  in 'hyper' at line 136:CORE.setting␤  in 'reducewith' at line 1␤  in main program body at line 1␤»
04:42 tylercurtis rakudo: ([>>+<<] \[1,2, 3], \[4, 5, 6], \[7, 8, 9]).perl.say
04:42 p6eval rakudo d16a2f: OUTPUT«[[[12, 15, 18]]]␤»
04:43 tylercurtis rakudo: my @m = [1,2,3], [4,5,6], [7,8,9]; ([>>+<<] @m).perl.say
04:43 p6eval rakudo d16a2f: OUTPUT«Sorry, sides are of uneven length and not dwimmy.␤  in 'hyper' at line 113:CORE.setting␤  in 'hyper' at line 136:CORE.setting␤  in 'reducewith' at line 1␤  in main program body at line 1␤»
04:43 mberends [>>+<<], now that's a good looking operator (maybe there's a single Unicode character for that ;)
04:48 songmaster rakudo: say [+] 1, 2, 3
04:48 p6eval rakudo 9993ee: OUTPUT«6␤»
04:49 songmaster Strange, my perl6 installation responds with "Could not find sub &prefix:<[+]>"
04:50 ciphertext songmaster: i'm getting that too: it seems to be a new REPL bug
04:51 mberends commute -> $work
04:51 songmaster ciphertext: Thanks, I though I was going crazy...
04:51 tylercurtis songmaster, ciphertext: I've gotten that sometimes, too. It usually stops happening if I close my REPL and start it again, though.
04:51 * tylercurtis has no idea why...
04:51 * ciphertext trying that
04:52 ciphertext > [+] 1,2,3;
04:52 ciphertext 6
04:52 ciphertext o.O
04:52 ciphertext weird
04:52 songmaster Ditto; strange.
04:53 ciphertext although, i actually tried that once earlier, and it didn't work that time...
04:55 ingy pmichaud: when you terminate a ec2 running instance, does it blow away all your work?
04:56 pmichaud ingy: yes.  There's a way to use a different storage type to keep your work, I think  (i.e., mounted volumes)
04:56 pmichaud ingy: I haven't tried it yet.
04:57 ingy pmichaud: so I can't turn this thing off without nuking my whole setup, eh?
04:58 pmichaud http://uec-images.ubuntu.com/releases/10.04/release/  has a list of available ubuntu images -- I think the ones that say 'ebs' have some sort of persistant storage available.
04:58 synth joined #perl6
04:58 songmaster rakudo: say [||] 0,0; say [||] 0,1; say [||] 1,0; say [||] 1,1
04:58 p6eval rakudo 9993ee: OUTPUT«0␤1␤1␤1␤»
04:58 Mowah joined #perl6
04:59 songmaster rakudo: say [&&] 0,0; say [&&] 0,1; say [&&] 1,0; say [&&] 1,1
04:59 p6eval rakudo 9993ee: OUTPUT«===SORRY!===␤Could not find sub &infix:<&&>␤»
04:59 hejki rakudo: say 0 && 0
04:59 p6eval rakudo 9993ee: OUTPUT«0␤»
04:59 songmaster Bingo!  I have not managed to get [&&] to work yet.
05:00 hejki rakudo: say [+] 5,1,3
05:00 p6eval rakudo 9993ee: OUTPUT«9␤»
05:02 tylercurtis songmaster: That's because infix:&& and infix:and aren't actually defined. &&, ||, and, and or are implemented specially in the grammar. I'm about to submit a patch on RT to define sub forms of && and and, though.
05:03 songmaster tylercurtis: Thanks, I'll do a work-around then.
05:05 ciphertext tylercurtis: looks like someone beat you to it: http://rt.perl.org/rt3/Ticket/Display.html?id=76206
05:08 tylercurtis ciphertext: yay! I don't have to learn to use RT yet.
05:10 synth joined #perl6
05:19 hejki rakudo: say [and] 0,1
05:19 p6eval rakudo 9993ee: OUTPUT«===SORRY!===␤Could not find sub &infix:<and>␤»
05:20 hejki ahh.. what tylercurtis said about those :P
05:22 jhuni joined #perl6
05:29 dalek rakudo: aea3bbc | pmichaud++ | src/Perl6/ (2 files):
05:29 dalek rakudo: Add statement_mod_cond:sym<when>.  Resolves RT #75916.
05:29 dalek rakudo: review: http://github.com/rakudo/rakudo/commit/aea3bbcf9886acf4c8ba9fb233c908c27200bc88
05:33 kaare joined #perl6
05:46 synth joined #perl6
05:59 tylercurtis Is "[@a, @b]" the idiomatic way to concatenate two arrays together in Perl 6?
06:08 pmichaud tylercurtis: (@a, @b)
06:08 pmichaud tylercurtis: [@a, @b] also works if you want an array instead of a list.  But most people would consider (@a, @b) to be a bi tmore canonical, I think.
06:09 tylercurtis rakudo: my @a = 1, 2, 3; my @b = 4, 5, 6; (@a, @b).perl.say
06:09 p6eval rakudo 9993ee: OUTPUT«([1, 2, 3], [4, 5, 6])␤»
06:10 xinming joined #perl6
06:12 tylercurtis pmichaud: (@a, @b) appears to produce a nested list, at least in Rakudo. Should it not do that? Or is there something I'm failing to understand(most likely option)?
06:17 synth joined #perl6
06:20 pmichaud it's not a nested list
06:20 pmichaud it only looks that way because of the way that .perl works (which I disagree with atm)
06:21 pmichaud rakudo:  my @a = 1, 2, 3;  my @b = 4, 5, 6;  my @c = (@a, @b);  say @c.perl;
06:21 p6eval rakudo 9993ee: OUTPUT«[1, 2, 3, 4, 5, 6]␤»
06:21 pmichaud currently .perl forces arrays to be display with [ ]
06:21 pmichaud *displayed
06:21 pmichaud note the difference:
06:22 pmichaud my @a = 1, 2, 3;  my @b = 4, 5, 6;  my @c = (@a, b);  my @d = [@a, @b];  say @c.elems;  say @d.elems;
06:22 pmichaud rakudo: my @a = 1, 2, 3;  my @b = 4, 5, 6;  my @c = (@a, b);  my @d = [@a, @b];  say @c.elems;  say @d.elems;
06:22 p6eval rakudo 9993ee: OUTPUT«Could not find sub &b␤  in main program body at line 11:/tmp/z7SGd8jhbx␤»
06:22 pmichaud rakudo: my @a = 1, 2, 3;  my @b = 4, 5, 6;  my @c = (@a, @b);  my @d = [@a, @b];  say @c.elems;  say @d.elems;
06:22 p6eval rakudo 9993ee: OUTPUT«6␤1␤»
06:22 pmichaud there.
06:26 dalek rakudo: 05684c0 | pmichaud++ | src/Perl6/Actions.pm:
06:26 dalek rakudo: Change handling of return value in empty statementlist.  Partially resolves RT
06:26 dalek rakudo: #75700.
06:26 dalek rakudo: review: http://github.com/rakudo/rakudo/commit/05684c07ed4fbb9a44be98d213b06e0d92a41186
06:31 xinming joined #perl6
06:34 foodoo joined #perl6
06:41 synth joined #perl6
06:50 synth joined #perl6
06:50 pmichaud joined #perl6
06:55 synth_ joined #perl6
06:58 colomon joined #perl6
06:58 eiro joined #perl6
06:58 thepler joined #perl6
06:58 tomaw joined #perl6
06:58 Gothmog_ joined #perl6
06:58 opx^away joined #perl6
06:59 synth joined #perl6
07:05 cosimo_ how do I convert a Match object to a Str ?
07:08 moritz_ ~$/
07:08 moritz_ or $/.Str
07:09 hejki Match() has method .Str now?
07:09 moritz_ rakudo: say ('abc' ~~ /../).Str
07:09 p6eval rakudo 05684c: OUTPUT«ab␤»
07:09 hejki nice
07:09 cosimo_ $0.Str worked, thanks
07:09 moritz_ hejki: pmichaud and I fixed Match objects for the last release
07:09 cosimo_ it's fantastic! LWP::Simple now uses MIME::Base64 for HTTP basic auth support
07:09 hejki last time i updated my anydice.pl Match() didn't have that method :>
07:09 hejki moritz_: ahh nice :)
07:10 Helios joined #perl6
07:10 cosimo_ \o/
07:11 moritz_ \o/
07:11 moritz_ cosimo_++ # LWP::Simple, and blogging about it
07:15 cosimo_ now I need chunked transfers support, and it'll be even usable
07:26 Su-Shee joined #perl6
07:28 synth joined #perl6
07:53 eternaleye joined #perl6
08:03 Ross joined #perl6
08:03 sorear phenny: tell hmmm pugs has been effectively dead for >1 year.  There are more recent releases, but only to track incompatible changes in GHC Haskell
08:03 phenny sorear: I'll pass that on when hmmm is around.
08:30 felipe joined #perl6
08:31 clintongormley joined #perl6
08:40 dakkar joined #perl6
08:44 eternaleye joined #perl6
08:49 thebird joined #perl6
08:52 _sri trading my firstborn for non blocking sockets!
08:58 imarcusthis what if it's a girl?
08:59 _sri hmm
09:00 _sri then i have to raise the offer by a cow or so?
09:01 moritz_ copy on write FTW!
09:09 cosimo_ moritz_: is proto.perl6.org updated regularly from proto's master tree?
09:09 moritz_ cosimo_: yes
09:09 cosimo_ made a change there, hope it's useful
09:09 sorear _sri: as it happens, I adopted blizkost specifically to be able to use non blocking sockets from Rakudo, and succeeded.
09:11 proller joined #perl6
09:11 moritz_ cosimo_: I've now triggered an update there manually
09:12 moritz_ cosimo_++ # nice update. It bothered me too at one point, but not enoough to fix it :-)
09:16 cosimo_ moritz_: what about ufo's make install ?
09:17 cosimo_ that's next in my list
09:17 cosimo_ is that done already?
09:17 moritz_ cosimo_: ufo && make install should work
09:17 moritz_ cosimo_: with a sufficiently recent ufo
09:17 cosimo_ i need to update ufo then
09:17 cosimo_ yes :)
09:17 moritz_ http://github.com/masak/ufo/commit/293547cda26ee513a4afc863632139a97dc0111f
09:17 moritz_ http://github.com/masak/ufo/commit/f5ddb074ee8dcf3388b8f41aefd563331d70593a
09:18 arnsholt I like yapsi's icon ^^
09:24 cognominal pmichaud++ # fixing bugs
09:25 cosimo_ moritz_: mmh, do i need 'make install-src'?
09:29 kaare_ Anyone with some parrot-fu who can decipher this parrot/t/library/pg.t into something rakudo?
09:29 azert0x joined #perl6
09:29 kaare_ The central section seems to be load_bytecode 'postgres.pir'  + load_bytecode 'Pg.pir' and then by Parrot magic there is a cl = new 'Pg'
09:30 kaare_ I know there is a load_bytecode in rakudo. But does that help me?
09:31 arnsholt You can call parrot opcodes from Perl 6 in rakudo with pir::opcode
09:32 kaare_ Please pretend I know nothing about Parrot ;-)
09:32 arnsholt For example, you could do pir::load_bytecode("postgres.pir")
09:33 kaare_ OK, so far so good. How do I create a new Pg object?
09:34 kaare_ afaics that is what's going on in the parrot test file with  cl = new 'Pg'
09:35 kaare_ pir::new('Pg') ?
09:41 kaare_ ... nope
09:53 pragma_ joined #perl6
09:54 Guest48110 joined #perl6
09:54 sorear cognominal: I just got what appears to be a reply to a bug report autopost in my inbox
09:54 sorear cognominal: did you mean to send it as an actual bug report addition?
09:55 sorear #76068
09:57 masak joined #perl6
09:57 masak oh hai, #perl6!
09:58 sorear hello masak!
09:59 gbacon joined #perl6
10:01 arnsholt kaare_: You might have to specify the signature of the opcode (there can be several variants)
10:01 cygx joined #perl6
10:01 arnsholt Try pir::new__ps
10:05 masak wow, I noticed from the commit log that pmichaud++ was active yesterday. now I see it in the RT messages! :)
10:05 cygx joined #perl6
10:05 jnthn oh hai #perl6
10:05 * jnthn back from his ickle trip
10:06 masak what's an ickle?
10:06 masak welcome back, jnthn!
10:06 cygx hi
10:06 jnthn masak: slang for "little" :-)
10:06 masak ah. figures :)
10:06 masak sounds like something a mother would say to a toddler :)
10:06 * sorear wonders what to make of the trend where people use their native writing systems for From: on English mailing lists
10:07 jnthn Yes, well, I did visit my mum. :-)
10:07 sorear on the one hand, Unicode FTW
10:07 * jnthn managed to be in six different countries in the last 5 days
10:07 sorear on the other hand, it's hard to keep characters straight when they are all identified as <hanzi><hanzi><hanzi>
10:07 arnsholt sorear: OTOH, "what are these people called?"
10:08 masak sorear: maybe those foreigners will finally learn to read hanzi. :P
10:09 arnsholt But there are so many of them! =)
10:10 masak arnsholt++ # ambiguity
10:10 mberends joined #perl6
10:10 arnsholt Oh, heh. Pun not intended, actually ^^
10:10 sorear Right.  Yes.  Hanzi.  And Cyrillic.  And Icelandic.  And Greek.  And Arabic.  And ...
10:10 masak lolitsmberends!
10:11 moritz_ oh hai
10:11 mberends oh hai from $work in .nl!
10:11 jnthn Wow, pmichaud++ had quite a commitfest yesterday!
10:12 jnthn hi mberends :-)
10:12 masak sorear: I think it's a positive trend. even when you transcribe Chinese names, it requires effort to tell them apart. so the latin alphabet doesn't fully solve the problem either.
10:12 masak jnthn: yes! whatever he ingested, we need to send him more of that. :P
10:12 jnthn .oO( pivo )
10:13 jnthn More likely a few gallons of Dr Pepper. :-)
10:13 moritz_ masak: sub pmichaud(@tuits --> Code) { $magic } :-)
10:13 arnsholt sorear: Icelandic is ok. Just ð and þ
10:13 masak :)
10:13 masak make $magic # :)
10:13 arnsholt Arabic and Hanzi is probably the hardest for me
10:15 masak arnsholt: I'd like to learn http://en.wikipedia.org/wiki/Devanagari
10:15 sorear arnsholt: icelandic orthography is so different from english orthography that the similarity of the underlying character sets is lost to me
10:15 sorear I mean, sure, I can read it
10:16 sorear but it has no mnemonic value
10:16 masak this symbol frightens and fascinates me: http://en.wikipedia.org/wiki/File:JanaSanskritSans_ddhrya.svg
10:16 sorear (to this native english speaker, &c)
10:16 sftp joined #perl6
10:16 arnsholt Oh, right. The names are so similar to Norwegian I don't have that problem
10:16 masak talk about a ligature!
10:16 arnsholt Yeah, but that's an intentionally perverted example
10:17 sorear NFG is fun stuff
10:17 arnsholt Devanagari is pretty straightforward. And the ligatures aren't really used in Hindi
10:17 arnsholt It's only in Sanskrit ligatures are mandatory
10:17 masak oh!
10:18 arnsholt Of course, Sanskrit is an awesome language. But I would say that, I suppose =)
10:18 masak while we're on the topic of complex scripts... http://en.wikipedia.org/wiki/File:Bi%C3%A1ng_(regular_script).svg
10:18 masak I believe that character has been discussed here before.
10:18 sorear 2010.06.22.17.37.44 <@darbelo> P<LATIN CAPITAL LETTER O WITH FIVE UMLAUTS AND A HAT>ST
10:19 masak at least I recall TimToady dissecting it.
10:19 sorear I wonder if I should submit that to ParrotQuotes
10:19 masak sorear: please do!
10:19 moritz_ please do :-)
10:19 arnsholt Whoa. Not that's complicated =)
10:19 sorear well, it was a conversation that involved me
10:20 moritz_ so what?
10:21 sorear so I might not be authorized?
10:21 moritz_ you are.
10:21 masak it's not Wikipedia :)
10:22 mmcleric joined #perl6
10:23 bbkr can I achieve in pure P6 something that P5 Moose offers: "has 'x' => ('lazy' => 1, 'default' => \&some_sub_that_sets_x )" ?
10:23 sorear no.
10:23 sorear you probably will be, eventually
10:23 masak why does all of JimmyZ's bug reports involve augmenting Str and then looping on a range of strings with numbers in them? :)
10:23 sorear but Moose is (understandably) a lot more mature on the finer points of classes
10:23 masak s/does/do/
10:24 bbkr sorear: thanks
10:24 masak I believe http://rt.perl.org/rt3/Public/Bug/Display.html?id=76202 is invalid. am I right?
10:24 sorear in current Perl 6, the standard way to do that is to tie $x to a cusrom container that lazily self-initializes
10:24 moritz_ bbkr: it will be a simple matter of has $.x = lazy { foo() };
10:24 liuchong joined #perl6
10:24 * sorear wonders how to make that work with clearers
10:25 sorear and predicates.  especially and predicates.
10:25 bbkr moritz_: awesome syntax :)
10:26 sorear The circularity saw strikes again.  I need to allow non-containerized returns from FETCH.
10:26 liuchong ls
10:26 sorear Password:
10:26 moritz_ no such file or directory.
10:26 sorear Input/output error
10:27 sorear I wonder if containers should be a native type.  Implementing FETCH as a completely ordinary method is raising many circularity saw issues, and the spec doesn't actually talk about custom container *types* at all
10:28 moritz_ how do I check the presense of a contextual variable in NQP without dying if it doesn't exist?
10:30 arnsholt moritz_: I suspect pir::somethingorother
10:31 sorear http://trac.parrot.org/parrot/wiki/ParrotQuotes last entry
10:32 moritz_ sorear: can't method calls on the container type use a more primitive, non-overridable container?
10:33 sorear moritz_: I use containers as part of the calling convention.  Containers which need to be FETCHed
10:33 sorear also, TimToady wants me to make absolutely everything augmentable
10:34 moritz_ he learned his p5 lesson well :-)
10:39 kaare_ arnsholt: At least that got me one step further :-)
10:41 frmadem joined #perl6
10:41 frmadem Hey how can I help?
10:41 arnsholt kaare_: Good, good
10:41 masak frmadem: in many ways! welcome.
10:41 shade_ joined #perl6
10:42 moritz_ frmadem: the question is more, what do you want to do?
10:42 moritz_ frmadem: write Perl 6 modules? documentation? blogging?
10:42 kaare_ I kinda naively hoped to have a perl6 object, but my $dbh = $pg.connectdb(''); returns an error,
10:42 frmadem I'm a Spanish perl developer
10:42 masak frmadem: most of the ways involve getting a copy of Rakudo and becoming gamiliar with it.
10:42 masak s/gamiliar/familiar/
10:42 kaare_ Null PMC access in invoke()
10:43 moritz_ kaare_: try   say $pg.connectdb('').WHAT
10:43 moritz_ kaare_: and tell me what kind of error it produces :-)
10:43 frmadem Iwould like to test some already developed modules in Perl6
10:44 masak frmadem: here's a list: http://proto.perl6.org/
10:44 moritz_ frmadem: that's a good start
10:44 frmadem I've already got a rakudo copy from the git repository
10:44 pmurias joined #perl6
10:44 kaare_ moritz_: The same :-(
10:44 kaare_ Null PMC access in invoke()
10:45 frmadem I've tested some of the features, running well in my Mac
10:45 masak frmadem: some projects on that list work in Rakudo today. others are old and not updated after the last refactor. so you're likely to find things that need fixing.
10:45 cognominal rakudo:  "{}" # :)
10:45 p6eval rakudo 05684c: OUTPUT«Null PMC access in get_string()␤  in main program body at line 11:/tmp/OBctzGOoQZ␤»
10:45 * masak submits rakudobug
10:45 masak cognominal++
10:45 liuchong left #perl6
10:46 moritz_ frmadem: of my modules that there some which could use more tests...
10:46 frmadem problem is i'm not familiar with parrot vm
10:46 moritz_ there's the json module
10:46 moritz_ you don't need to be, for writing tests
10:46 masak frmadem: intimate knowledge with Parrot is not needed.
10:46 masak I know fairly little about Parrot, but I can still read and write Perl 6 code :)
10:46 frmadem Right I can try to port my Json module to perl 6
10:47 frmadem ?
10:47 frmadem It's okay
10:47 frmadem ?
10:47 masak frmadem: there is a JSON::Tiny already...
10:47 moritz_ but of course diversity is encouraged
10:47 moritz_ http://github.com/masak/svg/ needs tests
10:48 masak oh, certainly.
10:48 moritz_ http://github.com/moritz/CGI-Application needs tests
10:48 masak frmadem: give it a shot. writing grammars is fun, except when it's frustrating. :P
10:48 frmadem All right take a look... mucas gracias
10:48 frmadem mucas/muchas
10:49 masak :)
10:49 * masak shudders to think what a "mucas gracias" looks like...
10:49 frmadem ps. I found grammars an explendid idea...
10:49 frmadem hasta luego!!
10:50 frmadem left #perl6
10:50 jnthn masak: I was trying not to think that. :P
10:50 masak jnthn: sorry :P
10:50 masak jnthn: sometimes a little knowledge is a dangerous thing... :)
10:51 moritz_ grammars are just like programming: you need quite some experience with them to be able to write more than 3 lines at once without it all blowing up
10:51 moritz_ now, how much grammar experience do you have, compared to your normal programming experience?
10:51 kaare_ how do I see the class of an object? I don't even know that :-(
10:52 * kaare_ hugs good ole perl5 ;-)
10:52 moritz_ kaare_: say $thing.WHAT
10:52 moritz_ kaare_: if you have some code to share, I can take a look and try to help you a bit
10:53 kaare_ moritz_:  oh. So I don't have an object from my $pg = pir::new__ps("Pg");
10:54 moritz_ kaare_: that might be because you're in the wrong HLL namespace
10:54 moritz_ kaare_: Perl 6 code runs in the 'perl6' HLL, Pg is in the 'parrot' HLL
10:54 masak is http://rt.perl.org/rt3/Ticket/Display.html?id=76142 a dupe of http://rt.perl.org/rt3/Ticket/Display.html?id=63786 ?
10:56 * sorear out
10:56 jnthn masak: ano
10:57 * masak merges
10:57 moritz_ kaare_: http://github.com/cosimo/perl6-digest-md5/blob/master/lib/Digest/MD5.pm contains an example of how to call some parrot stuff out of the parrot HLL
10:57 kaare_ moritz_:  http://nopaste.snit.ch/21628
10:57 jnthn If you're looking at Postgres from Perl 6, you may also be interested in http://github.com/jnthn/zavolaj/blob/master/examples/postgresqlclient.p6
10:58 kaare_ jnthn: I am and I am
10:59 jnthn Ah, OK
10:59 moritz_ kaare_: looking at it... but first I have to compile a new rakudo, my current one is broken :)
10:59 kaare_ moritz_: All OK. Just note that it fails in line 5.
10:59 kaare_ jnthn: thanx
11:00 dalek csmeta: r351 | stefa...@cox.net++ | trunk/vicil/Kernel.cs:
11:00 dalek csmeta: [vicil] As a concession to circularity, FETCH and STORE become responder
11:00 dalek csmeta: primitives
11:00 dalek csmeta: review: http://code.google.com/p/csmeta/source/detail?r=351
11:00 bbkr is there working P6 phaser that does the same functionality as Moose BEGIN{} block, or do I have to overload new() method?
11:01 kaare_ back to $$$ work. &
11:01 xinming_ joined #perl6
11:01 moritz_ bbkr: what do you want to do with it? (I'm not too familiar with Moose)
11:01 arnsholt Not sure what Moose's BEGIN blocks do, but if you want to run code when an object is constructed, implement method BUILD
11:01 moritz_ s/method/submethod/
11:02 arnsholt Right you are =)
11:03 arnsholt I should probably fix that in Algorithm::Viterbi
11:04 masak lunch &
11:12 bbkr arnsholt: yes, I want to run some code when object is constructed. but it found something that looks like a bug;
11:12 bbkr rakudo: class ConditionBlock { has Int $.id;  method BUILD { $.id = 666; }; }; ConditionBlock.new(); # why read-only ?
11:12 p6eval rakudo 05684c: OUTPUT«Cannot assign to readonly value␤  in '&infix:<=>' at line 1␤  in 'ConditionBlock::BUILD' at line 11:/tmp/LWTYBgAyhj␤  in main program body at line 11:/tmp/LWTYBgAyhj␤»
11:14 jnthn has Int $.id is rw;
11:14 jnthn or use $!id = 666;
11:15 jnthn But make it a submethod
11:16 moritz_ or
11:16 bbkr rakudo: class X { has Int $.id; method BUILD { $.id = 666} } X.new # jnthn - but this one works, while previous one doesn't ?
11:16 p6eval rakudo 05684c:  ( no output )
11:16 moritz_ has Int $.id = 666;
11:18 bbkr $.id is rw by default, isn't it?
11:18 moritz_ nope
11:18 bbkr rakudo: class X { has Int $.id; method BUILD { $.id = 666; }; }; X.new
11:18 p6eval rakudo 05684c: OUTPUT«Cannot assign to readonly value␤  in '&infix:<=>' at line 1␤  in 'X::BUILD' at line 11:/tmp/cp70pg547y␤  in main program body at line 11:/tmp/cp70pg547y␤»
11:18 bbkr ?! I just added few semicolons :)
11:19 bbkr rakudo: class X { has Int $.id; method BUILD { $.id = 666; } }; X.new
11:19 p6eval rakudo 05684c: OUTPUT«Cannot assign to readonly value␤  in '&infix:<=>' at line 1␤  in 'X::BUILD' at line 11:/tmp/Flmay942pR␤  in main program body at line 11:/tmp/Flmay942pR␤»
11:19 bbkr rakudo: class X { has Int $.id; method BUILD { $.id = 666 } }; X.new
11:19 p6eval rakudo 05684c: OUTPUT«Cannot assign to readonly value␤  in '&infix:<=>' at line 1␤  in 'X::BUILD' at line 11:/tmp/gBZkgzfxzz␤  in main program body at line 11:/tmp/gBZkgzfxzz␤»
11:19 bbkr rakudo: class X { has Int $.id; method BUILD { $.id = 666 } } X.new
11:19 p6eval rakudo 05684c:  ( no output )
11:20 * bbkr is confused. why adding semicolon after class definition made $.id read-only?
11:21 moritz_ bbkr: I guess without the semicolon it is mis-parsed
11:21 moritz_ bbkr: and then for some strange reason X.new isn't actually run, and $.id is always read-only
11:22 bbkr rakudo: class X { has Int $.id; method BUILD { $.id = 666 } } say X.new.id # checking for misparsing
11:22 p6eval rakudo 05684c: OUTPUT«===SORRY!===␤Confused at line 11, near "class X { "␤»
11:22 moritz_ kaare_: I've created http://trac.parrot.org/parrot/ticket/1692
11:23 bbkr moritz_: you're right (again). is this a bug? spec doesn't force semicolons after class blocks.
11:24 moritz_ std: class X { has Int $.id; method BUILD { $.id = 666 } } X.new
11:24 p6eval std 31481: OUTPUT«[31m===[0mSORRY![31m===[0m␤Method call found where infix expected (omit whitespace?) at /tmp/KVuVqGABwZ line 1:␤------> [32mnt $.id; method BUILD { $.id = 666 } } X[33m⏏[31m.new[0m␤    expecting infix or meta-infix␤Parse failed␤FAILED 00:01 114m␤»
11:24 moritz_ bbkr: spec says that after a } either a newline or a ; is required
11:25 moritz_ bbkr: but it's a bug that rakudo doesn't complain about it
11:25 * bbkr reports
11:25 moritz_ bbkr++
11:31 cognominal is there a way to print the rakudo git version and the  parrot svn version from rakudo?
11:31 moritz_ cognominal: nope; there's a patch for that in RT, but it's not applied yet
11:31 moritz_ parrot version is accessible though
11:31 moritz_ rakudo: say %*VM<config><revision>
11:31 p6eval rakudo 05684c: OUTPUT«47723␤»
11:33 cognominal I realize that my bug  reports art about the "current" version which is not very helpful down the chain.
11:33 moritz_ cognominal: the rakudo git hash is usually enough, if you use the recommended parrot revision from build/PARROT_REVISION
11:34 kaare_ moritz_: thanx
11:35 moritz_ kaare_: I've also submitted a fix in parrot r47900
11:36 arnsholt .u U+FEFC
11:36 phenny arnsholt: Sorry, no results
11:36 arnsholt .u FEFC
11:36 phenny U+FEFC ARABIC LIGATURE LAM WITH ALEF FINAL FORM (ﻼ)
11:39 imarcusthis .u BEEF
11:39 phenny U+BEEF HANGUL SYLLABLE BBEGS (뻯)
11:39 imarcusthis .u CAFE
11:39 phenny U+CAFE HANGUL SYLLABLE JJWAELM (쫾)
11:39 imarcusthis boring
11:40 moritz_ .u DEAD
11:40 phenny U+DEAD (No name found)
11:40 imarcusthis .u FEED
11:40 phenny U+FEED ARABIC LETTER WAW ISOLATED FORM (ﻭ)
11:40 imarcusthis .u FADE
11:40 phenny U+FADE (No name found)
11:41 kaare_ moritz_: downloading now
11:42 moritz_ kaare_: mind you, I only tested the reduced PIR form... no idea if the Perl 6 example works now
11:42 felliott joined #perl6
11:42 kaare_ moritz_: That's why I download now :-)
11:42 moritz_ :-)
11:43 imarcusthis .u ACED
11:43 phenny U+ACED HANGUL SYLLABLE GOLT (곭)
11:45 colomon So, I just forked LastOfTheCarelessMen's Vector and ABC to try to port them to current Rakudo. http://github.com/colomon/Vector has my first wave of changes.  ufo++
11:45 phenny colomon: 27 Jun 06:15Z <ciphertext> tell colomon i've got series passing all (nonfudged) tests, and conforming to almost all of the spec. See http://nopaste.snit.ch/21602 for details. (especially note the section at the bottom).
11:45 colomon But I get this error:
11:45 colomon error:imcc:syntax error, unexpected '\n'
11:45 colomon in file 'EVAL_5' line 58
11:45 colomon ===SORRY!===
11:45 colomon syntax error ... somewhere
11:45 kaare_ moritz_: I'll give you a ping when it's tested
11:45 colomon make: *** [lib/Vector.pir] Error 1
11:45 colomon anyone have a clue what could be doing that?
11:49 envi^home joined #perl6
11:52 xinming joined #perl6
11:53 jnthn colomon: Not without seeing the PIR that's generated
11:55 takadonet morning all
11:56 ruoso joined #perl6
11:57 moritz_ kaare_: oh, it seems that the load_bytecode("postgres.pir") is interfering
11:57 moritz_ kaare_: without it I have something working
11:59 kaare_ moritz_: ok, i just assumed it was necessary.
11:59 moritz_ kaare_: http://nopaste.snit.ch/21629
11:59 moritz_ says
11:59 moritz_ Pg;Conn
11:59 moritz_ whih means $con actually holds a connection object
12:01 kaare_ OK, I'll play with it later. Thanks
12:02 kaare_ say $dbh.WHAT; still doesn't work though
12:02 moritz_ yes
12:02 moritz_ that's because it's not a Perl 6 object
12:02 moritz_ but a parrot object
12:03 colomon jnthn: --target=PIR    ?
12:03 jnthn --target=pir
12:03 moritz_ colomon: isn't that a .pir file alredy?
12:03 jnthn (think it only likes lowercase)
12:04 moritz_ 13:45 <@colomon> make: *** [lib/Vector.pir] Error 1
12:04 moritz_ Vector.pir looks like pir :-)
12:07 colomon fair enough, I don't know what magic ufo performs.  ;)
12:07 colomon errr, no it isn't.
12:08 colomon there doesn't seem to be any Vector.pir file.
12:09 colomon It gets that error generating Vector.pir
12:09 moritz_ ah
12:10 colomon env PERL6LIB='/Users/colomon/tools/Vector/lib' /Users/colomon/tools/rakudo/perl6 --target=pir --output=lib/Vector.pir lib/Vector.pm
12:10 xinming joined #perl6
12:10 colomon is the command which generates the error.
12:11 jnthn colomon: Does Vector.pm have any "use" of an already pre-compiled module?
12:11 colomon MONKEY_TYPING doesn't count, does it?
12:12 moritz_ nope
12:12 colomon then no, it's just
12:12 colomon use v6;
12:12 colomon use MONKEY_TYPING;
12:13 jnthn Ah :-(
12:13 jnthn My best guess was that it was loading a pre-compiled module that contained bad PIR.
12:14 colomon I'll try mucking about with the source and see if that affects anything.
12:14 colomon in the meantime, if you'd like to play with it, the exact same source is up at http://github.com/colomon/Vector ... ;)
12:15 moritz_ what you can always try is to comment out large chunks of code and see when the error goes away
12:16 colomon moritz_: that's exactly what I just did to make the error go away.
12:16 colomon I suspect it might be the use of multi sub circumfix:<⎡ ⎤>
12:16 moritz_ I think that's NYI in master
12:16 moritz_ rakudo: multi sub circumfix:<[ ]>($x) { say $x }; [5]
12:16 p6eval rakudo 05684c: OUTPUT«5␤»
12:17 moritz_ huh
12:17 colomon if that's the problem, worst error message ever....
12:17 colomon but that definitely does it.  If I comment out just that, the build continues to work.
12:18 arnsholt rakudo: multi sub circumfix:<⎡ ⎤>($x) { say $x }; ⎡5⎤
12:18 p6eval rakudo 05684c: OUTPUT«error:imcc:syntax error, unexpected '\n'␤  in file 'EVAL_1' line 24665226␤===SORRY!===␤syntax error ... somewhere␤»
12:18 colomon now to see how badly make test splodes....
12:18 colomon arnsholt++
12:18 arnsholt Looks like it doesn't want to define new operators
12:18 colomon wow, make test really goes splode in a big way.
12:19 arnsholt rakudo: multi sub circumfix:<£ ¤>($x) { say $x }; £5¤
12:19 p6eval rakudo 05684c: OUTPUT«error:imcc:syntax error, unexpected '\n'␤  in file 'EVAL_1' line 24665226␤===SORRY!===␤syntax error ... somewhere␤»
12:19 arnsholt Or it could be a Unicode problem (come to think of it)
12:19 moritz_ rakudo: multi sub circumfix:<foo bar>($x) { say $x }; foo 5 bar
12:19 p6eval rakudo 05684c: OUTPUT«error:imcc:syntax error, unexpected '\n'␤  in file 'EVAL_1' line 24665226␤===SORRY!===␤syntax error ... somewhere␤»
12:19 kaare_ moritz_: I did get a real connection. At least I could create a table.
12:20 moritz_ kaare_: \o/
12:20 moritz_ kaare_: do you have a github ID?
12:20 kaare_ dont know of it's usable for anything though :-)
12:20 moritz_ well, it's a start.
12:21 kaare_ moritz_: Yes, my user id is kaare. Is that enough info?
12:22 moritz_ hugme: add kaare to fakedbi
12:22 * hugme hugs kaare. Welcome to fakedbi!
12:22 moritz_ kaare_: you can put a FakeDBD::pg into the fakedbi repo :-)
12:22 * kaare_ hugs hugme
12:22 moritz_ http://github.com/mberends/fakedbi/
12:23 filius joined #perl6
12:23 ruoso joined #perl6
12:24 filius left #perl6
12:25 colomon huh.  seems like user-defined operators in a module don't work at the moment?
12:27 mathw don't work inside the module, or don't export properly?
12:28 colomon don't export properly
12:28 mathw huh
12:28 mathw somehow I'm not surprised
12:28 colomon don't even parse properly after export, which maybe is a clue?
12:29 moritz_ colomon: not exporting is a known to me, but dunno if there's a ticket for it
12:30 moritz_ colomon: problem is that 'use' doesn't really happens at compile time right now
12:30 moritz_ maybe that's not the whole problem
12:30 moritz_ it creates stubs for the lexicals it exports
12:30 moritz_ at that part it could modify the grammar
12:31 ruoso joined #perl6
12:33 pmichaud good morning, #perl6
12:34 takadonet pmichaud: morning
12:35 mathw lolitspmichaud!
12:35 kfo joined #perl6
12:36 jnthn morning, pmichaud
12:36 pnate joined #perl6
12:37 jnthn colomon: That's known (and why they're not marked done in ROADMAP)
12:38 masak joined #perl6
12:40 pmichaud 11:19 <bbkr> rakudo: class X { has Int $.id; method BUILD { $.id = 666 } } X.new
12:40 pmichaud is being parsed as  &infix:<X>(class ..., $_.new)
12:41 audreyt joined #perl6
12:41 mathw oh my
12:41 pmichaud (hint:  don't name your classes X, Z, Q, etc.  :-)
12:42 mathw Well I wasn't planning to, but it's a bit surprising
12:42 pmichaud std: class X { has Int $.id; method BUILD { $.id = 666 } } X.new   # curious
12:42 p6eval std 31481: OUTPUT«[31m===[0mSORRY![31m===[0m␤Method call found where infix expected (omit whitespace?) at /tmp/1M7OQvOM75 line 1:␤------> [32mnt $.id; method BUILD { $.id = 666 } } X[33m⏏[31m.new   # curious[0m␤    expecting infix or meta-infix␤Parse failed␤FAILED 00:01 114m␤»
12:42 pmichaud std++ again
12:43 mathw interesting
12:43 mathw I'd think that once it saw 'class' it'd know that there's an indentifier or a block coming
12:43 colomon jnthn: any idea when we might have that?  It makes Vector a complete non-starter.
12:44 jnthn colomon: I may get to work on it this week; if not, I can do it at the weekend
12:44 colomon \o/
12:44 * jnthn is has a hackathon at the weekend o/
12:44 skids joined #perl6
12:46 colomon I will be off-line for a week starting sometime over the weekend, but if you get it fixed after I'm gone, maybe someone else can pick up the ball on this one.
12:47 pmichaud colomon: could we move the str2num et al methods into cheats?
12:48 pmichaud for compile-time dec-number constants, I'd like to see us do the calculations at compile-time instead of runtime
12:49 colomon I don't think we can unless we move Rat into NQP.
12:49 pmichaud no
12:49 colomon well, I guess we could for Num constants.
12:49 pmichaud the Rat construction can continue to be runtime
12:49 pmichaud but the arguments to Rat could be compile-time
12:49 colomon sure.
12:49 moritz_ as long was we can calucate numerator and denominator without using Rats
12:49 pmichaud we can
12:50 pmichaud the str2num stuff just uses native parrot registers anyway
12:50 pmichaud we'd save a *lot* of time on dec-number constants if we didn't have to convert them from strings (every time they're used)
12:50 colomon the PIR routines should go into NQP very easily, no?
12:51 pmichaud I don't understand the "go into NQP part"
12:51 masak I was sure we had one like http://rt.perl.org/rt3/Ticket/Display.html?id=76226 , but I can't find it.
12:51 colomon I mean, ....
12:51 colomon hmmm.
12:51 pmichaud I want to move the str2num-* subs into cheats
12:51 pmichaud give them ! prefixes (so they don't appear in the global namespace)
12:51 moritz_ masak: so was I
12:51 pmichaud then NQP can call them at compile time
12:51 colomon I'm trying to figure out what the non-cheating solution is.
12:52 pmichaud colomon: why?  it's a cheat no matter what.
12:52 pmichaud and the logic still has to be available at runtime.
12:52 pmichaud (for conversion of Str to numbers)
12:52 masak moritz_: it's a bit hard to search for.
12:55 colomon pmichaud: I guess I don't quite understand the ramifications of moving the routines around.  but I certainly have no objections to do it, as long as numeric constants continue to actually work.
12:56 steffan joined #perl6
12:58 perlygatekeeper joined #perl6
12:59 pmichaud I suppose I could also put some better str-to-num conversion code into nqp-rx itself, then re-use it from rakudo.
13:00 jaldhar joined #perl6
13:00 moritz_ when I do a  'my Int $x' declaration, where is the type constraint stored at compile time?
13:00 pmichaud on the container for $x
13:00 pmichaud oh, wait
13:00 pmichaud at compile time
13:00 moritz_ I kinda expected it in the Past::Var
13:00 pmichaud I'm not sure it's stored at the moment.  It will likely be in the symbol table that holds the reference to $x
13:01 pmichaud Parrot doesn't know about type constraints.
13:01 masonkramer joined #perl6
13:01 pmichaud also, there's a PAST::Var for each usage of $x in a program, not a global one
13:01 pmichaud it really belongs in the block's symbol table.
13:01 pmichaud (the symbol table could hold a link to the PAST::Var defining $x, but that's entirely up to the HLL)
13:01 moritz_ so I need to find the block which encloses the PAST I'm looking at
13:02 pmichaud in rakudo we have a subroutine for that
13:03 pmichaud ...well, we used to.
13:04 pmichaud NQP has an example of a way to do it.  essentially, you walk through @BLOCK looking for the first one that has an entry in @BLOCK.symbol
13:04 Zapelius joined #perl6
13:04 moritz_ is @BLOCK accessible after the action methods ran?
13:05 pmichaud oh, you mean from the already-created PAST tree
13:05 moritz_ ie in a compilation stage after PAST
13:05 moritz_ yes
13:05 pmichaud nope
13:05 moritz_ :(
13:05 pmichaud PAST::Compiler handles it by keeping a stack of nested Blocks as it traverses the tree.
13:06 pmichaud it also keeps a stash of all of the in-scope symbols
13:06 moritz_ so, the current state for compile-time optimizations in rakudo is "don't do", it seems
13:06 moritz_ or analysis, for that matter
13:07 moritz_ what I wanted to do is catching things like  my Int $x = 'foo'
13:07 moritz_ and the code for finding &infix:<=>($var, $typed_thing) works
13:07 moritz_ but since there's no good way to get the type constraints of $var, a static check seems not a LHF at all
13:08 pmichaud adding a type constraint to the symbol isn't too difficult
13:08 pmichaud I'm more curious about how one would detect/handle:     my XYZ $x = 'foo'
13:09 pmichaud I guess we'd only check the known builtin types
13:09 moritz_ look up XYZ, if possible
13:09 pmichaud (for a first pass)
13:09 moritz_ and only if the lookup works, do the check
13:10 pmichaud where "do the check" is actually calling '&infix:<=>'  ?
13:10 moritz_ no, I thought about .ACCEPTS
13:11 moritz_ we should really have a long talk at YAPC::EU
13:11 moritz_ :-)
13:11 pmichaud definitely.  :)
13:12 pmichaud anyway, off the top of my head, here's one thing I'd do
13:13 pmichaud one choice would be to add symbol table entries for each PAST::Block's outer block
13:13 pmichaud that would make walking up-the-tree simpler.
13:13 pmichaud this could be done as part of an optimization pass as well
13:14 pmichaud i.e., while walking down the past tree, establish outer links as appropriate.
13:15 pmichaud another possibility would be to build a stash in the block's symtable that keeps a list of all of the symbols in scope and references to their PAST::Var decl (if available)
13:16 pmichaud there's nothing that says that the HLL compiler has to (or even should) build these structures... in some senses it's more generic for the optimizing passes to do it.
13:16 moritz_ depends on how much analysis it wants to do
13:17 moritz_ it just bothers me that we have to rebuild data structures that we already have in the action methods
13:17 moritz_ feels like there could be a better long-term solution
13:17 pmichaud I'm not entirely sure about that (more)
13:18 pmichaud the action methods already have enough to keep track of, without also trying to manage a lot of cross-referencing structures
13:18 mmcleric joined #perl6
13:18 pmichaud one advantage of doing cross-referencing after building the entire PAST structure is that it's "static" at that point
13:19 moritz_ well, if the PAST tree held more information, the action methods could use that, and keep less state on their own
13:19 pmichaud especially for Rakudo, while in the midst of a copmile the PAST structure is incredibly dynamic as the action methods are taking place.  Keeping up with the cross-referencing structures (and patching them whenever a section needs to be moved/refactored) would be very difficult to keep straight.
13:19 pmichaud the PAST tree can already hold more information, yes.
13:19 pmichaud nothing blocks that.
13:20 moritz_ I guess I need to read more about PAST make useful changes (or suggestions)
13:20 pmichaud keep in mind that PAST allows a HLL to put its own annotations in place
13:20 pmichaud PAST only puts minimal expectations on what goes in a block's symtable (i.e., it expects the symtable to hold "user-defined" information as well as the basic symbol list)
13:21 pmichaud it also allows each note to have its own set of annotations -- i.e., each PAST::Node is really a hash.
13:21 pmichaud s/note/node/
13:23 pmichaud for example, it's perfectly okay for a PAST::Block's symtable to maintain a list of all symbols in scope, not just those defined within the block itself.  Rakudo doesn't do this yet, but PAST doesn't prohibit it.
13:23 * moritz_ nods
13:24 pmichaud but I figured that requiring every HLL compiler to supply this information in order to make use of an optimization might place some extra burden on the hll compiler author.  In some sense I think the optimization passes ought to be smart enough to deduce some of these things on their own.
13:27 pmichaud or, more precisely, iwbni the optimization passes could deduce these things on their own whenever the hll compiler author doesn't provide them as hints.  (If the hll compiler author provides appropriate hints, then the optimization passes can work better.)
13:27 slavik joined #perl6
13:27 plobsing joined #perl6
13:28 jnthn rakudo: {;}.WHAT.say
13:28 p6eval rakudo 05684c: OUTPUT«Block()␤»
13:31 moritz_ pmichaud: I'll talk to tcurtis about that (the gsoc student working on the parrot optimization framework)
13:34 redicaps joined #perl6
13:34 steffan left #perl6
13:35 redicaps left #perl6
13:36 JimmyZ joined #perl6
13:37 pmichaud rakudo:  " { a => 4 } ".say
13:37 p6eval rakudo 05684c: OUTPUT« a 4 ␤»
13:37 bbkr rakudo: (...).WHAT.say # WHAT returning empty string? seems weird, because spec says everything is derived from Mu. bug?
13:37 pmichaud rakudo:  " { } ".say
13:37 p6eval rakudo 05684c:  ( no output )
13:37 p6eval rakudo 05684c: OUTPUT«Null PMC access in get_string()␤  in main program body at line 11:/tmp/usmP5SQR0Q␤»
13:37 pmichaud interesting.
13:37 pmichaud rakudo:   say (...) ~~ Failure
13:37 p6eval rakudo 05684c:  ( no output )
13:38 pmichaud bbkr: ... is a failure
13:38 pmichaud bbkr: invoking it causes the program to stop at that point
13:38 pmichaud (well, it causes the routine to return a failure)
13:38 pmichaud so the .WHAT is never being executed
13:38 moritz_ rakudo: say sub {...}.() ~~ Failure
13:39 p6eval rakudo 05684c: OUTPUT«===SORRY!===␤Confused at line 11, near "say sub {."␤»
13:39 moritz_ rakudo: say (sub {...}).() ~~ Failure
13:39 p6eval rakudo 05684c: OUTPUT«1␤»
13:39 pmichaud rakudo:  say (sub { ... }).().WHAT
13:39 p6eval rakudo 05684c: OUTPUT«Failure()␤»
13:39 bbkr pmichaud: not a bug then, thanks.
13:42 bbkr hmm, but Failure returned from main block should IMO set $? bash variable to 1, am I right? otherwise there is no way of checking if code failed in main block.
13:44 pmichaud it should at least not fail silently
13:45 bbkr pmichaud: right. should i put it in RT queue for discussion?
13:45 pmichaud bbkr++
13:45 pmichaud (+1)
13:49 RAT joined #perl6
13:50 masak rakudo: my $a = [1, 2, 3]; foo($a); bar($a); sub foo(@a) { say @a.perl }; sub bar(@a is copy) { say @a.perl }
13:50 p6eval rakudo 05684c: OUTPUT«[1, 2, 3]␤[[1, 2, 3]]␤»
13:50 masak that one's new, isn't it?
13:50 * masak submits rakudobug
13:51 RAT Did my suggestion of the converse of slurp=burp get into the standards yet? ;-)
13:52 jnthn I thought splat was the latest suggestion. ;-)
13:52 pmichaud masak: that one is interesting.  I'm not sure it's a bug.
13:52 masak RAT: what should such a function do if it resks overwriting an existing file?
13:52 mathw pmichaud: it is quite surprising...
13:52 masak pmichaud: oh, come on! :/
13:53 mathw although I suspect flattening would hide it in many cases
13:53 masak pmichaud: going against my expectations is *always* a bug! :P
13:54 moritz_ rakudo: sub bar(@a is copy) { say @a.perl }; say bar [1, 2, 3]
13:54 masak pmichaud: er. put differently, where does the spec say "putting 'is copy' on an array gives you an extra layer of array"?
13:54 pmichaud my $a = [1,2,3];   my @b = $a;   say @b.perl;
13:54 p6eval rakudo 05684c: OUTPUT«[[1, 2, 3]]␤1␤»
13:54 moritz_ pmichaud: that's assignment
13:54 pmichaud it's the same logic by which
13:54 moritz_ pmichaud: signature binding is *binding*
13:54 pmichaud moritz_: except for is_copy
13:54 pmichaud it's the same logic by which
13:55 pmichaud my $b = [1,2,3];  sub xyz($x is copy) { $x[1] = 'b'; };  xyz($b);  say $b.perl;
13:55 pmichaud rakudo: my $b = [1,2,3];  sub xyz($x is copy) { $x[1] = 'b'; };  xyz($b);  say $b.perl;
13:55 p6eval rakudo 05684c: OUTPUT«[1, "b", 3]␤»
13:55 masak rakudo: my $a = 5; sub bar(@a is copy) { say @a.perl }; bar($a)
13:55 p6eval rakudo 05684c: OUTPUT«Nominal type check failed for parameter '@a'; expected Positional but got Int instead␤  in 'bar' at line 11:/tmp/zpKCBPqCXv␤  in main program body at line 11:/tmp/zpKCBPqCXv␤»
13:55 pmichaud anyway, I can fix it.
13:55 pmichaud I agree that the other interpretation likely makes more sense.
13:55 masak pmichaud: if the above doesn't bind, why does my first line give double arrays?
13:56 masak seems very arbitrary.
13:56 pmichaud I just said I wasn't certain of it.  :-)
13:56 masak just trying to make you even less certain :P
13:56 pmichaud the "is copy" logic is still not completely nailed down, based on discussion with TimToady++ at yapc::na
13:57 masak I do see the parallel with attr arrays and :attr[]. by the way.
13:58 * colomon was wondering about laziness and "is copy"....
13:59 pmichaud anyway, the one thing I *am* certain of is that "is copy" is not "binding".  Indeed, the whole point of "is copy" is to avoid the bind.  :-)
13:59 mathw yes that's what I thought :)
14:00 moritz_ I thought it copied, and then binds
14:00 pmichaud okay, one can think of it that way.  :-)
14:00 pmichaud but it's not binding to the argument
14:01 pmichaud in the same way,   my @b = $a;  is a bind only in the sense that we bind the symbol '@b' to an array before doing the assign
14:02 pmichaud anyway, I know the fix.  Should be one-line :)
14:02 pmichaud did the ticket get filed yet?
14:02 alester joined #perl6
14:03 masak almost. :)
14:04 masak stop talking about it, and I'll file it. :P
14:04 pmichaud I'm compiling a fix now.  :)
14:04 pmichaud 1-line fix.  Actually, 0-line fix, just need to move a statement to a new location.  :)
14:05 mathw I think git might count that as two lines
14:05 mathw one delete, one insert :)
14:05 masak :)
14:05 mathw obviously this is enormously important for pmichaud to know, lest he misunderstand how big his patch is
14:05 masak pmichaud: should become #76242.
14:05 mmcleric_ joined #perl6
14:06 masak yup :)
14:06 PacoLinux joined #perl6
14:06 mmcleric_ joined #perl6
14:09 skids joined #perl6
14:09 Guest23195 joined #perl6
14:10 pmichaud > sub xyz(@a is copy) { say @a.perl; };  xyz([1,2,3]);
14:10 pmichaud [1, 2, 3]
14:11 mathw \o/
14:11 pmichaud > my $b = [1,2,3];  sub xyz(@a is copy) { @a[1] = 'x'; }; xyz($b);  say $b.perl;
14:11 pmichaud [1, 2, 3]
14:12 pmichaud spectesting now.
14:12 mathw pmichaud++
14:13 masak pmichaud++
14:16 pmichaud is Bool still an enum?  (I'm looking at RT #76238)
14:16 pmichaud we keep trying to make it into one, and failing.
14:16 masak by spec, it is.
14:16 masak I've always thought that it's hard because Bool is so central, and keeps getting in the way of the circularity saw.
14:16 jnthn There's that.
14:17 masak enums are quite high-level in the implementaion.
14:17 jnthn There's also been in the past other weird requirements on Bool that make it not just an enum iirc
14:17 masak Bools are quite low-level.
14:17 masak jnthn: like what?
14:17 jnthn Like .succ and .pred on it
14:17 jnthn Which I don't think would be on enum elements.
14:17 masak why not?
14:17 masak that's be kinda nice.
14:18 colomon they need to be there, actually.
14:18 colomon for range
14:18 colomon and probably series.
14:18 jnthn Further violates the "enum values behave like their underlying value" thingy.
14:18 jnthn Unless we decide we want that in this case.
14:18 colomon Range is full of examples like Wed..Fri
14:18 jnthn Oh
14:19 jnthn Then we probably do want to define them somehow
14:19 jnthn But ugh
14:19 jnthn How the heck to implement that nicely...
14:19 colomon Are you worried about the middle cases, or just the ends?  :)
14:20 jnthn We'd make the enum values by taking the value and mixing some role into them, I guess
14:20 jnthn How does it then find its next value?
14:20 jnthn Maybe go and look through the .mappings...
14:21 colomon I was under the vague impression they mapped to Ints, but I admit I haven't paid full attention to the enum spec updates.
14:21 pmichaud can we go   enum => Int => .succ => enum ?
14:22 pmichaud i.e., convert an enum to its int represetation, take the .succ of that, then go back to the enum?
14:22 mathw eeew
14:22 jnthn pmichaud: no
14:22 pmichaud why not?
14:22 jnthn consider the pair case.
14:22 pmichaud Day(3) doesn't work?
14:23 jnthn enum foo ( :a(1), :b(42) );
14:23 jnthn 1.succ isn't 42 :-)
14:23 pmichaud in that case, I'm not sure that a has a .succ
14:23 mathw that would lead to two kinds of enum
14:23 mathw and you'd never know what you had
14:23 jnthn If the succ was always "the next thing in the enum" then it can work
14:24 mathw yes
14:24 jnthn But that means you can't go round-tripping to the base-type.
14:24 [particle] does p6 have sparse arrays natively?
14:24 jnthn S09
14:24 * moritz_ decommutes for a few hours
14:24 mathw Personally I'm all for anything that divorces enums from the base type as much as possible, provided the conversion's still possible if you really need it. I've seen far too much code which abused enums as ints to be comfortable with it.
14:24 [particle] if so, there must be some way to get to the next non-empty slot in the sparse array
14:25 mathw must there?
14:25 * masak senses another slight tweat to the enum spec coming up...
14:25 bbkr rakudo: my @t=1; sub foo(@u is copy) { }; foo(@t[0..*]); # hmm
14:25 [particle] in order to efficiently traverse them, yes
14:25 p6eval rakudo 05684c:  ( no output )
14:26 jnthn masak: Heh. You start to understand why I avoid working on enums like the plague yet? :-)
14:26 pmichaud anyway, back to my original question, is Bool ever going to make it to be an enum?  ;-)
14:26 [particle] if my array has items at indexs 1, 1_000_000 and 1_000_000_000_000, i sure don't want to iterate naively
14:26 mathw I think a clearer idea of what enums are is required first...
14:26 mathw Bool might have to become a... something else
14:26 masak jnthn: nobody said you have to work on it like the plague... :P
14:26 bbkr rakudo: my @t=1; sub foo(@u is copy) { }; foo(@t[0..*]); say "works";
14:27 p6eval rakudo 05684c:  ( no output )
14:27 mathw jnthn: please don't, I like having enums and wouldn't want them all to die of a horrible fever
14:27 jnthn pmichaud: I've only been asking that for a couple of years. ;-)
14:27 pmichaud jnthn: me also :)
14:27 jnthn pmichaud: And enums are a moving target.
14:27 mathw that's the problem
14:27 mathw if enums were pinned down, then somebody could say 'yes, Bool is an enum'
14:27 mathw or 'no, Bool is not an enum'
14:27 jnthn The enum spec is like the IO spec imnsho.
14:28 mathw nah, the IO spec's worse :)
14:28 jnthn Full of speculative "ooh wouldn't this be nice"
14:28 mathw and much, much more minefieldy IMO
14:28 pmichaud well, afaict, the reason that enums are a moving target is because we keep asking "so, how is it that Bool is an enum again?"  1/2 :-)
14:28 jnthn Rather than something straightforward and implementable.
14:28 jnthn And then we can add things as people actually need them.
14:28 pmichaud i.e., every enum spec change has been in response to trying to figure out how Bool fits with it :)
14:28 mathw That might be a hint
14:28 mathw Maybe it means Bool isn't an enum
14:28 masak I mostly like the current enum spec very much. it's an improvement on the previous one.
14:29 pmichaud I like it as well.
14:29 pmichaud So the iterative refinement is very good.
14:29 pmichaud But we're still left wondering about Bool  :-)
14:29 masak neither of pmichaud and jnthn seem to think that Bool is an enum.
14:29 masak maybe that's a hint too.
14:29 jnthn +1 to "it' snot an enum"
14:29 pmichaud I can think of Bool as an enum, I just keep getting nicked by the circularity saw
14:29 jnthn pmichaud: Exactly.
14:30 jnthn er, it's not
14:30 jnthn EPLAGUETHEMEWON'TGOAWAY
14:30 pmichaud actually, perhaps the answer is that while Bool is an enum, "bool" is not.
14:31 jnthn std: my bool $does-it-exist;
14:31 pmichaud and we should be returning low-level bools
14:31 p6eval std 31481: OUTPUT«ok 00:01 111m␤»
14:31 jnthn pmichaud: That's also possible.
14:31 jnthn pmichaud: In that case, how would bool and bit differ?
14:31 jnthn std: my bit $does-it-exist;
14:31 p6eval std 31481: OUTPUT«ok 00:01 108m␤»
14:31 mathw jnthn: the difference is... er... symbolic constants?
14:31 mathw 'bool' makes people think 'true or false'
14:32 pmichaud well, 'true' isn't a constant :)
14:32 mathw the difference is mind control
14:32 pmichaud (in P6)
14:32 pmichaud oh, at least it wasn't.
14:32 mathw pmichaud: pfft you could make it one if you wanted to
14:32 pmichaud I think we s/true/so/
14:32 pmichaud it used to be a low-level prefix
14:32 mathw oh yes, I remember that, dimly
14:33 mathw umm, I've lost the current enum spec
14:33 masak the main thing I like about the current enum spec is that you can get at the underlying EnumMap.
14:34 masak I find it slightly... odd... that EnumMap ends up being the parent class of Hash in Rakudo.
14:34 masak but oh well.
14:35 mathw ah, found it
14:35 masak maybe it's just named unfortunately.
14:36 masak *ill-named
14:36 frettled mathw: we had a horrible punning session, involving also «make it so», of course.
14:36 jnthn masak: Well, Mapping was the parent class of Hash in master
14:36 masak jnthn: that's OK, methinks.
14:36 masak jnthn: but a Hash has nothing to do with enums.
14:36 jnthn masak: But Mapping is gone, long live EnumMap
14:36 jnthn masak: Tell that to anonymous enums.
14:36 jnthn :P
14:37 frettled EA = Enumns Anonymous
14:37 masak I can see a Hash generalizing to non-Str keys. can't see the same with EnumMap.
14:37 mathw well that's why Hash derives from, it adds stuff
14:37 mathw like mutability
14:38 mathw although it is kind of weird, I just accept it
14:38 frettled Nah, it's normal OO, ain't it?
14:38 mathw yeah, that's why I just accept it :)
14:38 frettled heh
14:38 arnsholt masak: Hash should definitely support non-Str keys. But that'd entail adding some methods to Any or some such I think
14:39 mathw I'm convinced that there's something wrong with OO pretty much everywhere, I just haven't figured it out yet
14:39 mathw It might be because virtually everything isn't Smalltalk
14:39 masak indeed.
14:43 bbkr rakudo: perl6 -e 'class Maybe is Bool::True is Bool::False {}; say Bool::True; say Maybe'; # stupid example :P but Maybe calles in ~ context should return the same output as Bool::True
14:43 p6eval rakudo 05684c: OUTPUT«===SORRY!===␤Confused at line 11, near "perl6 -e '"␤»
14:43 bbkr rakudo: class Maybe is Bool::True is Bool::False {}; say Bool::True; say Maybe; # stupid example :P but Maybe calles in ~ context should return the same output as Bool::True
14:43 p6eval rakudo 05684c: OUTPUT«1␤Maybe()␤»
14:43 frettled mathw: Smalltalk is just so unamerican, Bigtalk is more like it! ;)
14:44 * pmichaud decides he needs to re-read the updated enum spec
14:45 masak maybe the "why can't Bool be an enum is really two questions": (1) "what prevents us, with the current Rakudo, from creating an enum type MyBool which does all we want Bool to do?", and (2) "once we have such a type, what are the obstacles to putting it where Bool is now?"
14:46 masak all the circularity issues end up in the second part.
14:46 pmichaud masak: I was just trying that (1)
14:46 masak oh, nice.
14:47 broquaint http://docs/vendadocs/VendaProduction/Wireframes/ACE_Generic_Content
14:47 mathw I'm wondering where the circularity issues come from
14:47 mathw does enum itself require Bool in order to work?
14:47 broquaint very ww :S
14:48 pmichaud mathw: no, but lots of builtins and internals want True and False to work.
14:48 mathw and enum requires some of those
14:48 mathw hmm
14:48 mathw True and False are pretty fundamental really
14:49 mathw which leads back to 'bool'
14:49 pmichaud rakudo:  enum MyBool { MyFalse MyTrue };  say MyTrue.succ;
14:49 p6eval rakudo 05684c: OUTPUT«Could not find sub &MyBool␤  in main program body at line 11:/tmp/k0WSSSWH7a␤»
14:50 pmichaud rakudo:  enum MyBool < MyFalse MyTrue >;  say MyTrue.succ;
14:50 p6eval rakudo 05684c: OUTPUT«2␤»
14:50 pmichaud rakudo:  enum MyBool < MyFalse MyTrue >;  say MyTrue.name;
14:50 p6eval rakudo 05684c: OUTPUT«Method 'name' not found for invocant of class 'Integer'␤  in main program body at line 11:/tmp/ebKr3V6byi␤»
14:51 pmichaud rakudo:  enum MyBool < MyFalse MyTrue >;  say MyBool;
14:51 p6eval rakudo 05684c: OUTPUT«MyFalse    0MyTrue 1␤»
14:51 pmichaud rakudo:  enum MyBool < MyFalse MyTrue >;  say MyTrue ~~ MyBool;
14:51 p6eval rakudo 05684c: OUTPUT«0␤»
14:51 skids joined #perl6
14:51 mathw this looks unencouraging
14:51 dalek rakudo: c18d372 | pmichaud++ | src/binder/bind.c:
14:51 dalek rakudo: Fix @a is copy (and %h is copy) when passed a scalar array or hash. Fixes RT
14:51 dalek rakudo: #76242 (masak++).
14:51 dalek rakudo: review: http://github.com/rakudo/rakudo/commit/c18d37293e143522e2c2f3870ee0e9068b77e5a4
14:52 * mathw &
14:52 jnthn pmichaud: Rakudo's current idea of enums is very much like what S12 has at the start of the enums seciton
14:52 jnthn e.g. just sugar for a bunch of constants
14:52 pmichaud jnthn: that's fine with me, I'm exploring the spec.  :-)
14:52 timbunce joined #perl6
14:53 pmichaud rakudo:  enum MyBool < MyFalse MyTrue >;  say 0 ~~ MyBool;
14:53 p6eval rakudo 05684c: OUTPUT«0␤»
14:53 pmichaud hmmm.
14:53 masak I suspect that one is filed.
14:53 * masak checks
14:53 pmichaud rakudo:  enum MyBool < MyFalse MyTrue >;  say MyBool.WHAT;
14:54 p6eval rakudo 05684c: OUTPUT«EnumMap()␤»
14:54 masak pmichaud: guess it's a manifestation of http://rt.perl.org/rt3/Ticket/Display.html?id=75296
14:54 masak it's not even a bug really, more like a TODO.
14:54 masak jnthn++ for making it work at all in the meantime.
14:55 JimmyZ hello, what's wrong with my bug report?
14:55 phenny JimmyZ: 22 Jun 11:23Z <masak> tell JimmyZ if moritz_ is right, and I think he is, a BOM must've snuck into your src/core/metaops.pm -- maybe you've edited that file?
14:56 masak JimmyZ: hi. what do you mean "what's wrong..."?
14:56 JimmyZ masak: I did a clean clone, and it builds now
14:56 JimmyZ ... I don't know...
14:57 JimmyZ 呵呵
14:57 masak heh. someone on Twitter thinks Rakudo Star released already: http://twitter.com/exussum/status/17256454939
14:57 steffan joined #perl6
14:58 jnthn omg tweets from the future! :-)
14:58 masak I told him this: http://twitter.com/carlmasak/status/17256876238
14:58 patspam joined #perl6
14:59 pmichaud it looks to me as though    enum Day <Mon Tue Wed>;   should create Day as a subclass of Int
14:59 pmichaud or subtype
14:59 pmichaud (could be a role)
14:59 ash_ a more styled web shell for try.rakudo.org, with an index of the tutorial: http://greaterthaninfinity.com/frontend/markup/shell.html any comments?
14:59 jnthn pmichaud: I was expecting mixing in a role
15:00 pmichaud jnthn: okay, so it subclasses Int and mixes in a role?
15:00 jnthn pmichaud: mixing in to an int automatically derives a subclass
15:00 jnthn *Int
15:00 jnthn So no need to do that first
15:00 colomon ash_: I like it, and my 22 month old does too (he's pointing in admiration at Camelia)
15:01 masak colomon: lol!
15:01 ash_ if you type "chapter index" plus enter it shows the chapters now
15:01 jnthn That is, 42 does role { method enum { return $enummap } } or some such creates a subclass that composes the role, re-blesses the 42 object into it
15:01 jnthn pmichaud: See operators.pm, infix:<does>
15:02 masak ash_: I would strongly advise against using hovering to show/hide things. that's been tried far too many times, and has led to madness in all documented cases.
15:02 jnthn pmichaud: You may find anonymous roles are handy here, anyway
15:02 pmichaud jnthn: that feels odd.  I have to think on it a bit.
15:02 jnthn pmichaud: Which bit? :-)
15:02 ash_ masak: alright, i'll try to find a better way of doing that
15:02 masak ash_: to be precise, showing/hiding things which *displace* other text is Wrong.
15:02 ash_ ya, i know what you mean
15:02 ash_ it makes it feel jump
15:02 ash_ jumpy*
15:03 masak also, it can lead to infinite update loops.
15:03 pmichaud anyway, I'm going to leave Bool alone for now; will write a response to the recent ticket.
15:03 masak sort of like the CSS version of time paradoxes.
15:03 masak pmichaud++
15:04 masak ash_: apart from that, I'm positively surprised (this is the first time I look) at how nice the design is, and how well it fits with the rest of perl6.org's "look".
15:04 masak ash_++
15:04 ash_ thats where i stole the styles for part of it :P (hope no one minds)
15:04 pmichaud on a related question....    what do we do with   %hash.pick   ?
15:04 masak ash_: au contraire, I suspect.
15:05 masak pmichaud: pick a pair?
15:05 jnthn ash_: It looks nice
15:05 jnthn ash_++
15:05 ash_ i modified the colors some, but yeah, its the same basic stuff
15:05 masak I guess I *could* argue for "pick a key" as well, but pair feels righter.
15:05 pmichaud so,   Bool.pick returns a bool, while Bool.enums.pick would return a Pair.
15:06 masak pmichaud: that makes sense.
15:06 pmichaud (assuming Bool is an enum)
15:06 masak :)
15:06 pmichaud that's a pretty convincing case that an enum type is not an EnumMap :)
15:06 pmichaud (it may contain an EnumMap, but it isn't one)
15:07 jnthn pmichaud: Agree.
15:07 pmichaud rakudo:  enum Day <Mon Tue Wed>;  say Day.pick;
15:07 p6eval rakudo 05684c: OUTPUT«Wed        2␤»
15:07 pmichaud rakudo:  enum Day <Mon Tue Wed>;  say Day.pick;
15:07 p6eval rakudo 05684c: OUTPUT«Tue        1␤»
15:08 JimmyZ rakudo: enum Day <Mon Tue Wed>; say Day.pick.WHAT;
15:08 p6eval rakudo 05684c: OUTPUT«Pair()␤»
15:08 JimmyZ looks like array of pair?
15:09 masak bug?
15:09 masak oh wait.
15:09 masak it's the same one again :P
15:12 songmaster joined #perl6
15:13 tadzik joined #perl6
15:13 pmichaud ticket #76238 updated
15:14 masak \o/
15:14 masak I'm still in the camp favoring Bool as an enum type.
15:15 pmichaud I'm idly wondering if    int ~~ Int
15:15 pmichaud (and, by analogy, if  bool ~~ Bool)
15:15 masak pmichaud: based on what sorear said TimToady said the other day, yes.
15:15 jnthn Given comments by TimToady recently, I suspect so.
15:15 pmichaud I'm pretty sure it would have to be that way.
15:16 pmichaud but I guess that also implies that int ~~ Cool   and int ~~ Any
15:16 masak sure.
15:16 jnthn that's fine
15:16 jnthn They just have to be boxed before you can call any methods on them.
15:16 jnthn So by the time they're seen as an invocant in a Cool or Any method, they're an Int.
15:16 pmichaud so I'm wondering if we can make 'bool' work.
15:16 pmichaud or even 'int', for that matter.
15:17 pmichaud then our builtins could start returning bool
15:17 masak how does one create a bool?
15:17 pmichaud iiuc, it's just a bit
15:17 masak `my bool $b = 1`?
15:17 pmichaud internally, we'd probably use an int in parrot
15:18 pmichaud i'm more curious about  what happens with   &prefix:<?> then
15:18 pmichaud can it return a bool?
15:18 ash_ if anyone else wants a copy of the code i am using to do basic highlighting in the web shell, let me know, i can make it a separate entity
15:19 pmichaud (same for the other boolean-returning methods)
15:20 pmichaud in fact, I wonder what would happen if we simply converted our existing "Bool" type to instead be "bool", and then (for now) derived Bool from it.
15:20 pmichaud do typed enums work in Rakudo yet?  i.e.,    my Str enum .... ?
15:21 pmichaud actually, deriving Bool from bool can't work, because  bool ~~ Bool
15:22 pmichaud (at least, not in the inheritance notion of "derive")
15:24 jnthn pmichaud: The trouble is, I think we're not all the way there with these definitions yet.
15:24 pmichaud jnthn: right, I'm trying to explore it a bit.
15:24 jnthn Take Num, for example
15:24 jnthn (Because it's easiest one to discuss in isolation.)
15:24 pmichaud in particular, I think I can find the contradiction that results from trying to make a Bool an enum.)
15:25 pmichaud or at least find *a* contradiction that has to be resolved.
15:25 jnthn We'd say num ~~ Num
15:25 masak ash_: I typed 'my @a = <a b c>', and got 'my @a = ' in the history. perhaps needs an escaping step?
15:25 ash_ yup, haven't hit that issue yet, thanks
15:25 jnthn In that num is a constrained version of Num (constrained not by range of representable values in this case, but by representation)
15:25 jnthn BUT
15:25 jnthn I would also expected to have
15:26 jnthn class Num { has num $.num; ... }
15:26 jnthn That is, it has a low-level num inside it.
15:26 pmichaud oh, I don't quite expect that second part.
15:26 pmichaud I think that builtin types are allowed to cheat quite liberally on internal representation.
15:26 pmichaud I think they have to.
15:26 redicaps joined #perl6
15:26 jnthn *sigh*
15:26 jnthn No, that's just nasty.
15:26 masak ash_: "123.456" is color-coded, but not "123e42"
15:27 jnthn OK, on what num means under the hood, yes, some cheating is fine.
15:27 masak ash_: the history doesn't scroll to the bottom when there's more than a screenful.
15:27 ash_ hmm, i don't do the e syntax yet, i'll add that too
15:27 masak ash_: STD.pm6 is a good hint :)
15:27 ash_ which browser?
15:27 jnthn But we should know how, in Perl 6, to write class Num { ... }
15:27 jnthn And define that it has some underlying storage
15:27 masak ash_: Google Chrome on a Mac.
15:27 jnthn Because, after all, we need to be able to define compact structs made up of natively typed attributes too.
15:27 ash_ its using javascript to scroll to the bottom... so that might be tricky
15:28 ash_ hmm, i am using chrome on a mac too, i'll look into it
15:28 pmichaud jnthn: sure, but compact structs aren't invoking the circularity saw
15:28 masak ash_: it seems to scroll a part of the way down.
15:28 pmichaud defining Num in terms of num is.
15:28 jnthn pmichaud: Only because we define num in terms of Num
15:29 jnthn pmichaud: That's the bit that makes me uncomfortable.
15:29 pmichaud it's a similar problem with int and Int
15:29 masak ash_: I'm on the fence whether errors should have the little '→' prefix just like the results do.
15:29 jnthn It feels like the primitive types should be, well, the primitives.
15:29 pmichaud well, there's certainly little to prevent Num.ACCEPTS  from special-casing num
15:30 pmichaud anyway, that wasn't where I was headed.
15:30 pmichaud for any    my X enum Y ....
15:30 jnthn Yes, I wanted to avoid int vs Int at this point because Int has the added complexity of needing to handle big-ints too, iirc.
15:30 pmichaud we have that elements of Y ~~ X
15:30 pmichaud for example:  my Int enum Day <Mon Tue>;    Mon ~~ Int   # true
15:31 TiMBuS kraih So #rakudo doesn't even support sockets yet and they are already porting cgi frameworks? I smell a marketing desaster.
15:31 jnthn wtf
15:31 TiMBuS what is up with this FUDdery
15:31 tadzik no sockets?
15:31 jnthn Rakudo supports sockets.
15:31 tadzik trololololo…
15:31 jnthn Nice spelling desaster too ;-)
15:31 TiMBuS trolling on twitter? why i never
15:32 pmichaud I think the original author might be confusing "sockets" with "non-blocking sockets"
15:32 TiMBuS thats what im thinking
15:32 jnthn pmichaud: I had once envisioned it along the lines of...
15:32 pmichaud so, if we do    my bool enum Bool <False True>
15:33 jnthn Oh, hm
15:33 pmichaud ah, it works differently for native types
15:33 pmichaud okay, so that's plausible
15:33 pmichaud I wish I knew what to call the   "false" and "true" values of "bool"
15:34 pmichaud (i.e., as constants)
15:34 pmichaud are they just 0 and 1?  since native values don't know their own type?
15:34 jnthn For non-native ones, I expected the implementation may be that the enum type name itself is a role that we generate. We then mix it in to each of the values, but with a different "current value" set
15:34 jnthn pmichaud: Yes, I believe so
15:35 jnthn pmichaud: I think the enum spec has some language on that
15:35 pmichaud jnthn: that's what I'm reading now :)
15:35 masak pmichaud: that's what I meant earlier with "how do you create a bool"?
15:35 pmichaud masak: yes
15:35 ingy I find it odd that this fails: http://nopaste.snit.ch/21637
15:35 jnthn oh eww
15:35 jnthn 3 ~~ Day    # True, using Day as a subset of Int
15:36 masak ingy: you must declare before you use.
15:36 masak ingy: it's the one-parse thing, you know.
15:36 ingy It masak that's what I find odd
15:36 pmichaud also, can't have two semicolon declarations in a single file.
15:36 masak ingy: Perl 6 is strictly one-pass.
15:36 masak ingy: I wrote a long mail on p6l about it some months ago, and TimToady wrote a long email back :)
15:36 pmichaud i.e., it would need to be  class Document::Section { ... }   and not class Document::Section;
15:37 jnthn ingy: If you want to go "out of order" in terms of definitions, it's fine, but you need to declare a stub earlier.
15:37 macdaddy joined #perl6
15:38 masak ingy: here: http://www.nntp.perl.org/group/perl.perl6.language/2010/01/msg33141.html
15:38 ingy so when does the 'has' assignment actually happen?
15:38 pmichaud okay, well, thinking about enums is very interesting, but it's not on the critical path for R* so I think I'll suspend it for now and work on something else :)
15:38 pmichaud ingy: when an instance is created, iirc.
15:38 ingy that's good
15:38 ingy at least what I wanted
15:38 jnthn ingy: What pm said - the thingy on the RHS is actually "thunked"
15:39 jnthn Gets promoted to an anonymous method.
15:39 jnthn So you can do like has $.a; has $.b; has $.c = $.a + $.b;
15:40 steffan left #perl6
15:40 ingy thanks :)
15:40 masak rakudo: class A { ... }; class B { has A $.a }; class A { has B $.b }; say "alive"
15:40 p6eval rakudo 05684c: OUTPUT«alive␤»
15:41 jnthn Nice try. :P
15:41 masak wasn't actually trying to break things :P
15:41 ash_ masak: i can change the error prefix to be something more noticeable so you can tell the difference easier, maybe a ! or ‽
15:41 masak just showing how to make two classes use each other.
15:41 masak ash_: is there a skull in Unicode? :)
15:42 masak .u skull
15:42 phenny U+2620 SKULL AND CROSSBONES (☠)
15:42 masak ash_: use that :)
15:42 ash_
15:42 ash_ lol
15:42 ash_ k
15:42 masak ash++
15:42 ash_ html entity &#9760;
15:42 masak er, ash_++
15:42 masak rakudo: say :16<2620>
15:42 p6eval rakudo 05684c: OUTPUT«9760␤»
15:42 masak yup.
15:43 _sri TiMBuS: kraih is me, and i meant to write non blocking sockets but ran out of chars :)
15:43 _sri btw. the offer still stands, my firstborn for non blocking sockets!
15:44 pmichaud 15:41 <masak> wasn't actually trying to break things :P
15:44 pmichaud ....somehow I don't quite believe that.  :-)
15:44 pmichaud I think masak is always on the lookout for possible breakages :)
15:44 masak pmichaud: I swear, most of the time when I do break stuff, it's not deliberate! :P
15:44 pmichaud masak: I *do* believe that.  :)
15:44 ash_ when is the 12e123 valid? (i guess i could find it in the spec... S02?)
15:45 masak ash_: anywhere a term is valid, I guess.
15:45 ash_ but can you do 0b01210e123
15:45 masak ash_: you do realize that you're about to write a Perl 6 parser here?
15:45 ash_ is more my point
15:45 ash_ shhh only select bits
15:45 masak ash_: how will you decide which bits to fail on?
15:46 ash_ std: 0b01210e123
15:46 p6eval std 31481: OUTPUT«[31m===[0mSORRY![31m===[0m␤Whitespace is required between alphanumeric tokens at /tmp/tdYazMUpXi line 1:␤------> [32m0b01[33m⏏[31m210e123[0m␤Two terms in a row at /tmp/tdYazMUpXi line 1:␤------> [32m0b01[33m⏏[31m210e123[0m␤    expecting any of:␤    POST␤   bracketed
15:46 p6eval ..infix␤   i…
15:46 ash_ dumbly
15:46 masak ash_: I admire your optimism.
15:46 ash_ 123e123
15:46 ash_ std: 123e123
15:46 p6eval std 31481: OUTPUT«ok 00:01 106m␤»
15:46 masak ash_: here's hoping that what you end up with won't be too messy.
15:47 ash_ http://github.com/moritz/try.rakudo.org/blob/master/frontend/markup/shell.html#L14 lines 14~35 are all of my highlighting to date
15:47 ash_ its pretty dumb so far, but i am not trying to hard to make it perfect, just good enough that the web shell looks alright
15:48 pmichaud while I definitely do not want to stifle ambition here, I do hope that the effort to syntax highlight doesn't distract too much from the overall goal of having an interactive web-based perl 6 shell.
15:49 ash_ cygx is doing the backend of it, so i am waiting on him to evaluate the content, i am just working on the front end since its something i am capable of
15:49 rv2733 joined #perl6
15:49 pmichaud ash_++   sounds like you have it well-handled then :)
15:50 ash_ right now, aside from the highlighting corrections masak++ found, i am adding a tutotrial thing, mostly I am planning on expecting a certain result, so if the example says "enter 1 + 2", i'll look for 3 in the stdout
15:51 Ross joined #perl6
15:51 ash_ i am trying to come up with a good way of designing those steps, plus i have the index of the chapters now so I can figure out what goes where when I need to build examples, if you type "chapter index" in the terminal it will show you the chapters
15:52 ash_ i'll probably also start with a brief tutorial on how to use the terminal before starting perl6, (a chapter 0 really)
15:52 pmichaud there should always be a chapter 0.  :)
15:53 bbkr rakudo: say "foo" ~~ /<[d..b]>? foo/
15:53 p6eval rakudo 05684c: OUTPUT«foo␤»
15:53 ash_ should i say "perldoc" instead of "help" for looking up definitions? (since that might be more like what you would do in the terminal)
15:54 TiMBuS _sri, i asked a few places (perl 5 hackers) what they thought about the perl 6 logo and um.
15:54 TiMBuS they were very honest.
15:54 TiMBuS they prefer yours to say the least
15:56 _sri TiMBuS: i'll release it in a different form than originally planned, but under cc-share-alike to allow remixing and stuff
15:56 IllvilJa joined #perl6
15:56 TiMBuS good idea
15:57 sftp joined #perl6
15:57 masak wow, subs defaulting to 'my' feels more and more right every day!
15:57 plainhao joined #perl6
15:57 mathw masak: yes it is nice isn't it
15:58 masak mathw: it's like having Scheme, but with a sane syntax.
15:58 ash_ _sri, TiMBuS: its not done yet by any means, but have you guys seen: http://greaterthaninfinity.com/frontend/markup/shell.html ? its the current design I am working with for an interactive web terminal for rakudo star
15:58 tadzik subs defaulting to 'my'?
15:59 TiMBuS heey thats cool
15:59 _sri TiMBuS: btw. i'm honestly worried about all the cgi stuff going on, it could totally backfire marketing wise
15:59 pmichaud _sri: what would you suggest instead?
15:59 mathw masak: an altogether completely more awesome syntax
16:00 TiMBuS he wants nonblocking sockets. id settle for threads :3
16:00 ingy is there a way to get .perl to dump objects deeply?
16:00 mathw if you have threads, you can write a non-blocking I/O layer
16:01 pmichaud (I mean to avoid the "marketing disaster")
16:01 _sri pmichaud: non blocking sockets and a sweet http 1.1 api (which i'll be able to provide)
16:02 ashleydev joined #perl6
16:02 pmichaud _sri: and you're saying that without that, we'll have a disaster?
16:02 ingy when I say Document.new.perl I get >>Document.new()<<
16:02 _sri pmichaud: thats not what i said
16:03 pmichaud _sri: okay, I don't mean to misquote or misinterpret.
16:03 ingy even if the object has been populated
16:03 _sri pmichaud: i said by nurturing a culture of cgi hacking you are likely to have a disaster
16:04 arnsholt ingy: Not at the moment, AFAIK
16:04 pmichaud ingy: we don't have a generic .perl for objects yet, no.
16:04 ingy ok
16:05 pmichaud I suppose we could see about writing one that introspects the attributes and dumps them.
16:05 ingy :)
16:05 ingy one more newbie q
16:05 ingy how do I get a unique id on an object
16:05 ingy is there a .id?
16:06 pmichaud _sri: I don't see the disaster, but accept that there could be one.
16:06 pmichaud ingy: perhaps .WHICH ?
16:06 pmichaud rakudo:  my $a = Int.new;  my $b = Int.new;  say $a.WHICH;  say $b.WHICH;
16:06 jnthn _sri: I'm not sure I follow. Yes, there are better ways to do things than CGI, but it's hardly like nobody ever writes/deploys CGIs any more.
16:07 p6eval rakudo 05684c: OUTPUT«0␤0␤»
16:07 pmichaud oh, bad example.
16:07 [particle] ha, really bad example.
16:07 pmichaud rakudo:  my $a = Array.new;  my $b = Array.new;  say $a.WHICH;  say $b.WHICH;
16:07 p6eval rakudo 05684c: OUTPUT«80887408␤80885392␤»
16:07 jnthn _sri: Plus there *is* a basically working HTTP server.
16:07 jnthn I think mberends++ is hacking on stuff in that area.
16:07 jnthn So CGI is not the only option Rakudo offers either.
16:08 jnthn _sri: But granted I may have missed your point entirely.
16:09 pmichaud besides, the way to get non-blocking sockets implemented will be for us to have enough people interested in Rakudo to hit upon someone that decides they want it badly enough to investigate what's needed to implement them.  :)
16:09 ingy pmichaud: nice. it's interesting that WHICH just gives a stringification for strings...
16:09 ingy is that on purpose?
16:09 pmichaud .WHICH on value types basically returns the values
16:09 pmichaud see S12? S13?  for a more thorough description of what .WHICH actually does.
16:10 ingy fair enough
16:10 ingy thanks!
16:11 _sri /me gives up
16:12 justatheory joined #perl6
16:13 _sri i accept that marketing has no place in this channel
16:13 masak it might.
16:14 pmichaud _sri: I'm trying to understand, really.
16:15 ash_ joined #perl6
16:16 masak _sri: my reaction to that tweet was "huh, someone who thinks we're more organized and less volunteer-based than we actually are"
16:16 _sri i could argue all day about perl5 still being haunted by the 90s... but i think we would keep spinning round and round...i'm tired :(
16:16 ash_ non-blocking IO, do you mean like using select? or fork?
16:16 masak _sri: seems no-one really is in disagreement with you.
16:16 ash_ can current rakudo fork?
16:17 pmichaud ash_: I'm guessing it's along the lines of select.
16:17 _sri non blocking sockets + poll/epoll/kqueue
16:18 pmichaud I don't really know what Parrot has in mind for that.
16:21 _sri without you can pretty much forget about websockets
16:22 pmichaud _sri: I'm speculating that somewhere you've read or seen something that implies that we're trying to market Rakudo to cgi hackers.
16:22 pmichaud perhaps others are doing that, but I don't think I've done anything to market specifically to cgi.
16:22 ash_ the only reason i have tried using rakudo with cgi is cgi is dead simple
16:22 _sri pmichaud: my fear was triggered by moritz_ mumbling about porting cgi frameworks
16:23 pmichaud ...which iirc was itself in response to someone saying we need a Perl 6 forum written in perl 6.
16:23 pmichaud which, btw, I totally disagree with.
16:23 jnthn Doesn't the world have enough forum software? :-)
16:23 masak if I use the fat comma for formatting purposes, am I totally evil? :>
16:23 pmichaud I'm all in favor of new forum software, written in Perl 6.
16:24 pmichaud But if we're looking at that as a short-term project, I think it a bit unrealistic.
16:24 pmichaud so I think we need to set expectations.  If we want a forum -soon- for Perl 6 specific discussions, we shouldn't require it to be written in Perl 6.
16:24 masak I just realized that instead of `say something(), "\t", something-else();`, I could write `say something() => something-else();` with the same effect.
16:24 jnthn masak: heh
16:24 pmichaud If we want to have some forum software written in Perl 6, that's great too, but we shouldn't expect to have it soon.
16:24 masak mwhaha.
16:25 jnthn masak: Relying on how pairs stringify.
16:25 masak aye.
16:25 jnthn masak: I guess that's spec'd, tested and kosher.
16:25 jnthn :-)
16:25 masak jnthn: probably not very maintainable, though.
16:25 jnthn masak: It will, however, probably confuse some newbie who reads your code. :-)
16:25 masak right.
16:26 * pmichaud decides to comment to the perl6 mongers post
16:26 pmichaud er, perlmonks
16:26 skids joined #perl6
16:26 Su-Shee joined #perl6
16:33 ash_ masak: sub amp { }; say &amp;   # that works in my console now, that one was trixy
16:33 masak ash_: as in 'trixy to color-code'?
16:34 ash_ yeah, since &amp; is html for &
16:35 masak ah, right.
16:35 masak yes, that one is often tricky to get right, when implementing an escaper. :)
16:35 masak it does help that Str.trans does all the replacements in one go...
16:35 masak ...but I guess this is js, not p6. :)
16:38 pugssvn r31482 | bbkr++ | t[t/spec/S06-signature/slurpy-params.t] tests for RT #72600 if statements clobber @_ in Rakudo
16:39 ash_ str_obj.replace(/reg/g, "Replacement"); works in javascript, but since i have multiple passes to do various things like highlight $var's it was seeing &amp; as not a variable (since &amp; gets translated to &amp;amp; it was trying to highlight the wrong part of it)
16:39 masak swimming &
16:40 hercynium joined #perl6
16:41 Trashlord joined #perl6
16:43 kloeri joined #perl6
16:56 cdarroch joined #perl6
16:56 cdarroch joined #perl6
17:04 pugssvn r31483 | bbkr++ | [t/spec/S06-multi/type-based.t] tests for RT #72750 Make Inf and NaN acceptable constants parameters in Rakudo
17:05 bbkr tickets closing day :)
17:06 colomon bbkr++
17:07 pmichaud yes, I tried to do things so that we'd have some tickets to close :)
17:07 bbkr pmichaud++
17:08 meppl joined #perl6
17:17 bbkr rakudo: say (4...^5).perl # is this correct output?
17:17 p6eval rakudo c18d37: OUTPUT«((4, 3, 2, 1, 0), [1, 2, 3, 4])␤»
17:18 pmichaud bbkr: I claim the current definition of .perl in the spec is a bit ambiguous.
17:18 cxreg so what's the deal with STM?  looks like it was removed from parrot last year?  is it still part of the design?
17:18 bbkr rakudo: say (4 ... 0 .. 5)
17:18 p6eval rakudo c18d37: OUTPUT«4321012345␤»
17:18 pmichaud anyway, testing a result based on .perl is generally not the best way to test
17:19 pmichaud rakudo: say (4...^5).elems  # just curious
17:19 p6eval rakudo c18d37: OUTPUT«9␤»
17:19 pmichaud good.
17:19 bbkr pmichaud: thanks, I was checking if http://rt.perl.org/rt3/Ticket/Display.html?id=72912 can be closed
17:20 pmichaud since .perl now works on &infix:<...>, I think so.
17:21 mberends joined #perl6
17:25 cygx joined #perl6
17:31 [Coke] cxreg: parrot questions are generally better asked in #parrot on irc.parrot.org - but yes, I don't think STM is currently expected to make a comeback. I'm not sure that the version we had was ever in trunk or finished.
17:39 Mowah joined #perl6
17:40 cygx left #perl6
17:42 [Coke] joined #perl6
17:47 ash_ ping cygx ?
17:47 ash_ doh i think he left already
17:48 proller joined #perl6
17:54 hejki_ joined #perl6
17:55 spinclad_ joined #perl6
18:01 hatsefla1s joined #perl6
18:01 pjcj_ joined #perl6
18:01 mdxi_ joined #perl6
18:01 proller joined #perl6
18:01 [Coke] joined #perl6
18:01 Mowah joined #perl6
18:01 mberends joined #perl6
18:01 meppl joined #perl6
18:01 kloeri joined #perl6
18:01 ash_ joined #perl6
18:01 justatheory joined #perl6
18:01 plainhao joined #perl6
18:01 sftp joined #perl6
18:01 IllvilJa joined #perl6
18:01 rv2733 joined #perl6
18:01 Guest3330 joined #perl6
18:01 Guest23195 joined #perl6
18:01 PacoLinux joined #perl6
18:01 alester joined #perl6
18:01 RAT joined #perl6
18:01 perlygatekeeper joined #perl6
18:01 pnate joined #perl6
18:01 xinming joined #perl6
18:01 felliott joined #perl6
18:01 shade_ joined #perl6
18:01 felipe joined #perl6
18:01 synth joined #perl6
18:01 opx^away joined #perl6
18:01 Gothmog_ joined #perl6
18:01 tomaw joined #perl6
18:01 thepler joined #perl6
18:01 eiro joined #perl6
18:01 colomon joined #perl6
18:01 pmichaud joined #perl6
18:01 foodoo joined #perl6
18:01 rcsheets joined #perl6
18:01 PZt joined #perl6
18:01 bbkr joined #perl6
18:01 dual joined #perl6
18:01 buubot joined #perl6
18:01 cono joined #perl6
18:01 ciphertext joined #perl6
18:01 stef_ joined #perl6
18:01 skangas joined #perl6
18:01 exodist joined #perl6
18:01 sawyer_ joined #perl6
18:01 ingy joined #perl6
18:01 hugme joined #perl6
18:01 stepnem joined #perl6
18:01 japhb joined #perl6
18:01 Lorn joined #perl6
18:01 constant joined #perl6
18:01 sykes_ joined #perl6
18:01 sjohnson joined #perl6
18:01 cls_bsd joined #perl6
18:01 LionMadeOfLions joined #perl6
18:01 mantovani joined #perl6
18:01 knewt2 joined #perl6
18:01 yahooooo joined #perl6
18:01 cosimo_ joined #perl6
18:01 Solarion joined #perl6
18:01 lestrrat joined #perl6
18:01 zakame joined #perl6
18:01 dalek joined #perl6
18:01 kst joined #perl6
18:01 charsbar joined #perl6
18:01 Woody2143 joined #perl6
18:01 cognominal joined #perl6
18:01 nsh_ joined #perl6
18:01 Grrrr joined #perl6
18:01 athomason joined #perl6
18:01 sunnavy joined #perl6
18:01 dukeleto joined #perl6
18:01 BinGOs joined #perl6
18:01 lucs joined #perl6
18:01 wolverian joined #perl6
18:01 gabiruh joined #perl6
18:01 frew joined #perl6
18:01 chitragupt joined #perl6
18:01 pnu joined #perl6
18:01 literal joined #perl6
18:01 zamolxes joined #perl6
18:01 pugssvn joined #perl6
18:01 nothingmuch joined #perl6
18:01 baest joined #perl6
18:01 awwaiid joined #perl6
18:01 PerlJam joined #perl6
18:01 fda314925 joined #perl6
18:01 Juerd joined #perl6
18:01 bkeeler joined #perl6
18:01 frodwith joined #perl6
18:01 Maddingue joined #perl6
18:01 f00li5h joined #perl6
18:01 TimToady joined #perl6
18:01 jnthn joined #perl6
18:01 moritz_ joined #perl6
18:01 buu joined #perl6
18:01 cxreg joined #perl6
18:01 sbp joined #perl6
18:01 yves__ joined #perl6
18:01 phenny joined #perl6
18:01 m6locks joined #perl6
18:03 ascent_ joined #perl6
18:04 patch_ joined #perl6
18:04 imarcust1is joined #perl6
18:05 spinclad joined #perl6
18:05 cuppe_ joined #perl6
18:06 dimid joined #perl6
18:07 skids joined #perl6
18:07 kfo joined #perl6
18:07 ilogger2 joined #perl6
18:07 17SAA0FUI joined #perl6
18:07 hejki joined #perl6
18:07 pjcj joined #perl6
18:07 Ambiguity joined #perl6
18:07 kfo joined #perl6
18:08 Trashlord joined #perl6
18:10 Ambiguity joined #perl6
18:29 stef_ joined #perl6
18:29 timbunce joined #perl6
18:35 cuppe joined #perl6
18:36 cuppe rakudo: my @squares = gather for 0 .. Inf { take $_*$_ }; say 1;
18:36 p6eval rakudo c18d37:  ( no output )
18:37 cuppe hm
18:37 cuppe shouldn't that work and give 1
18:37 mberends some of it is not lazy yet
18:38 mberends for, probably
18:38 ash_ joined #perl6
18:38 cuppe hm
18:38 dakkar joined #perl6
18:39 [particle] i don't like the lack of spaces there
18:39 [particle] rakudo: my @squares = gather for 0 .. Inf { take $_ * $_ }; say 1;
18:40 p6eval rakudo c18d37:  ( no output )
18:40 cuppe that's how I would type it in code
18:40 colomon it should not work.
18:40 colomon or at least, it shouldn't work yet.
18:40 cuppe should it work...eventually?
18:40 colomon I don't know.
18:40 colomon pmichaud?
18:40 cuppe it's a wikipedia example
18:41 colomon For perl 6?
18:41 cuppe http://en.wikipedia.org/wiki/Perl_6#Gather
18:42 colomon rakudo: say $squares = gather for 0 .. Inf { take $_ * $_ }; say 1; # should work
18:42 p6eval rakudo c18d37: OUTPUT«===SORRY!===␤Symbol '$squares' not predeclared in <anonymous> (/tmp/q49fB8Dkng:11)␤»
18:42 [particle] rakudo: say 0 * 0
18:42 p6eval rakudo c18d37: OUTPUT«0␤»
18:42 colomon rakudo: my $squares = gather for 0 .. Inf { take $_ * $_ }; say 1; # should work
18:42 [particle] that's not a square.
18:42 p6eval rakudo c18d37: OUTPUT«1␤»
18:43 cuppe rakudo: my $squares = gather for 0 .. Inf { take $_ * $_ }; say $squares.perl;
18:43 p6eval rakudo c18d37:  ( no output )
18:43 ash_ rakudo: my $squares = gather for 0 .. Inf { take $_ * $_ }; say $squares.WHAT;
18:43 [particle] rakudo: my @squares = gather for ^Inf { take $_ * $_ }; say $squares[3];
18:43 p6eval rakudo c18d37: OUTPUT«List()␤»
18:43 p6eval rakudo c18d37: OUTPUT«===SORRY!===␤Symbol '$squares' not predeclared in <anonymous> (/tmp/EuTmu3056z:11)␤»
18:43 colomon cuppe: you have to watch for trying to evaluate infinite lists.
18:43 [particle] rakudo: my $squares = gather for ^Inf { take $_ * $_ }; say $squares[3];
18:43 p6eval rakudo c18d37: OUTPUT«9␤»
18:43 cuppe colomon: of course
18:44 pmichaud right now, rakudo stops eagerly evaluating only on those things that it can provably determine are infinite
18:44 colomon $squares.perl will do that.
18:44 [particle] rakudo: my $squares = gather for 1 .. Inf { take $_ * $_ }; say $squares[3];
18:44 p6eval rakudo c18d37: OUTPUT«16␤»
18:44 [particle] yep, works
18:44 pmichaud a gather/take loop isn't provably infinite, for the most part :-)
18:44 * cuppe goes to read up on sigils again
18:45 colomon cuppe: what pmichaud is saying is that @a = infinite list will only work in certain limited cases.
18:45 colomon very limited at the moment, as far as I know.
18:45 pmichaud yes
18:45 pmichaud we might be able to get .map and .grep to transitively determine infinite-ness
18:45 cuppe why is this working with $squares
18:46 pmichaud because assignment to a scalar isn't eager
18:46 pmichaud assignment to an array is eager
18:46 armagad joined #perl6
18:46 colomon when you assign to @squares, it tries to find the first value, then second, etc.
18:46 ash_ can you do something like:   (gather for 1..Inf { take $_ * $_ }).lazy; ?
18:46 ash_ or lazy gather ...
18:46 colomon when you assign to $squares, it just puts the List object in $squares.
18:47 ash_ (with list assignment)
18:47 pmichaud ash_: I suppose that .lazy could somehow be a list that always reports true for infiniteness
18:47 pmichaud but that gets tricky with things like .elems then
18:47 colomon seems like that is confusing laziness with infinite-ness.
18:47 pmichaud it's really a question of "mostly eagerness"
18:48 pmichaud and when something that is "mostly eager" (such as array assignment) should stop evaluating.
18:48 ash_ i expect the lazyness of gather/take to catch some people by surprise, especially with 1..* ranges
18:49 pmichaud I think there are surprises no matter what we do.
18:49 pmichaud So the question is where to put the surprises, or how to minimize them.
18:50 ash_ rakudo: my @a = 1..*; for @a { last }; # what if someone tries that?
18:50 pmichaud that works out fine.
18:50 p6eval rakudo c18d37:  ( no output )
18:50 pmichaud rakudo:  my @a = 1..*; for @a { say $_; last; }
18:50 colomon rakudo: my @a = 1..*; for @a { last }; say "got here"
18:50 colomon the suspense is killing me.
18:51 pmichaud I'm wondering why there's suspense.  :)
18:51 ash_ i think its timing out with p6eval (it might work locally, haven't checked)
18:51 p6eval rakudo c18d37:  ( no output )
18:51 p6eval rakudo c18d37:  ( no output )
18:51 colomon ash_: it should be very fast
18:51 colomon works locally
18:51 pmichaud > my @a = 1..*;  for @a { say $_; last; }
18:51 pmichaud 1
18:51 pmichaud works here.
18:51 ash_ ah, i didn't try it locally, i kinda assumed it was going into an infinite loop
18:52 pmichaud rakudo:  my @a = 1..*;
18:52 pmichaud something isn't right there.
18:52 p6eval rakudo c18d37:  ( no output )
18:52 pmichaud rakudo:  my @a = 1..*; say 'alive';
18:52 ash_ maybe p6eval is out of date?
18:52 colomon c18d37 is latest
18:52 p6eval rakudo c18d37:  ( no output )
18:52 pmichaud yeah, I'm thinking p6eval is out of date, even though it appears to be reporting the correct git revision
18:52 ash_ rakudo: say 'testing'
18:52 p6eval rakudo c18d37: OUTPUT«testing␤»
18:53 colomon rakudo: say 4 %% 3
18:53 p6eval rakudo c18d37: OUTPUT«===SORRY!===␤Confused at line 11, near "say 4 %% 3"␤»
18:53 colomon oooo, definitely out of date.
18:53 pmichaud it's definitely out of date.
18:53 colomon that's an ugly p6eval bug.
18:53 ash_ its lying about its version, eh?
18:53 colomon yes
18:53 pmichaud where's the RT for p6eval?!?  I want to channel masak++!
18:54 ash_ maybe someone could add the git id to $?PERL.version
18:54 ash_ ?
18:54 ash_ or is that not worth the effort
18:54 pmichaud ash_: where would we get it from?
18:54 ash_ git? (if its installed? at compile time?)
18:55 ash_ if not thats fine
18:55 pmichaud and why would we believe it any more than whatever p6eval is reporting now?  presumably p6eval gets it from the same place :-)
18:55 ash_ just thinking
18:55 ash_ well, if its added to the settings or something at compile time... it shouldn't change...?
18:56 pmichaud maybe we can do something with git describe
18:57 pmichaud ah, we can put git-describe into a generated file
18:57 pmichaud and use it
18:57 ash_ rakudo: say $?PERL.version
18:57 p6eval rakudo c18d37: OUTPUT«===SORRY!===␤Symbol '$?PERL' not predeclared in <anonymous> (/tmp/kyzYCGPscl:11)␤»
18:57 cuppe so I have another thing that's confusing me. I noticed that BUILD kills any initialized values you gave variables. so I can create them in the BUILD, except they don't seem to keep values
18:58 cuppe rakudo: class Data { submethod BUILD { has $.user = 13;}}; say Data.new.user;
18:58 p6eval rakudo c18d37: OUTPUT«Any()␤»
18:58 colomon rakudo: class Data { has $.user; submethod BUILD { $.user = 13;}}; say Data.new.user;
18:58 p6eval rakudo c18d37: OUTPUT«Cannot assign to readonly value␤  in '&infix:<=>' at line 1␤  in 'Data::BUILD' at line 11:/tmp/SJlRxmNmmd␤  in main program body at line 11:/tmp/SJlRxmNmmd␤»
18:59 ash_ rakudo: class Data { has $.user is rw; submethod BUILD { $.user = 13;}}; say Data.new.user;
18:59 pmichaud inside of build, use $!user
18:59 p6eval rakudo c18d37: OUTPUT«13␤»
18:59 colomon rakudo: class Data { has $.user; submethod BUILD { $!user = 13;}}; say Data.new.user;
18:59 p6eval rakudo c18d37: OUTPUT«13␤»
19:00 cuppe oh okay. my problem that I was leading at was creating readonly variables with initial values
19:00 cuppe and that'll solve that
19:00 masak joined #perl6
19:00 pmichaud afk
19:00 pmichaud bbl
19:01 hejki joined #perl6
19:01 emadum joined #perl6
19:02 pyrimidine joined #perl6
19:03 shade_ joined #perl6
19:11 rindolf joined #perl6
19:12 cuppe if a scalar can hold a List type...what's special about arrays
19:14 masak cuppe: they convey list context.
19:14 masak cuppe: they also narrow things down to something Positional, often an Array.
19:14 masak think of it as a small, cute type system :)
19:15 masak hm, I seem to have interpreted your question as "what's so special about the @ sigil?" -- hope that's what you meant. :)
19:15 cuppe but surely I can force list context in some other way, like () in p5
19:15 masak sure.
19:15 masak it's just for convenience.
19:15 masak but the convenience is quite significant, I would say.
19:15 cuppe yeah
19:16 mberends \o masak
19:16 cuppe so I can create scalars of hashes too then. or any type
19:16 masak cuppe: yes, scalars are the generic type.
19:16 masak mberends: o/
19:18 mberends masak: after porting half of HTTP::Server::Simple::PSGI, I discovered that I'd misunderstood the intend of HTTP::Server::Simple :/
19:18 masak mberends: :/
19:18 masak mberends: in what way?
19:19 dakkar grammar Foo { rule TOP { <[a..z]> } };my $match=Foo.parse('a');.perl.say for @($match)
19:19 dakkar rakudo: grammar Foo { rule TOP { <[a..z]> } };my $match=Foo.parse('a');.perl.say for @($match)
19:19 p6eval rakudo c18d37: OUTPUT«Match.new(␤ # WARNING: this is not working perl code␤ # and for debugging purposes only␤ from => 0,␤ orig => "a",␤ to   => 1,␤ positional => [␤,␤  ],␤)␤»
19:19 dakkar rakudo: my $match=Perl6::Grammar.parse('$a+$b');.perl.say for @($match)
19:19 p6eval rakudo c18d37: OUTPUT«Method 'perl' not found for invocant of class 'Regex;Match'␤  in main program body at line 11:/tmp/c6s7sZA5NA␤»
19:19 mberends masak: I thought the latter was a working, self contained class. But it's only abstract :(
19:19 masak oh.
19:20 dakkar ehrm… what am I doing wrong?
19:20 masak dakkar: that shouldn't happen, I think.
19:20 dakkar oh :)
19:21 rindolf Is rakudo-2010.04-1mdv2010.1 good enough or should I use the git version?
19:21 masak at least if moritz_++'s efforts to make Match a pure-Perl 6 class were ever finished, and I think they were.
19:21 masak rindolf: please be more specific.
19:21 masak rindolf: you do know that we add and change things on a daily basis? :P
19:21 rindolf masak: ah.
19:22 masak rindolf: sometimes I take for granted that people know that. Rakudo has a fairly high development speed.
19:22 masak rindolf: the last release added lazy lists.
19:22 dakkar masak: well, Match seems to work. Perl6::Grammar is not returning Match objects, though
19:22 masak dakkar: I wish I knew more. moritz_ will, though.
19:23 dakkar I'll stay around
19:25 sorear hello #perl6
19:26 * sorear hugs _sri
19:26 sorear Negativity is not tolerated here.
19:26 * masak backlogs
19:26 * _sri hugs sorear back
19:29 [Coke] everybody's always hating on negativity. maaaan.
19:29 rindolf Hi sorear
19:29 rindolf github.com[0: 207.97.227.239]: errno=Connection timed out - sucks.
19:29 rindolf Oh wait. Firewall.
19:31 rindolf No, doesn't work.
19:32 masak _sri: I'd love to have unblocking sockets too. not sure Parrot allows this at thigs point, even theoretically. Rakudo (and Rakudo Star) is all about releasing something which is Usable Now rather than Perfect and Complete.
19:32 _sri masak: i don't think parrot supports them yet
19:33 sorear anyways, jnthn and I need your firstborn at this point
19:33 sorear use POSIX:from<perl5>; my $s = socket(...);
19:33 masak _sri: given this, are you suggesting unblocking sockets are important enough to slip the release date for Rakudo Star?
19:34 _sri masak: thats not my decision to make
19:34 masak right. neither is it mine.
19:34 masak just asking about what you consider to be the priorities here.
19:35 masak you seem to think they are very important.
19:35 _sri i'm just lobbying from the sideline
19:35 ash_ parrot doesn't do async io yet, so you can't do async sockets either
19:35 _sri i know i want a websocket server on perl6 asap
19:36 Guest23195 hm, @b is flattened into @a if I push @a, @b. How do I make a multidimensional array?
19:36 masak _sri: I think it's very good that we have someone lobbying for that, lest we forget it among all the other stuff that's happening.
19:36 _sri short term the next big fight in the web development work will be all about non blocking io, everybody will have to compete with node.js
19:36 masak Guest23195: push @a, [@b]
19:36 _sri so thats what i'm interested in
19:37 Guest23195 masak thx
19:37 masak Guest23195: that copies. there's one variant which doesn't, too.
19:37 masak Guest23195: push @a, \@b
19:37 masak Guest23195: the copying is shallow.
19:37 _sri *world
19:38 Guest23195 ok. all perl5 is not lost :-)
19:38 masak Guest23195: we did retain some fragments :P
19:39 _sri masak: right now it looks like ruby will be in big trouble soonish, because it can't keep up with the async requirements for the next generation of web frameworks
19:39 _sri masak: so i want to verify the same thing doesn't happen in perl6
19:39 ash_ non-blocking io and threading are big issues, especially if you don't have a GIL or a way to work around a GIL
19:40 masak ash_: what's a GIL?
19:40 sorear _sri: seriously, it disheartens me to see you passing over blizkost like this
19:40 ash_ global interpreter lock
19:40 ash_ python and ruby have them, they can use system threads, but they can only have 1 scheduled at a time
19:41 _sri sorear: :(
19:41 ash_ so, while they are doing multi-processing, they aren't taking advantage of multiple cores
19:42 ash_ in python though you can use the module multiprocessing, which does shared memory and forks, so you can take advantage of multiple cores, although you can't do somethings like share a file handler
19:42 _sri ruby fibers are really poor
19:43 ash_ macruby got rid of the GIL in OS X, and added libdispatch too
19:43 _sri it's a big opportunity for perl6 actually
19:44 ash_ so it can do some cool stuff with that
19:44 simcop2387 joined #perl6
19:44 _sri oh, thats interesting
19:45 ash_ but, thats mac only, and requires the llvm, its also not 100% compatible with 1.9, its a fork of matz's ruby 1.9, but it forked a while back, they have gotten almost all of the compatibility back though, it can run rack, and most gems are fine, its mostly edge cases that differ
19:47 ash_ its actually kinda cool, you can even compile your ruby code into a native executable or a .dylib, and it can natively call anything in the obj-c runtime so you can do cocoa programming in it without a bridge
19:48 ash_ thats what i want to do for parrot with part of my GSoC
19:48 ash_ add an llvm based runcore, so it can compile parrot bytecode into native code, and i am almost done with my libffi changes so you can have a lot more flexibility with NCI calls
19:50 _sri damn, if it wasn't mac specific it could totally take over the world
19:51 ash_ yup, they replaced the GC system in macruby, so it uses the obj-c GC system, that is the biggest reason they still have the GIL in ruby
19:51 rindolf joined #perl6
19:52 ash_ and all ruby objects are obj-c types, ([].class #=> "NSMutableArray" in macruby, Array is an alias to that) so all obj-c calls just use native obj-c objects, its pretty crazy, but part of the reason they can get away with that is ruby's object system is almost identical to obj-c, and they both allow runtime construction of objects
19:52 _sri i was already excited when i was reading up on rubinius, but this is wow
19:54 ash_ i bet it will be included by default in 10.7 since there is code for 10.7 in their repository, which is kinda funny IMO
19:54 _sri one more reason to be afraid of cocotron http://www.cocotron.org/
19:55 alester http://stackoverflow.com/questions/3135673/what-performance-increases-can-we-expect-as-the-perl-6-implementations-mature FYI
19:58 masak thanks!
19:59 ash_ it would be cool if more platforms did Obj-C (only OS X 10.6 does Obj-C 2.1), the gnu obj-c runtime doesn't even do 2.0 yet
19:59 ash_ 10.5 was obj-c 2.0
20:00 ash_ anyway, this is a perl channel :P
20:01 _sri hmm, apple is heavily sponsoring macruby
20:01 masak I think pmichaud would be able to write a good reply to that stackoverflow question.
20:01 Su-Shee ash_: which means we should steal the best of other ideas.
20:01 _sri i suspect it might become a first class language in the apple eco system
20:03 ash_ they have an svn host and a git host and will accept patches, but like 99% of the macruby work is done by apple employees (or they all have apple emails)
20:04 sorear sheesh
20:08 ash_ you could port macruby to other OS's, its been done on linux before, but you need to compile libautozeon (the GC system macruby and objective-c use on OSX), which is also open source, but apple specific, its drops down to assembly in places, i hear it compiles on x86, x86-64 linux, and might work on ppc, and ppc-64, but its not plain C, (its C++, C and assembly)
20:08 ash_ libautozone*
20:09 masak "Some of the smartest error messages that STD emits are actually the two-terms message transmogrified into something more specific by context." -- I like this quote. I hope I remember to integrate it into my YAPC::EU talk. it's by TimToady in http://www.nntp.perl.org/group/perl.perl6.language/2010/02/msg33148.html
20:10 masak std: constant Int pi = 3; pi 'foo';
20:10 p6eval std 31483: OUTPUT«[31m===[0mSORRY![31m===[0m␤Malformed constant at /tmp/svPM4BwE7Q line 1:␤------> [32mconstant Int [33m⏏[31mpi = 3; pi 'foo';[0m␤    expecting trait␤Parse failed␤FAILED 00:01 109m␤»
20:10 masak TimToady, sorear: uhm... ^
20:11 sorear std: pi;
20:11 p6eval std 31483: OUTPUT«ok 00:01 106m␤»
20:11 masak oh.
20:11 sorear pi is already defined
20:11 masak std: constant Int psi = 3; psi 'foo';
20:11 p6eval std 31483: OUTPUT«[31m===[0mSORRY![31m===[0m␤Malformed constant at /tmp/NbS2wffr4e line 1:␤------> [32mconstant Int [33m⏏[31mpsi = 3; psi 'foo';[0m␤    expecting trait␤Parse failed␤FAILED 00:01 106m␤»
20:11 masak but that's not the problem.
20:11 masak unless psi is also already defined :P
20:11 masak std: psi
20:11 p6eval std 31483: OUTPUT«[31m===[0mSORRY![31m===[0m␤Undeclared routine:␤      'psi' used at line 1␤Check failed␤FAILED 00:01 107m␤»
20:11 ash_ should that work?
20:12 ash_ what does that mean?
20:12 ash_ 3 'foo'?
20:12 ShaneC joined #perl6
20:13 masak ash_: see http://www.nntp.perl.org/group/perl.perl6.language/2010/02/msg33148.html
20:13 masak ash_: TimToady theorizes that it should error out at parse time.
20:13 ash_ isn't that a parse time error? "Parse failed␤FAILED"
20:14 masak ash_: yes, but it's occurring earlier than I would expect.
20:14 masak ash_: take a look at the bail-out marker.
20:14 rindolf t/spec/S05-mass/properties-derived.rakudo ...................... Failed 9/256 subtests  # Mandriva 2010.1 on an x86-64 machine - rakudo master.
20:15 ash_ masak: is it the type?
20:15 ash_ Int?
20:15 ash_ rakudo: constant psi = 3; psi 'foo';
20:15 p6eval rakudo c18d37: OUTPUT«Could not find sub &psi␤  in main program body at line 11:/tmp/WlvSppdD8i␤»
20:15 masak ash_: yes, it's the type. but that should parse.
20:15 ash_ std: member:constant psi = 3; psi 'foo';
20:15 p6eval std 31483: OUTPUT«[31m===[0mSORRY![31m===[0m␤Preceding context expects a term, but found infix = instead at /tmp/uYXNEX6EcF line 1:␤------> [32mmember:constant psi [33m⏏[31m= 3; psi 'foo';[0m␤Parse failed␤FAILED 00:01 109m␤»
20:16 ash_ std: constant psi = 3; psi 'foo'
20:16 p6eval std 31483: OUTPUT«[31m===[0mSORRY![31m===[0m␤Two terms in a row at /tmp/GuLrMgAsH9 line 1:␤------> [32mconstant psi = 3; psi [33m⏏[31m'foo'[0m␤    expecting any of:␤    bracketed infix␤  infix or meta-infix␤      statement modifier loop␤Parse failed␤FAILED 00:01 109m␤»
20:16 masak that's more what I wanted.
20:16 ash_ std: constant Int a = 123;
20:16 p6eval std 31483: OUTPUT«[31m===[0mSORRY![31m===[0m␤Malformed constant at /tmp/1IGa5FgQ1Q line 1:␤------> [32mconstant Int [33m⏏[31ma = 123;[0m␤    expecting trait␤Parse failed␤FAILED 00:01 106m␤»
20:16 ash_ i don't think std's constant likes types
20:17 masak rindolf: some of the test files in t/spec/S05-mass/ are known to misbehave irregularly.
20:17 masak ash_: that's the problem, yes. correct.
20:17 rindolf masak: do you know how to solve it?
20:18 masak rindolf: no.
20:18 rindolf masak: I see.
20:18 masak ash_: ah, maybe the syntax isn't that. there's not an example in the spec that puts the type in that place.
20:18 masak std: my Int constant psi = 3
20:18 p6eval std 31483: OUTPUT«ok 00:01 109m␤»
20:18 masak std: constant psi of Int = 3
20:18 p6eval std 31483: OUTPUT«ok 00:01 109m␤»
20:19 [particle] std: constant a = Int(3)
20:19 p6eval std 31483: OUTPUT«ok 00:01 109m␤»
20:19 rindolf joined #perl6
20:19 masak either of those is fine.
20:19 masak the form in the email probably isn't.
20:19 ash_ got ya
20:19 masak we're lucky that TimToady wrote a program to tell us when he writes improper Perl 6 :P
20:20 ash_ so my and constant aren't interchangeable, it looks like he just replaced my with constant
20:20 ash_ std: my Int pi = 3;
20:20 p6eval std 31483: OUTPUT«[31m===[0mSORRY![31m===[0m␤Multiple prefix constraints not yet supported at /tmp/jhP3b2jXAw line 1:␤------> [32mmy Int pi [33m⏏[31m= 3;[0m␤Malformed my at /tmp/jhP3b2jXAw line 1:␤------> [32mmy Int pi [33m⏏[31m= 3;[0m␤    expecting any of:␤ multi_declarator␤
20:20 p6eval ..typename␤Pa…
20:20 ash_ ah wait, no sigil
20:20 ash_ std: my Int $pi = 3;
20:20 p6eval std 31483: OUTPUT«ok 00:01 110m␤»
20:21 masak ash_: correct. with 'constant', you get away with not having the sigil.
20:21 ash_ std: constant Int pi = 3;
20:21 p6eval std 31483: OUTPUT«[31m===[0mSORRY![31m===[0m␤Malformed constant at /tmp/HG3ME7a3Ai line 1:␤------> [32mconstant Int [33m⏏[31mpi = 3;[0m␤    expecting trait␤Parse failed␤FAILED 00:01 106m␤»
20:37 ShaneC1 joined #perl6
20:39 ShaneC joined #perl6
20:46 Intensity joined #perl6
20:50 masak "omg people are helpful there!" -- :) -- http://blogs.perl.org/users/kaare/2010/06/my-first-perl6-code.html
20:50 masak oh, and moritz_++
20:50 Gruber joined #perl6
20:53 masak with #parrot's help, I just figured out a way to read a non-utf8 file with Rakudo. \o/
20:53 [particle] does $ntuples-1 actually parse an infix:<-> there?
20:53 masak rakudo: my $ntuples = 8; say $ntuples-1
20:54 p6eval rakudo c18d37: OUTPUT«7␤»
20:54 masak [particle]: yes.
20:54 masak std: my $ntuples = 8; say $ntuples-1
20:54 p6eval std 31483: OUTPUT«ok 00:01 113m␤»
20:54 [particle] that doesn't mean it's correct, and i don't know how to check std... wait, i  do
20:55 masak [particle]: yes, that means it's correct.
20:55 [particle] std: my $ntuples-1 = 8;
20:55 p6eval std 31483: OUTPUT«ok 00:01 110m␤»
20:55 [particle] orly?
20:55 jnthn rakudo: my $ntuples-1 = 8;
20:55 p6eval rakudo c18d37: OUTPUT«Use of uninitialized value in numeric context␤Cannot assign to readonly value␤  in '&infix:<=>' at line 1␤  in main program body at line 11:/tmp/ufkEM0BA3_␤»
20:55 jnthn Right. :-)
20:55 jnthn It's doing
20:55 jnthn (my $ntyples - 1) = 8
20:55 [particle] that still doesn't tell me whether rakudo or std is wrong
20:55 jnthn Both are right I think.
20:55 [particle] yes, and you can assign to that?
20:56 jnthn STD doesn't do semantics like that.
20:56 [particle] hrmm
20:56 jnthn So it'd not know.
20:56 jnthn (Rakudo whines at you at runtime there.)
20:56 sorear std: die
20:56 [particle] ok, gotta re-read the semantics for the apostrophe
20:56 p6eval std 31483: OUTPUT«ok 00:01 107m␤»
20:56 sorear std: 2 + 2 = 5;
20:56 p6eval std 31483: OUTPUT«ok 00:01 108m␤»
20:57 [particle] s/semantics/syntax rules/
20:57 masak [particle]: anywhere between two \w chars is fine.
20:57 masak std: my $_-_-_'_-_'_
20:57 p6eval std 31483: OUTPUT«ok 00:01 108m␤»
20:57 [particle] is 1 not \w?
20:57 masak [particle]: er. yes :/
20:58 [particle] see!
20:58 dalek rakudo: 2acfad3 | moritz++ | src/Perl6/Grammar.pm:
20:58 dalek rakudo: complain about infix:<!%>. Closes RT #76170
20:58 dalek rakudo: review: http://github.com/rakudo/rakudo/commit/2acfad387e81f500f820ef8b687f490ffd711280
20:58 dalek rakudo: cccc121 | moritz++ |  (2 files):
20:58 dalek rakudo: re-enable Cool.rindex
20:58 dalek rakudo: requires rewriting the reverse_index opcode with the same method on the
20:58 dalek rakudo: parrot String. Also enable rindex.t
20:58 dalek rakudo: review: http://github.com/rakudo/rakudo/commit/cccc121607afb2145c61101f7329cff247353598
20:58 dalek rakudo: 1734e43 | moritz++ | src/core/Signature.pm:
20:58 dalek rakudo: properly reflect capture/parcel binding in signature introspection
20:58 dalek rakudo: Closes RT #76116
20:58 dalek rakudo: review: http://github.com/rakudo/rakudo/commit/1734e43486afdec5ca2143b20f2b2c666f7d751c
20:58 [particle] LTM suggests $ntuples-1 is one identifier
20:58 masak then it must be <+[\w]-[\d]>
20:58 masak that is, alphabetics and underscore.
20:58 pugssvn r31484 | moritz++ | [t/spec] tests for RT #75956, @*INC should be writable
20:58 pugssvn r31485 | moritz++ | [t/spec] test for RT #76174, "if" does not break lexical aliasing of $_ in a for-loop
20:59 [particle] token identifier {     <.ident> [ <.apostrophe> <.ident> ]* }
20:59 ash_ won't it only say $ntuples-1 is an identifier if there is an identifier $ntuples-1 ?
20:59 [particle] token ident {     <.alpha> \w* }
20:59 jnthn There's always reading the grammar ;-)
20:59 jnthn <.ident> [ <.apostrophe> <.ident> ]*
20:59 [particle] urk
20:59 pugssvn r31486 | moritz++ | [t/spec] test for RT #76226, all-whitespace range
20:59 pugssvn r31487 | moritz++ | [t/spec] test for RT #76198, {;} should be a Block
20:59 ash_ rakudo: my $a = 1; say $a-1;
20:59 p6eval rakudo c18d37: OUTPUT«0␤»
20:59 jnthn token ident { <.alpha> \w*
20:59 jnthn }
20:59 [particle] yep
20:59 pugssvn r31488 | moritz++ | [t/spec] unfudging for rakudo
20:59 pugssvn r31489 | moritz++ | [t/spec] regex unfudging for rakudo
20:59 pugssvn r31490 | moritz++ | [S06] \| and | prefixes of parameters should be separately introspectable
20:59 pugssvn r31491 | moritz++ | [t/spec] tests for RT #76116, parcel and capture binding in signature introspection
20:59 jnthn So it has to be alphanumeric after the - or the '
20:59 jnthn It's not about what's before
20:59 jnthn gah
20:59 jnthn alpha
20:59 [particle] yep
21:00 jnthn not alphanum...
21:00 colomon moritz_ goes crazy!
21:01 moritz_ just had a long, boring offline train ride
21:02 masak moritz_: dakkar has a Regex::Match-related question in the backlog that I suspect you might be able to answer.
21:02 masak or is that Regex;Match? :)
21:02 dakkar precisely the problem :)
21:02 dakkar rakudo: my $match=Perl6::Grammar.parse('$a+$b');.perl.say for @($match)
21:02 p6eval rakudo c18d37: OUTPUT«Method 'perl' not found for invocant of class 'Regex;Match'␤  in main program body at line 11:/tmp/dzxhNxBx5Z␤»
21:03 dakkar that is: why is Perl6::Grammar returning objects of that weird class?
21:03 __eric__ left #perl6
21:03 moritz_ because it derives from Regex::Cursor, not Grammar
21:04 [particle] so... i can't seem to enter unicode 2170 here
21:04 [particle] but that could be confusing after an apostrophe
21:05 masak [particle]: ⅰ
21:05 [particle] rakudo: my $x = 5; say $x-ⅰ
21:05 p6eval rakudo c18d37: OUTPUT«===SORRY!===␤Confused at line 11, near "say $x-\u2170"␤»
21:05 [particle] rakudo: my $x = 5; say $x - ⅰ
21:05 p6eval rakudo c18d37: OUTPUT«===SORRY!===␤Confused at line 11, near "say $x - \u2170"␤»
21:06 [particle] ok, still confused
21:06 [particle] .u 2170
21:06 phenny U+2170 SMALL ROMAN NUMERAL ONE (ⅰ)
21:06 masak [particle]: I don't think ⅰ is defined in Rakudo (or Perl 6)
21:06 [particle] icu should see it as numeric, no?
21:06 masak [particle]: yeah, but...
21:06 masak ...Rakudo still doesn't know what to *do* with it.
21:07 masak it doesn't parse as anything.
21:07 masak espectially not a number literal.
21:07 [particle] hrmm
21:09 dalek rakudo: d18b5e7 | masak++ | src/core/Buf.pm:
21:09 dalek rakudo: [Buf] now does Positional and .[]
21:09 dalek rakudo: review: http://github.com/rakudo/rakudo/commit/d18b5e7035de1d137317e34539c5b9666a083eff
21:10 masak time to blog a little.
21:10 colomon rakudo: say 5 - 1i
21:10 p6eval rakudo c18d37: OUTPUT«5 + -1i␤»
21:10 colomon rakudo: say 5 - i
21:10 p6eval rakudo c18d37: OUTPUT«Could not find sub &i␤  in main program body at line 11:/tmp/epnqR0vEKi␤»
21:10 lue ohai
21:11 lue I looked once, and couldn't find it; where's the i for imaginary/complex numbers defined?
21:12 colomon These days it's in Numeric, I think.
21:12 colomon multi sub postfix:<i>(Numeric $z) {
21:12 colomon $z * 1i;
21:12 colomon }
21:13 lue .oO( hooray for recursion! \o/ )
21:14 songmaster joined #perl6
21:16 lue I look at that and am amazed it doesn't break.
21:17 moritz_ I guess there's another grammar rule for <number>i
21:18 moritz_ so that the postfix:<i> only handles cases like $x\i
21:21 moritz_ http://stackoverflow.com/questions/3135673/what-performance-increases-can-we-expect-as-the-perl-6-implementations-mature/3136192#3136192
21:21 lue Because I have the beginnings of a Quaternion type, and I was wondering how to get stuff like 4+3i+2k+1j working.
21:27 sorear somebody needs to point out that [+] is implemented by calling a high level function which uses a loop
21:27 masak loliblogged! http://use.perl.org/~masak/journal/40422
21:27 moritz_ sorear: just updated my post
21:29 masak I really like the look-and-feel of StackOverflow.
21:29 moritz_ lolialzoblogged: http://perlgeek.de/blog-en/perl-6/contribute-now-lottery.html
21:31 ash_ masak: anymore suggestions for the try.rakudo.org shell?
21:31 masak ash_: looking.
21:31 moritz_ have prepared a post for tomorrow: next challenge is to implement $*ARGFILES, as suggested by pmichaud++
21:32 moritz_ http://github.com/moritz/perlgeek.de/blob/master/source/blog-source-en/perl-6/contribute-now-argfiles.txt # preview
21:33 whiteknight joined #perl6
21:33 masak ash_: well, unfortunately after my comment about hovering for showing things, the cammands list sticks out from under the main blue thing in a not altogether aesthetic way.
21:33 ash_ yeah, i know
21:33 lue .oO(I thought they were clockroaches)
21:33 ash_ i am trying to figure out how i want to deal with that
21:34 masak ash_: not a very critical thing, just letting you know.
21:34 ash_ i might resize camelia and move it to fit above the terminal and move the commands list up the side some
21:34 masak ash_: I really like the skull-and-crossbones ^^
21:34 ash_ lol
21:34 masak ash_++
21:35 masak ash_: I bet I could make up all manner of nightmarish things for you to fix with string interpolation. are you sure you want me to tell you?
21:36 masak for example: "foo $bar baz" should highlight $bar, but 'foo $bar baz' shouldn't. right now, it does.
21:36 Guest23195 left #perl6
21:36 masak ditto q[foo $bar baz]
21:36 ash_ i don't do fancy quotes yet
21:36 ash_ only ' and "
21:36 moritz_ but q:s[foo $bar baz] should highlight $bar :-)
21:37 masak well, '$bar' shouldn't hightlight $bar.
21:37 masak ash_: it should only highlight if it actually interpolates.
21:37 ash_ i think i broke string constants...
21:37 ash_ one sec
21:38 masak in that vein, "foo @bar[] baz" should highlight @bar[], but "foo @bar baz" shouldn't highlight @bar.
21:39 ash_ hmm, string constants seem broken completely
21:39 ash_ wonder when i did that, probably when i add <a b c>
21:40 masak you had a separate color for string literals?
21:40 ash_ ya
21:40 masak ash_: make sure you have "$foo."$bar"" as a test case, then.
21:40 masak um.
21:40 ash_ um...
21:40 masak "$foo."$bar"()"
21:40 masak that's it.
21:40 ash_ k
21:40 ash_ i can live with that
21:40 ash_ (i think)
21:43 ash_ ' and " work again
21:44 masak '$baz' still highlights $baz here.
21:44 ash_ is that wrong?
21:45 masak yes.
21:45 ash_ ya, thats wrong isn't it, ' doen't interpolate
21:45 masak single quotes don't interpolate.
21:46 masak "$foo."$bar"()" doesn't interpolate right either. it gets the variables right, but should probably interpolate the dot and the parens, too.
21:46 masak also, there's not very much difference between the non-interpolated green and the interpolated green :)
21:47 * masak stops complaining and goes to bed
21:47 masak 'night, #perl6
22:06 pyrimidine left #perl6
22:08 sorear jnthn: invocant types in Perl 6 are never statically known without whole-program analysis
22:09 * sorear is, as it happens, working on a whole-program optimizing compiler for Perl 6
22:13 christine joined #perl6
22:13 jnthn sorear: While that may be true for full-blown Perl 6, it doesn't mean you can't have some additional pragmas in place for your internals/setting which tells the compiler that it can asusme more when it compiles those.
22:14 jnthn Like, that Foo.new actually returns something that ~~ Foo
22:21 gfldex joined #perl6
22:31 tylercurtis joined #perl6
22:33 pugssvn r31492 | bbkr++ | [t/spec] tests for RT #72856 Null PMC access when two methods from different roles collide in a class composition in Rakudo
22:42 japhb joined #perl6
22:53 pugssvn r31493 | bbkr++ | [t/spec] tests for RT #72870 Cant take .WHAT of sufficiently decimal-endowed Rat in Rakudo
22:56 rgrau_ joined #perl6
22:57 masonkramer joined #perl6
23:06 tedv joined #perl6
23:15 dalek csmeta: r352 | stefa...@cox.net++ | trunk/vicil/Kernel.cs:
23:15 dalek csmeta: [vicil] Sub gets to be a native class too for now
23:15 dalek csmeta: review: http://code.google.com/p/csmeta/source/detail?r=352
23:22 bluescreen joined #perl6
23:38 * ingy rebuilds an EC2 image and rebuilds rakudo...
23:38 ingy I need to learn how to save this EC2 image before turning it off
23:41 stepnem joined #perl6
23:42 pugssvn r31494 | bbkr++ | [t/spec] tests for RT #72848 "0 but True" causes a no-applicable-candidates error in Rakudo
23:53 ruoso joined #perl6
23:53 Psyche^ joined #perl6
23:57 hercynium joined #perl6

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

Perl 6 | Reference Documentation | Rakudo