Perl 6 - the future is here, just unevenly distributed

IRC log for #perl6, 2009-07-16

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:07 sri_kraih joined #perl6
00:07 sri_kraih joined #perl6
00:09 eternaleye @seen diakopter
00:09 lambdabot Last time I saw diakopter was when I left ##english, ##freebsd, ##hrg, ##logic, #arch-haskell, #concatenative, #darcs, #dreamlinux-es, #friendly-coders, #functionaljava, #gentoo-haskell, #gentoo-uy,
00:09 lambdabot #ghc, #haskell, #haskell-blah, #haskell-books, #haskell-freebsd, #haskell-in-depth, #haskell-overflow, #haskell-soc, #haskell.cz, #haskell.de, #haskell.dut, #haskell.es, #haskell.fi, #haskell.fr, #
00:09 lambdabot haskell.hr, #haskell.it, #haskell.jp, #haskell.no, #haskell.ru, #haskell.se, #haskell_ru, #jhc, #jtiger, #macosx, #macosxdev, #novalang, #perl6, #rosettacode, #scala, #scannedinavian, #unicycling, #
00:09 lambdabot xmonad and #yi 1m 13d 19h 18m 50s ago.
00:09 eternaleye cj: ^^^
00:10 eternaleye cj: lambdabot commands  have a leading @
00:10 cj thanks, eternaleye
00:11 nihiliad joined #perl6
00:13 mikehh__ joined #perl6
00:15 frew_ joined #perl6
00:30 colomon Does anyone see any obvious reason why split(/\;\s*\n?/, $string) would work differently in Perl 6 than it did in Perl 5?
00:32 unitxt joined #perl6
00:33 mikehh__ joined #perl6
00:33 TimToady well it won't remove trailing null fields, for one
00:33 TimToady in any case, \n? is useless after \s*
00:36 colomon TimToady: actually, I'm now wondering if the P5 has been broken all along...
00:38 colomon Nope, the P5 does work.
00:41 mikehh__ joined #perl6
00:41 colomon Is there anything in that /\;\s*\n?/ that could eat text?  Because that's what seems to be happening...
00:43 TimToady no, seems to work fine here, even with the completely useless \n?
00:43 alc joined #perl6
00:44 TimToady how are you running it?
00:45 colomon for split(/\;\s*\n?/, %file_sections{"DATA"}) -> $entity
00:45 TimToady are you using rakudo?
00:45 colomon Yes.
00:45 colomon give me a moment, I'll see if I can reproduce in the small.
00:48 unitxt left #perl6
00:52 colomon Okay, I've got a short test script and a short data file.  Best way to send them on?
00:52 literal http://pastebin.com/
00:53 literal or http://paste.lisp.org/new/perl6
00:54 lisppaste3 colomon pasted "repro.pl" at http://paste.lisp.org/display/83668
00:56 lisppaste3 colomon pasted "test" at http://paste.lisp.org/display/83671
00:57 * ruoso doing a very tedious job of transcription of his talk at fisl, so he can post with english translation
00:58 TimToady seems to work fine here
00:59 colomon Do you get the #2146=NEXT_ASSEMBLY_USAGE_OCCURRENCE('rod-assembly_1','', line in the output?  That's what's missing for me.
01:01 TimToady yes, I get that
01:02 colomon Hmm... guess I need to update rakudo?  (either that or this is weird line ending mojo that gets lost in the pasting?)
01:14 colomon I get the same result with a fresh rakudo generated with "git pull".
01:16 yahooooo joined #perl6
01:16 colomon If I pull down the paste and make a new test file, it works fine.
01:23 colomon something to do with the line endings, I bet.
01:25 colomon Try it from http://ralf.org/~colomon/test.tar.gz
01:28 TimToady it works, but the ^M sends the carriage return back to the beginning of the line and overwrites it when you print it out
01:28 colomon aha!
01:28 colomon Sorry to waste your time on this, and thanks for the help.
01:29 unitxt joined #perl6
01:32 TimToady bbl &
01:47 frankshaw joined #perl6
01:51 frankshaw joined #perl6
02:07 bucky joined #perl6
02:09 athomason joined #perl6
02:09 colomon Fixed my real bug: was using $1 instead of $0.
02:15 KyleHa joined #perl6
02:29 bucky p6eval: my %fruit_color = "apple", "red", "banana", "yellow"
02:30 bucky evalbot say my %fruit_color = "apple", "red", "banana", "yellow";
02:31 frew|work joined #perl6
02:45 unitxt p6eval: my %fruit_color = "apple", "red", "banana", "yellow"; say $fruit_color{$apple};
02:56 StephenPollei rakudo: my %fruit_color = "apple", "red", "banana", "yellow"; say $fruit_color{$apple};
02:56 p6eval rakudo 9a7a1d: OUTPUT«Symbol '$fruit_color' not predeclared in <anonymous> (/tmp/Myrt4kJCo4:2)␤in Main (src/gen_setting.pm:3340)␤»
02:58 StephenPollei rakudo: my %fruit_color = "apple", "red", "banana", "yellow"; say %fruit_color{"apple"};
02:58 p6eval rakudo 9a7a1d: OUTPUT«red␤»
02:58 bucky my @colors = %fruit_color.values;  returns both the keys and the values ??
02:59 bucky in pugs
02:59 StephenPollei unitxt and bucky I think thats more like how you want to test rakudo
02:59 bucky tnx
02:59 StephenPollei pugs: my %fruit_color = "apple", "red", "banana", "yellow"; say %fruit_color.values;
03:00 p6eval pugs: OUTPUT«apple       redbanana       yellow␤»
03:00 StephenPollei rakudo: my %fruit_color = "apple", "red", "banana", "yellow"; say %fruit_color.values;
03:00 p6eval rakudo 9a7a1d: OUTPUT«yellowred␤»
03:00 StephenPollei looks like pugs in wrong in that respect afaik
03:01 KyleHa left #perl6
03:03 unitxt StephenPollei: Thanks. I like that last way best 'my %fruit_color = "apple", "red", "banana", "yellow"; say %fruit_color.values;' :)
03:03 bucky hehe
03:08 StephenPollei rakudo: my %fruit_color = "apple", "red", "banana", "yellow"; %fruit_color.values.join(' ').say;
03:08 p6eval rakudo 9a7a1d: OUTPUT«yellow red␤»
03:09 StephenPollei of course having them not run into each other might be nice
03:09 unitxt :)
03:13 alester joined #perl6
03:13 bucky is there a comprehensive tutorial to use rakudo from the command line interpreter shell ?
03:14 bucky i found something in the link from the /topic
03:15 bucky this is fun
03:15 missingthepoint bucky: the command line interpreter isn't very functional yet :(
03:15 missingthepoint it's known as a REPL
03:15 missingthepoint http://use.perl.org/~masak/journal/38279
03:17 missingthepoint bucky: but you can set up your editor with a hotkey for 'execute in rakudo', i find that's helpful for experimenting :)
03:20 donaldh joined #perl6
03:20 bucky hmm.. i'm still experimenting, when i execute a file it takes a couple milliseconds is that normal.. perl6 is a 4M executable and i still have a k7
03:21 bucky that's with the release from GIT
03:22 bucky does it have debugging symbols in it?
03:22 missingthepoint bucky: not sure, you've exhausted my rakudo knowledge :)
03:22 missingthepoint but i suspect that slight delay on execute is normal (for now)
03:24 bucky > sub {
03:24 lambdabot <no location info>: parse error (possibly incorrect indentation)
03:24 bucky Unable to parse block; couldn't find final '}'...
03:24 bucky yup.. hahaha
03:27 missingthepoint rakudo devs: i LOVE rakudo. by "not very functional" i mean "perhaps not ready to be the subject of a tutorial"
03:27 missingthepoint (though please correct me if i'm wrong on that point)
03:27 missingthepoint :)
03:32 alester joined #perl6
03:33 justatheory joined #perl6
03:36 ihrd joined #perl6
03:37 alester_ joined #perl6
03:50 ihrd left #perl6
04:15 nacho joined #perl6
04:21 iblechbot joined #perl6
04:21 ihrd joined #perl6
04:22 skids joined #perl6
04:23 ihrd left #perl6
04:29 nacho_ joined #perl6
04:52 ihrd joined #perl6
04:53 ihrd left #perl6
05:36 ingy TimToady: Where, exactly, does IO.pod live?
05:36 phenny ingy: 26 Jun 12:16Z <masak> tell ingy I'd be happy to help. where do I sign up?
05:40 kate21de joined #perl6
05:49 kane_ joined #perl6
05:53 literal ingy: http://svn.pugscode.org/pugs/docs/Perl6/Spec/S32-setting-library/IO.pod
06:03 kimtaro joined #perl6
06:07 kane___ joined #perl6
06:19 molaf joined #perl6
06:22 dalek grok: ca25edf | (Hinrik Örn Sigurðsson)++ | script/grok:
06:22 dalek grok: Mention Exegeses/Apocalypses/articles in --help
06:22 dalek grok: review: http://github.com/hinrik/grok/commit/ca25edff95be35c28918e720bce9a6b400f954ee
06:22 dalek grok: e82aaa0 | (Hinrik Örn Sigurðsson)++ |  (6 files):
06:22 dalek grok: Add support for Perl 6 Table Index
06:22 dalek grok: Depend on Perl6::Doc 0.41 for this
06:22 dalek grok: review: http://github.com/hinrik/grok/commit/e82aaa03203453e3661db47a2748f6d07a9337bf
06:22 dalek grok: 7f3e969 | (Hinrik Örn Sigurðsson)++ |  (4 files):
06:22 dalek grok: Bump version to 0.13
06:22 dalek grok: review: http://github.com/hinrik/grok/commit/7f3e96950753ffa4fb5a1846fcfb5685d9d927b5
06:22 dalek grok: 69dc1d9 | (Hinrik Örn Sigurðsson)++ | README:
06:22 dalek grok: Update README
06:22 dalek grok: review: http://github.com/hinrik/grok/commit/69dc1d9b748ae159b44c6399bea5814a7eb60fcc
06:38 ihrd joined #perl6
06:42 moritz_ missingthepoint: we all know that the REPL in rakudo isn't the best one, no need to apologize
06:42 moritz_ we call it "less than aweseome" ;-)
06:47 DemoFreak joined #perl6
06:47 alc joined #perl6
06:50 DemoFreak joined #perl6
06:51 barney joined #perl6
06:54 DemoFreak joined #perl6
06:55 missingthepoint moritz_: :)
06:57 rfordinal joined #perl6
07:06 ihrd left #perl6
07:20 szabgab I might have missed the answer, is there a built-in way to deduct the directory of the currently running script ?  similar to $FinBin::Bin ?
07:20 donaldh joined #perl6
07:21 moritz_ szabgab: if there is one, it's not yet implemented
07:22 szabgab I have not seen anything in the S28
07:22 szabgab and there is no basename, dirname either
07:23 moritz_ maybe that's a task for a module, again
07:25 szabgab I'd be glad to add tests for basename, dirname if someone can suggest me where those functions should live ?
07:25 szabgab or for now I'll write my own
07:37 pmurias joined #perl6
07:37 pmurias ruoso: hi
07:43 agentzh joined #perl6
07:45 Matt-W Good morning
07:46 pmurias Matt-W: hi
08:04 rgrau joined #perl6
08:19 ejs1 joined #perl6
08:27 szabgab rakudo: if ('abc' ~~ m/  (#.) /) { say "match" }
08:27 p6eval rakudo 9a7a1d: OUTPUT«match␤»
08:27 szabgab is the () scoping the # comment ?
08:28 szabgab rakudo: if ('abc' ~~ m/  (#.) /) { say "match '$/'" }
08:28 p6eval rakudo 9a7a1d: OUTPUT«match 'a'␤»
08:28 szabgab hmm, now I am confused
08:28 szabgab rakudo: if ('abc' ~~ m/  (#) /) { say "match '$/'" }
08:28 p6eval rakudo 9a7a1d: OUTPUT«Null PMC access in find_method()␤in Main (src/gen_setting.pm:3340)␤»
08:30 Matt-W That seems odd
08:30 moritz_ indeed, it should complain about a parse error
08:31 moritz_ std: if ('abc' ~~ m/  (#) /) { say "match '$/'" }
08:31 p6eval std 27570: OUTPUT«##### PARSE FAILED #####␤Unrecognized regex metacharacter at /tmp/dMX8lnzK8s line 2:␤------> [32m[31m;[0m␤    expecting any of:␤  regex atom␤       rxinfix␤ termish␤ whitespace␤       ws␤FAILED 00:02 36m␤»
08:31 Matt-W that's PGE at fault then?
08:47 rfordinal joined #perl6
08:53 agentzh1 joined #perl6
08:58 beggars joined #perl6
09:02 dakkar joined #perl6
09:11 explorer joined #perl6
09:16 molaf joined #perl6
09:23 rfordinal left #perl6
09:31 szabgab rakudo: 'abc' ~~ m/(.)/; say $0.perl
09:31 p6eval rakudo 9a7a1d: OUTPUT«Match.new(␤ # WARNING: this is not working perl code␤ # and for debugging purposes only␤ ast  => "a",␤ Str => "a",␤ from => 0,␤ to   => 1,␤)␤»
09:31 szabgab interesting warning
09:32 szabgab more interesting in this case:
09:32 szabgab my %data; if ('name=foo' ~~ m/(.*)\=(.*)/) { %data{$0} = $1 }; say %data.perl
09:32 szabgab rakudo: my %data; if ('name=foo' ~~ m/(.*)\=(.*)/) { %data{$0} = $1 }; say %data.perl
09:32 p6eval rakudo 9a7a1d: OUTPUT«{"name" => Match.new(␤ # WARNING: this is not working perl code␤ # and for debugging purposes only␤ ast  => "foo",␤ Str => "foo",␤ from => 5,␤ to   => 8,␤)}␤»
09:32 szabgab rakudo: my %data; if ('name=foo' ~~ m/(.*)\=(.*)/) { %data{$0} = 1 }; say %data.perl
09:32 p6eval rakudo 9a7a1d: OUTPUT«{"name" => 1}␤»
09:32 moritz_ szabgab: (sorry, got called ayway) yes, the (#) seems like a PGE up - would you submit a bug report pleae?
09:32 moritz_ *please
09:33 szabgab I can but only with the title "something is odd here" as I don't understand it
09:33 moritz_ ok, I will then :-)
09:34 szabgab better, as I don't even know what *should* be there
09:34 szabgab anyway, this warning is a bit strange here
09:34 szabgab especially as I get it only on .perl -ing values I got from a regex
09:35 szabgab rakudo: my %data; if ('name=foo' ~~ m/(.*)\=(.*)/) { %data{$0} = "$1" }; say %data.perl
09:35 p6eval rakudo 9a7a1d: OUTPUT«{"name" => "foo"}␤»
09:35 moritz_ that's because we can't yet create match objects from Perl 6 code in any reasonable way
09:36 szabgab and not if I stringify it
09:36 moritz_ so Match.perl is really only for debugging
09:36 DemoFreak joined #perl6
09:37 szabgab ic
09:38 moritz_ basically masak++ complained often enough about how hard introspection of match objects were
09:39 moritz_ szabgab: submitted as RT #67612, thanks for finding it
09:41 szabgab finding bugs, any time :-)
09:43 clintongormley joined #perl6
09:44 zamolxes joined #perl6
09:46 meppl joined #perl6
09:50 M_o_C joined #perl6
09:57 colomon joined #perl6
10:02 sri_kraih joined #perl6
10:19 pmurias joined #perl6
10:28 sri_kraih joined #perl6
10:30 azawawi_ joined #perl6
10:30 azawawi_ http://ahmadzawawi.blogspot.com/2009/07/padre-perl-6-lucky-grok-release.html
10:30 azawawi joined #perl6
10:31 Matt-W azawawi: hurrah!
10:34 payload joined #perl6
10:36 Stu joined #perl6
10:37 Stu Hi folks.
10:37 Stu Today is the first time I've written any Perl 6, and I must say I'm enjoying it so far.
10:38 moritz_ great.
10:39 BinGOs Don't do it, it's a trap!
10:39 Stu It's going to take me roughly a million years to get used to new regex changes though.
10:40 moritz_ aye, that takes time
10:40 moritz_ but especially for non-trivial regexes and grammars its really worth it
10:40 Stu I'm playing with a grammar at the moment, actually.
10:41 Stu I keep getting a strange error when performing a grammar.parse($string) in an if statement though.
10:41 Stu Like  if(grammar.parse($string)) { say "Hello."; }
10:41 moritz_ ah
10:41 Stu Statement not terminated properly at line 17, near "{\n  say 'Y"
10:41 moritz_ if() is interpreted as a subroutine call
10:41 payload1 joined #perl6
10:42 moritz_ if $grammar.parse($string) { say "hello" }
10:42 Stu hmmm
10:42 Stu Intriguing
10:42 Matt-W or you can say if ($grammar.parse($string))
10:42 moritz_ basically anthing that ends in () is interpreted as sub/method call
10:42 Matt-W but the brackets are no longer necessary, so most of us don't use them
10:42 Stu I won't bother then.
10:42 Stu It's tough to find many Perl 6 examples that are in-date and worth taking notes from.
10:42 moritz_ that way you can define subroutines with the same name as keywords, if you file like
10:43 moritz_ Stu: aye. perl6-projects.org has a few pointers
10:43 Stu If I wanted to override the if "sub"
10:43 Stu That'd get confusing pretty quickly.
10:43 Matt-W IT would
10:43 Matt-W Just because you can, doesn't mean you should :)
10:43 moritz_ rakudo: sub if($x) { say $x }; if('foo')
10:44 p6eval rakudo 9a7a1d: OUTPUT«foo␤»
10:44 frankshaw joined #perl6
10:44 Matt-W As for example code...
10:44 moritz_ http://github.com/perl6/perl6-examples/tree/master contains much example code, most if it still working
10:44 Matt-W What moritz_++ said
10:48 Stu That's excellent. I'll bookmark that.
10:49 Stu Turns out my grammar must be incorrect anyway as nothing gets printed. Oh well. Time to delve back into that.
10:49 Stu I should have started with something a little simpler than a UK postcode validator, I think.
10:49 Matt-W Grammars can be a little sticky to debug
10:49 Matt-W hah maybe :)
10:49 Stu yeah
10:49 colomon Speaking of regexes, I'm trying to figure out how to do multiple matches in one go.
10:50 colomon S05 seems to imply it's possible, but I can't make it work in rakudo.
10:50 colomon Not sure if my syntax is wrong, or it's not implemented yet.
10:52 moritz_ colomon: might be not yet implemented.
10:52 moritz_ colomon: which syntax do you use?
10:52 colomon (%entity{$entity_needed} ~~ /:g (\#\d+)/
10:53 moritz_ Stu: with grammars you should start with a very simple one (at most 2 simple rules), and incrementally improve it, testing it all the way
10:53 moritz_ yes, :g is NYI
10:53 Stu moritz_, I had intended to do that, but then I ended up just blowing that away and trying to write a huge one. I might have to simplify it and start building it up again afterwards.
10:54 colomon moritz_: is there another way to do it currently?
10:54 colomon It's a shame, it would be a beautiful bit of code if it worked.  :)
10:57 rjh joined #perl6
10:58 moritz_ colomon: yes, you can do my @matches; %entity{$entity_needed}.match(rx/\#\d/, { @matches.push: $_ }, :g)
10:58 moritz_ it's a bit clumsy, but it should work
10:59 moritz_ rakudo: my @m; "a 34 b56y7".match(rx/\#\d+/, { @m.push: $_ }); say @m.join(':')
10:59 p6eval rakudo 9a7a1d: OUTPUT«too many arguments passed (3) - 2 params expected␤in Main (/tmp/auwWdiIAhL:2)␤»
11:00 moritz_ bah no, I'm stupid
11:00 moritz_ rakudo: my @m; "a 34 b56y7".subst(rx/\#\d+/, { @m.push: $_ }, :g); say @m.join(':')
11:00 p6eval rakudo 9a7a1d: OUTPUT«␤»
11:00 moritz_ rakudo: my @m; "a #34 b#56y#7".subst(rx/\#\d+/, { @m.push: $_ }, :g); say @m.join(':')
11:00 p6eval rakudo 9a7a1d: OUTPUT«#34:#56:#7␤»
11:00 Stu What do we say now instead of "Nothing was printed to the command line"?
11:00 Stu "Nothing was said on the command line"?
11:01 moritz_ colomon: that's a workaround
11:01 moritz_ Stu: "no output"?
11:01 Stu I think I like "My script didn't say anything"
11:02 Stu Ah, lunch time, I'll be back in a while.
11:12 icwiener joined #perl6
11:14 colomon moritz_: I'm getting "too many arguments passed (5) - 2 params expected" from it?
11:14 moritz_ colomon: from what?
11:14 colomon This line:
11:14 colomon %entity{$entity_needed}.match(rx/\#\d+/, { @matches.push: $_ }, :g);
11:14 moritz_ (note that I used subst in the working example, not match)
11:15 moritz_ yes, my first example was wrong. use the last one instead.
11:15 moritz_ s/match/subst/ and you're done
11:15 colomon will subst leave the string unchanged in this context?
11:15 moritz_ yes.
11:15 moritz_ it will return a modified copy
11:15 moritz_ which you just discard, because you only care for the side effect
11:15 moritz_ it's an ugly hack, but it works :-)
11:16 colomon gotcha!
11:16 colomon I forgot subst doesn't modify the variable it is called on.
11:16 colomon Definitely does the matching.  Thanks!
11:20 donaldh joined #perl6
11:43 ejs2 joined #perl6
11:57 ruoso joined #perl6
12:03 cviorel joined #perl6
12:04 cviorel hi, can someone help me about a little problem using PDF::Table?
12:06 takadonet morning everyone
12:17 pmurias ruoso: hi
12:17 pmurias cviorel: try #perl for perl 5 questions
12:18 jauaor joined #perl6
12:31 ruoso hi pmurias
12:32 pmurias ruoso: what would be a good syntax for adding a RI type annotation to m0ld?
12:33 pmurias i'm currently using RI($capture,"capture");
12:33 ruoso pmurias, what do you mean by "RI type annotation"
12:34 pmurias this register contains an object of a given RI
12:35 * ruoso in a unconfortable sprint of meetings
12:35 ruoso pmurias, ah... right...
12:35 ruoso pmurias, I see...
12:35 ruoso pmurias, what about my capture $x?
12:36 ejs1 joined #perl6
12:37 Lorn hi, how i access foo key? <code>my %hash = ( 'foo' => 1, 'bar' => 2);</code>
12:37 pugs_svn r27571 | pmurias++ | [re-smop] remove useless statement
12:37 pmurias Lorn: %hash<foo>
12:38 pmurias ruoso: that's an important case, can we assume $x RI?
12:38 pugs_svn r27572 | pmurias++ | [re-smop] m0ld recognises RI($capture,"capture") and treats positional
12:38 pugs_svn r27572 | pmurias++ | method specialy
12:38 Lorn rakudo: my %hash = ('foo' => 1, 'bar' => 2); say %hash<foo>;
12:38 p6eval rakudo 9a7a1d: OUTPUT«1␤»
12:40 ruoso pmurias, that's the point, sometimes the context allow us to assume the RI
12:40 ruoso for instance...
12:42 ruoso (btw... the snippet I wrote was m0ld code, not Perl 6)
12:42 ruoso but in Perl 6 code like: "my $a = 1; say $a" we do can assume that $a is a S1P__Scalar
12:43 * ruoso going to another meeting &
13:01 ejs1 joined #perl6
13:11 ruoso joined #perl6
13:18 * ruoso back
13:18 ruoso pmurias, the notation you're talking about is to providing more semantics to m0ld code, right?
13:20 pmurias ruoso: yes
13:20 ruoso pmurias, so i was thinking that in the m0ld code you can do "my type $x"
13:21 ruoso (that wasn't Perl 6 code)
13:21 pmurias noticed that after reading the btw. note
13:24 pmurias ruoso: what we need to have eventually is to support many variants of the same yeast frame with different assumptions
13:25 ruoso pmurias, that'd be cool
13:25 ruoso but it's also possible to do ifs to set different frame->pc values
13:27 pmurias you mean the first time the frame it sets the frame->pc depending on the RI of the externally set registers?
13:29 pmurias or just starting from a different point?
13:32 ruoso pmurias, using frame->pc to set paths of execution according to the implementatino types
13:37 pmurias ruoso: do you think we could sketch a roadmap for the RI-based optimalisations?
13:37 M_o_C joined #perl6
13:38 ruoso pmurias, later today, tes
13:38 ruoso *yes
13:47 pmurias ruoso: what i think would very usefull for optimalisation would be having a SSA form for m0ld
13:50 ruoso SSA?
13:50 pmurias single static assignment
13:51 ruoso ah... right
13:56 szabgab joined #perl6
14:04 skids joined #perl6
14:16 FurnaceBoy joined #perl6
14:17 [particle] pmurias: have you looked at gcc's tree-ssa?
14:19 kane_ joined #perl6
14:19 yahooooo joined #perl6
14:22 szabgab joined #perl6
14:26 szabgab joined #perl6
14:27 * pmurias looks at tree-ssa
14:30 cbk left #perl6
14:32 KyleHa joined #perl6
14:36 justatheory joined #perl6
14:47 ejs joined #perl6
14:48 ejs joined #perl6
14:50 * ruoso later &
14:56 kidd_` joined #perl6
14:57 ejs joined #perl6
15:03 nihiliad joined #perl6
15:03 nihiliad left #perl6
15:03 nihiliad joined #perl6
15:15 Exodist joined #perl6
15:21 donaldh joined #perl6
15:30 nihiliad joined #perl6
15:30 nihiliad left #perl6
15:31 nihiliad joined #perl6
15:37 justatheory joined #perl6
15:38 dLux joined #perl6
15:39 pugs_svn r27573 | kyle++ | [t/spec] Test for RT #62732
15:39 pugs_svn r27574 | kyle++ | [t/spec] Test for RT #62772
15:39 KyleHa Is it true that the Test.pm used for spectest is in the Rakudo repo, not in Pugs?
15:39 pugs_svn r27575 | kyle++ | [t/spec] Test for RT #63014
15:39 pugs_svn r27576 | kyle++ | [misc] Messing with test-reporter.pl
15:40 pugs_svn r27577 | kyle++ | [t/spec] Fix fudge for RT #63014
15:40 pugs_svn r27578 | kyle++ | [t/spec] Test for RT #63894
15:40 pugs_svn r27579 | kyle++ | [t/spec] Test for RT #63900
15:40 moritz_ somebody used git-svn it seems :-)
15:40 moritz_ KyleHa: yes, true
15:40 pugs_svn r27580 | kyle++ | [t/spec] Test for RT #64116
15:40 pugs_svn r27581 | kyle++ | [t/spec] Test for RT #64344
15:40 pugs_svn r27582 | kyle++ | [t/spec] Fix test g00f
15:40 moritz_ KyleHa: if you have patches for it, I can apply those
15:40 KyleHa I'd like to have dies_ok be a fail if the death is from Null PMC access.
15:41 KyleHa Yeah, I was offline all day yesterday with git-svn.
15:41 moritz_ that's an interesting suggestion - wonder what pmichaud and jnthn think about it
15:42 KyleHa I've already tried running the spectests with that change, and there are some failures it turns up.
15:42 pmichaud Good morning #perl6
15:42 KyleHa Looks like 14 tests, all told.
15:43 moritz_ rakudo: my %h = {1, 2, 3, 4}; say %h.perl
15:43 p6eval rakudo 9a7a1d: OUTPUT«Odd number of elements found where hash expected␤in Main (/tmp/pgrAvwCCRF:2)␤»
15:43 moritz_ KyleHa: that seems a worthy tradeoff for improved quality
15:43 [particle] should that work?
15:44 moritz_ dunno
15:44 TimToady nope
15:44 [particle] rakudo: my %h = {1 => 2, 3 => 4}; say %h.perl
15:44 p6eval rakudo 9a7a1d: OUTPUT«{"1" => 2, "3" => 4}␤»
15:44 PerlJam rakudo: my %h := { 1, 2, 3, 4 }; say %h.perl
15:44 TimToady try :=
15:44 p6eval rakudo 9a7a1d: OUTPUT«{ ... }␤»
15:44 PerlJam as long as that one works.
15:44 PerlJam Hmm.
15:44 PerlJam rakudo: my %h = 1,2,3,4; say %h.perl;
15:44 KyleHa I was looking at a number of tickets for things that rightfully should die, but not with Null PMC like they do now.  I didn't want to write a test that says "dies, but not with Null PMC", so I thought of folding it into dies_ok.
15:44 p6eval rakudo 9a7a1d: OUTPUT«{"1" => 2, "3" => 4}␤»
15:45 KyleHa Anyway, I have a patch.
15:45 PerlJam so rakudo took the bare {} as a Code thingy?
15:45 TimToady no, as a Hash thingy
15:45 TimToady but there's only one of it
15:45 pmichaud I think rakudo thinks { 1, 2, 3, 4 }  is a Code thingy.
15:45 TimToady for the same reason @foo = [1,2,3] makes one element in @foo
15:45 pmichaud rakudo: my $a = { 1, 2, 3, 4};  say $a.WHAT
15:45 p6eval rakudo 9a7a1d: OUTPUT«Block()␤»
15:45 moritz_ r27580 introduced $obj.env = { hash }, where .env is an rw hash attribute
15:46 TimToady well, it's still a single thingy
15:46 moritz_ just wanted to check that that's sensible
15:46 pmichaud and { 1, 2, 3, 4}   *is* a Code thingy according to the spec, yes ?
15:46 TimToady yes
15:46 pmichaud okay. :-)
15:46 PerlJam ah, right.  no pairs
15:47 TimToady I was thinking y'all were asking about the => form
15:47 * moritz_ was, initially, but forgot that the forms are different
15:47 moritz_ pmichaud: what do you think about KyleHa++'s suggestion to dies_ok?
15:48 pmichaud moritz_: I can go either way on it at the moment
15:48 moritz_ ok
15:48 moritz_ I like that idea
15:48 pmichaud It would mean that Test.pm becomes rakudo-specific
15:48 PerlJam %h := { }  seems like it should warn if perl thinks the {} is anything other than a Hash
15:48 KyleHa Given that it's in the Rakudo repo, I thought it was Rakudo-specific already.
15:49 moritz_ PerlJam: not warn, type-check fail
15:49 pmichaud KyleHa: afaik, there's nothing about Test.pm at the moment that limits it to Rakudo.
15:49 TimToady the proper generalization would be "dies ok with this error and not some other"
15:49 pmichaud PerlJam: I agree, I thought that one should be an error also.
15:49 PerlJam moritz_: oh, indeed.
15:49 pmichaud I agree with TimToady++  -- proper would be to say what error is expected
15:49 moritz_ TimToady: right, but since we don't have error categories yet, that seems a bit far off
15:50 PerlJam moritz_: we could start by making one for just this specific situation  :)
15:50 KyleHa I agree also, I'd like to specify the correct error, but often I don't know that.  I'd like to be able to at least say 'not this one', and it's always true that Null PMC is wrong.
15:50 pmichaud KyleHa: yes, but Null PMC is also Rakudo-specific.
15:50 KyleHa Yep.
15:50 moritz_ right
15:51 moritz_ that's why it should go into Test.pm, not the spectests
15:51 pmichaud We've been attempting to keep Test.pm in a form that other implementations could use
15:51 moritz_ until the better generalization is available
15:51 KyleHa Here's a question...do we think that "Null PMC access" will be a correct error on any implementation, ever?
15:51 moritz_ KyleHa: I think all implementations will have some kind of internal error, whatever it will be
15:52 moritz_ maybe we can just introduce X::Internal
15:52 moritz_ and massage rakudo somehow to always turn a Null PMC access into X::Internal
15:52 Exodist joined #perl6
15:52 skids joined #perl6
15:52 simcop2387 joined #perl6
15:52 japhb joined #perl6
15:52 cookys joined #perl6
15:52 gfldex joined #perl6
15:52 Hale-Bopp joined #perl6
15:53 moritz_ (at least when it's caught)
15:53 ruoso joined #perl6
15:53 pmichaud KyleHa: anyway, please submit the patch.  At the moment I'm inclined to go ahead and apply it.
15:53 * moritz_ too
15:53 PerlJam If we just make a way  to register errors that should fail and then provide another module  that registers all of the known rakudo specific ones, then it could be  "use Test;  use Rakudo::Fail; ..." or something
15:53 moritz_ PerlJam: that should still not go into the test suite
15:54 pmichaud PerlJam: but we don't want to modify the spectests with  "use Rakudo::Fail"
15:54 cognominal_ joined #perl6
15:54 cookys_ joined #perl6
15:54 moritz_ we do test rakudo regressions there, because all other implementations must also not have the same regressions
15:54 bionoid joined #perl6
15:54 KyleHa OK, I'm off to try to follow the patch submission instructions...
15:54 PerlJam pmichaud: then make it part of fudge somehow ... ?
15:55 moritz_ KyleHa: just git-format-patch and mail to rakudobug@perl.org
15:55 pmichaud PerlJam: Seems like the better approach would be to start defining the expected errors
15:55 moritz_ aye.
15:55 moritz_ I had long hoped that somebody else would do that :/
15:57 cmarcelo joined #perl6
15:58 cmarcelo left #perl6
15:59 Exodist joined #perl6
15:59 skids joined #perl6
15:59 simcop2387 joined #perl6
15:59 japhb joined #perl6
15:59 gfldex joined #perl6
15:59 Hale-Bopp joined #perl6
16:03 eiro joined #perl6
16:08 Stu left #perl6
16:11 rfordinal joined #perl6
16:12 TimToady the main problem with defining the expected errors is that, however we do it, it'll be wrong :)
16:12 TimToady but perhaps less wrong than not doing it
16:13 moritz_ would you think tha a type per error is appropriate?
16:13 KyleHa I finally got my patch up.  It's RT #67622.
16:14 TimToady it's at least an enum per error, which is more like a value per error that can also convey type
16:14 KyleHa I'd be tempted to define an error importance, for when some line has many errors, and we have to decide which to report.
16:15 moritz_ KyleHa: typically the compiler will abort after the first detected error
16:15 TimToady importance is probably impossible to determine in reality
16:15 TimToady what the computer thinks is least important is probably why the rocket blew up
16:16 KyleHa Not every compiler will detect the same "first" error in the same situation, I suppose...
16:16 TimToady because if it had been considered important in the first place, the rocket would have been designed differently
16:16 KyleHa But I don't know that much about compilers.
16:16 moritz_ KyleHa: I think we can leave some room there
16:18 moritz_ anyway, I want checking for errors with smart matching
16:18 moritz_ so that one can say given $! { when X::Syntax { ... }; when X::Internal { say "Rakudo was very bad" } }
16:19 TimToady the most important thing is unique identity; other grouping info can be inflicted externally
16:19 TimToady include "importance"
16:19 TimToady *including
16:19 moritz_ so... simply a number wrapped in an object?
16:20 TimToady if an enum could be a member of multiple types without being in a fixed hierarchy, that'd be ideal
16:20 moritz_ aye
16:21 moritz_ maybe with subset types?
16:21 moritz_ a big enum with all individual errors
16:21 TimToady inside-out exception types?
16:21 TimToady "do you think you're this type?"
16:22 moritz_ and then a subset X::Syntax of X where any (X::SyntaxFoo, X::SyntaxBar)
16:22 KyleHa It's not unusual for error messages to be listed in a file for i18n purposes.  They all have to have some handle somehow.
16:22 TimToady yes, though often the key is just the original format string
16:23 KyleHa Crude FTW.
16:24 TimToady what's the simplest thing that will work, for all values of "work"?
16:25 TimToady and the mapping of format string to unique coded identifier could also be external to the in-line code
16:25 TimToady handled by the error formatter/constructor
16:26 TimToady and if there's no match in the database, each formatter probably has its own default
16:26 TimToady the parser's panic method defaults to "X::ParseFail" or some such
16:27 moritz_ sounds sane
16:27 moritz_ but I wouldn't include the Fail in the name
16:27 lucs joined #perl6
16:27 TimToady all names are subject to bikeshedding :)
16:28 nihiliad joined #perl6
16:28 moritz_ sure.
16:28 moritz_ but my bike shed has the nicer color :-)
16:33 moritz_ TimToady: can I convince you to write something like that up in a draft synopsis?
16:40 TimToady I don't need convincing; I need free time and gumption. :)
16:42 takadonet gumption?
16:44 TimToady http://www.thefreedictionary.com/gumption
16:45 KyleHa While offline yesterday, I wrote S02-*/nil.t which has something I found a little odd.
16:45 KyleHa rakudo: sub n { return }; say n ~~ Nil; say n() ~~ Nil;
16:45 p6eval rakudo 9a7a1d: OUTPUT«␤1␤»
16:46 KyleHa What's the difference between 'n' and 'n()' ?
16:49 TimToady n is a listop
16:49 TimToady and will misparse the following ~~ Nil
16:49 TimToady should probably put in something to catch the non-sensical doubling stringification
16:50 TimToady *double
16:50 pmichaud KyleHa:    n ~~ Nil  is the same as   n( ~( ~Nil ) )
16:51 TimToady biab &
16:53 KyleHa pmichaud: Is that how it should be or just how it is right now?
16:54 pmichaud Well, unless we special-case prefix;<~~> to do something else, that's "how it should be"
16:54 pmichaud i.e., it's the same as    n ~ ~ Nil
16:55 KyleHa OK, then I probably need to fix my test.
17:03 Psyche^ joined #perl6
17:03 kane_ joined #perl6
17:06 KyleHa Who should I bug to change the status of a ticket that I think is resolved or should be merged, or whatever?
17:06 KyleHa Or is it best just to put a note in the ticket and let someone deal with it when it comes around for a review?
17:10 pugs_svn r27583 | kyle++ | [t/spec] Fix the 63894 test.
17:11 pmichaud KyleHa: I can do it
17:11 KyleHa I'd reject #63894.
17:12 moritz_ pmichaud: you can also give KyleHa admin privs.
17:12 moritz_ (bug admin, that is)
17:12 KyleHa These three are the same (should be merged): 61960 62758 63892
17:13 pmichaud KyleHa: what's your username on RT?
17:13 KyleHa rakudo: my $a if 0; say $a;
17:14 p6eval rakudo 9a7a1d: OUTPUT«Null PMC access in isa()␤in Main (/tmp/QhO3nFeXfm:2)␤»
17:14 KyleHa pmichaud:  Looks like it's 'KyleHa'.
17:14 KyleHa I always log in with my email address, kyleha@gmail.com
17:19 pmichaud KyleHa now added as a bugadmin
17:20 KyleHa Thank you!
17:20 pmichaud I'll do the ticket merge
17:20 pmichaud actually, I'll let you do it :-)
17:21 pmichaud so, navigate to ticket #62758
17:21 pmichaud click on "Links" in the upper left menu
17:21 pmichaud put "61960" in the "Merge into" box and hit "Save Changes"
17:21 pmichaud do the same for 63892
17:22 pmichaud in general I tend to merge later tickets into earlier ones, instead of vice-versa
17:24 donaldh joined #perl6
17:25 asciiville joined #perl6
17:26 KyleHa Oh, while you were typing that, I was figuring it out on my own.  Thanks, though!!
17:28 KyleHa Alright, I'm going to consider nourishment before I get into anything else.
17:40 justatheory joined #perl6
17:52 cdarroch joined #perl6
17:52 asciiville x
17:54 DemoFreak joined #perl6
17:55 szabgab joined #perl6
17:56 asciiville Does anyone know if SQLite3 interface is working correctly in Rakudo/Parrot? My PM group is planning for a Perl 6 project and I'm self-tasked with investigating the database interface  layer at this point.
17:58 * moritz_ has no idea
17:58 moritz_ but you can just try it
17:58 moritz_ should be in the parrot repo somewhere under examples/ or so
18:03 kidd_` joined #perl6
18:18 alester joined #perl6
18:18 stevan_ joined #perl6
18:18 coke_ joined #perl6
18:18 coke_ perl6 - regarding RT#63894 - is there a Deparse for perl6?
18:20 stevan_ left #perl6
18:20 stevan_ joined #perl6
18:28 SmokeMachine joined #perl6
18:30 ruoso pmurias, hi
18:30 pmurias ruoso: rehi
18:31 ruoso so... I finally have 2 hours without a meeting :)
18:31 Tene [Coke]: --target=parse ?
18:31 [Coke] tene;perl6, not rakudo.
18:31 Tene ah
18:31 ruoso [Coke], you mean STD?
18:32 [Coke] that's more of a standalone thing, no?
18:32 ruoso [Coke], yeah... but rakudo is one perl6
18:32 ruoso but as you was asking for something that wasn't rakudo
18:32 ruoso I was suggesting one of the other meanings of perl6
18:33 Tene fwiw, prefix:~~ should at least be a parse-time warning...
18:33 [Coke] ruoso: no, I'm asking for something that is standard, not "in a particular version of perl6"
18:33 ruoso [Coke], in that case you want STD
18:33 [Coke] ruoso: no, I don't. =-)
18:33 ruoso std: say 'Hello'
18:33 p6eval std 27583: OUTPUT«ok 00:02 36m␤»
18:34 ruoso [Coke], ok, not just STD, but STD after passing through gimme5 or viv... that will give you a parse tree
18:34 [Coke] ruoso: no. that's not what I'm after, either.
18:34 [Coke] I'm asking if there's a plan for something core, not in a particular implementation, even if that implementation is larry's.
18:34 ruoso ok... so I really don't know what you're after
18:35 pmurias [Coke]: you mean a standard way to deparse things?
18:35 [Coke] pmurias: Yes.
18:36 * ruoso just notice the "de" in "deparse"
18:36 Tene [Coke]: for doing it by hand, at least, there's probably "Match some text against the Perl 6 grammar and then print the .perl of the match object returned"
18:36 Tene Not quite an answer, though.
18:36 pmurias deparsing is turning an AST into source code?
18:36 ruoso yeah... that was the part I didn't notice before
18:37 ruoso [Coke], no... there isn't any deparse implemented yet afaik
18:37 [Coke] like B::Deparse. =-)
18:37 ruoso [Coke], but it would certainly be cool :)
18:38 * ruoso challenging^Wnot really suggesting [Coke] to implement one :)
18:38 moritz_ http://rakudo.de/rakudo-flow.png
18:38 moritz_ that's what I spent my last hour on (including slowly learning inkscape)
18:40 pmurias ruoso: we need to sketch the optimalisation ROADMAP as i tend to procrastinate withought a plan
18:42 xinming_ joined #perl6
18:42 ruoso pmurias, I was about to call you in pvt to start that ;)
18:42 terje_ joined #perl6
18:42 asciiville [moritz_], nice flow diagram!
18:44 moritz_ I just wonder if I should remove the dynops/dynpmc part
18:44 moritz_ and instead mark which parts belong to parrot, and which belong to PCT
18:47 asciiville Hmmm. I'm not sure I can answer that. :)
18:49 icwiener joined #perl6
18:58 moritz_ http://rakudo.de/rakudo-flow-2.png another attempt
19:00 moritz_ feedback welcome. If none comes, I'll blog it.
19:00 asciiville [moritz_], the context blocks make it even clearer.
19:01 TimToady viv deparses the AST when you use -6
19:03 pugs_svn r27584 | lwall++ | [STD] recognize certain uses of infix where term expected
19:12 justatheory joined #perl6
19:12 TimToady std: say > 27584
19:12 p6eval std 27583: OUTPUT«ok 00:02 36m␤»
19:13 ruoso o.O
19:16 TimToady std: say ~~ 27584
19:16 p6eval std 27583: OUTPUT«ok 00:02 38m␤»
19:20 donaldh joined #perl6
19:21 TimToady std: say ?? 27584
19:21 p6eval std 27583: OUTPUT«ok 00:02 38m␤»
19:25 TimToady std: say ~~ 27584
19:25 p6eval std 27584: OUTPUT«##### PARSE FAILED #####␤Preceding operator expects term, but found infix ~~ instead at /tmp/7WQalrg4dc line 1:␤------> [32msay ~~[31m 27584[0m␤FAILED 00:02 36m␤»
19:25 TimToady std: say >= 27584
19:26 p6eval std 27584: OUTPUT«##### PARSE FAILED #####␤Preceding operator expects term, but found infix >= instead at /tmp/aw62TgXZkV line 1:␤------> [32msay >=[31m 27584[0m␤FAILED 00:02 36m␤»
19:26 TimToady std: say »XRXRX« 27584
19:26 p6eval std 27584: OUTPUT«##### PARSE FAILED #####␤Preceding operator expects term, but found infix »XRXRX« instead at /tmp/YdodT3y6wX line 1:␤------> [32msay »XRXRX«[31m 27584[0m␤    expecting any of:␤      infix or meta-infix␤      infix stopper␤    standard stopper␤ terminator␤FAILED 00:02 36m␤»
19:27 TimToady std: say !== 27584
19:27 p6eval std 27584: OUTPUT«##### PARSE FAILED #####␤Preceding operator expects term, but found infix == instead at /tmp/nXf1My9Ys1 line 1:␤------> [32msay !==[31m 27584[0m␤FAILED 00:02 38m␤»
19:27 TimToady std: say != 27584
19:27 p6eval std 27584: OUTPUT«##### PARSE FAILED #####␤Preceding operator expects term, but found infix = instead at /tmp/Y30xGhhwgw line 1:␤------> [32msay !=[31m 27584[0m␤FAILED 00:02 38m␤»
19:27 TimToady heh
19:31 TimToady std: foo == 27584
19:31 p6eval std 27584: OUTPUT«##### PARSE FAILED #####␤Preceding operator expects term, but found infix == instead at /tmp/6RCZ4CVV3Q line 1:␤------> [32mfoo ==[31m 27584[0m␤FAILED 00:02 36m␤»
19:32 KyleHa std: my $a if 0; say $a;
19:32 p6eval std 27584: OUTPUT«ok 00:02 37m␤»
19:33 KyleHa rakudo: my $a if 0; say $a;
19:33 p6eval rakudo 9a7a1d: OUTPUT«Null PMC access in isa()␤in Main (/tmp/yRt740AO5p:2)␤»
19:33 pmichaud $a isn't being initialized.
19:33 pmichaud (because of the "if 0" part)
19:33 KyleHa So that should live?
19:34 pmichaud I don't know.
19:34 TimToady variables should be born undef, not Null PMCs :)
19:34 TimToady this is specced in CATCH
19:34 pmichaud TimToady: agreed -- the question is when they are "born"  :-)
19:35 pmichaud in the "my $a if 0" case -- when is $a born?
19:35 TimToady do { 1/0; my $x; CATCH { when /division/ { say $x.defined } } should work
19:36 pmichaud or in the case just given with CATCH -- when is $x born?
19:36 TimToady all lexicals that are visible to the CATCH should be undef when the block starts
19:36 takadonet left #perl6
19:37 pmichaud okay, so all lexicals are "born" at the start of the block?
19:37 pmichaud (even if they're not visible at the start of the block)
19:38 alester joined #perl6
19:42 TimToady likewise { eval 'say not OUTER::<$x>.defined'; my $x } should say 1
19:43 TimToady should also work if you s/OUTER/SETTING/
19:43 pmichaud that sounds like the answer to my question above is "yes", then :-)
19:43 pmichaud the lexical exists as of the start of the block
19:43 pmichaud how about:
19:44 ruoso pmichaud, yes... that also fits with "my $x; my $x;" doesn't declare a new variable
19:44 pmichaud do { 1/0;  my Int $x;  CATCH { when /division/ { say $x ~~ Int } }    # true
19:44 pmichaud ruoso: I envision that as being something different
19:44 pmichaud ruoso: in that case, the second "my $x;" just refers back to the already existing one.
19:44 pmichaud ruoso: but it doesn't say anything about when $x was vivified
19:44 pmichaud (or bound, or whatever)
19:45 ruoso pmichaud, the point is that there is only one lexpad for each block
19:45 TimToady I think if we know the variable is Int at compile time, it should be borned that way
19:45 pmichaud TimToady: right, I agree.
19:45 pmichaud ruoso: I never felt otherwise.
19:45 TimToady eval '$x = "abc"'; my Int $x;
19:45 pmichaud "Null PMC" in rakudo generally means an unbound variable.
19:45 ruoso ah...
19:45 TimToady that should have a type error on assignment
19:45 ruoso I see what you're asking now
19:46 pmichaud TimToady: works for me
19:46 ruoso pmichaud, I don't think there's a way to have an unbound variable in the lexpad
19:46 ruoso it needs to be bound to *something*
19:47 ruoso there's no NULL
19:47 pmichaud ruoso: in Parrot, symbols default to binding to the Null PMC
19:47 ruoso pmichaud, right... so rakudo should initialize it to the proper container when initializing the lexpad
19:47 pmichaud which is just a PMC that throws exceptions whenever you try to do anything with it other than test it for nullness
19:47 pmichaud ruoso: rakudo doesn't have a separate "initialize the lexpad" step.
19:48 pmichaud (at least, it doesn't have one yet)
19:48 rfordinal joined #perl6
19:48 TimToady seems like HLLness should let you substitute Object as the null object
19:48 pmichaud lexpads are statically attached to subroutines when they are compiled
19:48 pmichaud TimToady: yes, that would be nice (more)
19:48 pmichaud But that wouldn't help us in the case of   "my Int $x"
19:48 ruoso pmichaud, it looks to me you need a "initialize the lexpad" step
19:48 TimToady trew
19:49 pmichaud ruoso: yes, but that wasn't clear to me until TimToady said that lexicals are born at the start of their enclosing block
19:49 pmichaud jnthn++ and I have been discussing that we would attach lexpad initializers to subs, similar to how we do signatures now
19:49 ruoso ah... ok... that was what I was trying to say...
19:50 pmichaud so that the first thing that happens upon entering a block is that all of its lexicals are initialized from the prototype lexpad
19:50 pmichaud actually, we'd like *parrot* to work that way as well, but we're going to proof-of-concept the idea in Rakudo
19:50 TimToady the only alternative is to put a guard around any access that might produce NULLness to translate that to Objectness
19:51 pmichaud that's the alternative that PCT provides (but Rakudo doesn't use)
19:51 pmichaud because it gets expensive.
19:51 TimToady nodnodnod
19:51 sjohnson :)
19:51 pmichaud PCT didn't want to impose the notion of "all lexicals are born at the start of the block", since there could be languages where that's not the case.
19:52 TimToady *grumble* *grumble* *"managed code"* *grumble* *grumble*
19:53 * pmichaud misses the reference.
19:53 TimToady "managed code" is the C# notion of code that can't coredump
19:54 TimToady sort of the Java notion as well
19:54 TimToady except C# explicitly allows for "unmanaged code"
19:54 pmichaud ah, okay.
19:54 TimToady seems like parrot doesn't do much to help us make the distinction currently...
19:55 TimToady (if we count Null PMC as a variety of core dump)
19:55 pmichaud anyway, when we refactor rakudo so that each block gets its lexicals initialized from a prototype lexpad upon block invocation, then all of the above should work as expected.
19:55 pmichaud Actually, I think Null PMC is explicitly Parrot's notion of "I caught something that might've coredumped"
19:55 KyleHa So, if all lexicals are born at the start of the block, does that mean { $a = 7; my $a }  works?
19:55 pmichaud KyleHa: you'd get "$a not declared"
19:56 KyleHa OK, thanks.
19:56 sri_kraih_ joined #perl6
19:56 pmichaud since at the point where we encounter $a in the parse, $a hasn't been declared yet.
19:56 pmurias perl6: sub foo {say "hi"};{eval('&foo := sub {say "hello"}');foo();}
19:56 p6eval pugs: OUTPUT«hello␤»
19:56 p6eval ..elf 27584: OUTPUT«/home/evalenv/pugs/misc/STD_red/match.rb:141:in `block in to_dump0': undefined method `to_dump0' for true:TrueClass (NoMethodError)␤   from /home/evalenv/pugs/misc/STD_red/match.rb:140:in `each'␤      from /home/evalenv/pugs/misc/STD_red/match.rb:140:in `map'␤       from
19:56 p6eval ../home/evalenv/pugs/misc…
19:56 p6eval ..rakudo 9a7a1d: OUTPUT«hi␤»
19:57 KyleHa And the part of the spec for this is S04 ?
19:57 pmichaud S02, I think.
19:58 KyleHa Ah, in fact S04-declarations/my.t has tests like this already:  eval_dies_ok('$x; my $x = 42'
19:58 pmichaud nope, S04
19:58 TimToady S04:1200
19:59 TimToady that's for meaning of $x before elaboration
20:00 TimToady though it's only claiming Objectness there, not Intness
20:01 pmichaud I'm fine with applying RT #67622 for now.
20:02 KyleHa I don't think I have commit to Rakudo.
20:02 KyleHa Just in case that's in question.
20:04 cspencer joined #perl6
20:06 TimToady also back around line 60 for when 'my $x' introduces the new symbol, and relationship to OUTER::<$x>
20:12 pmurias perl6: sub foo {say "hi"}; {&foo := sub {say 'monkey patch foo'}};foo()
20:12 p6eval elf 27584: OUTPUT«/home/evalenv/pugs/misc/STD_red/match.rb:141:in `block in to_dump0': undefined method `to_dump0' for true:TrueClass (NoMethodError)␤   from /home/evalenv/pugs/misc/STD_red/match.rb:140:in `each'␤      from /home/evalenv/pugs/misc/STD_red/match.rb:140:in `map'␤       from
20:12 p6eval ../home/evalenv/pugs/misc…
20:12 p6eval ..rakudo 9a7a1d: OUTPUT«hi␤»
20:12 p6eval ..pugs: OUTPUT«monkey patch foo␤»
20:13 ruoso hmmm... seems like a mis-optimization by rakudo
20:14 ruoso TimToady, right?
20:14 rfordinal3643 joined #perl6
20:15 ruoso TimToady, or maybe that falls into the "the multi candidate list is fixed" category?
20:16 icwiener_ joined #perl6
20:17 jeekobu Just like many elections
20:19 pmichaud speaking of lexical initialization and types.... I suspect this question has been asked (and answered) before, but I don't recall the answer.... (more)
20:19 pmichaud What happens with...
20:19 pmichaud my $a = 'xyz';  my Str $b := $a;  $a = 3;
20:21 Tene pmichaud: well, what happens with: my Str $a = 'xyz'; my $b := $a; $b = 3; ?
20:21 Tene Is that specced, or just a restatement of the problem?
20:22 pmichaud Tene: I don't know the answer, which is why I'm asking.
20:22 Tene pmichaud: is a Str constraint different from an 'ro' constraint?
20:23 pmichaud Tene: okay, your question is confusing me.  :-|
20:23 Tene pmichaud: then ignore it. :)
20:24 pmichaud Tene: however, there's an answer to what you just asked about 'ro'.... (more)
20:25 pmichaud rakudo:  my $a = 5;  sub foo($b) { $a = 6; };   foo($a)
20:25 p6eval rakudo 9a7a1d:  ( no output )
20:25 pmichaud even though $b is read only, it doesn't impose read-only-ness on $a
20:26 pmichaud so to generalize that...
20:26 Tene rakudo: my $a = 5; sub foo($b) { $b = 6; }; foo($a); say $a;
20:26 pmichaud rakudo:  my $a = 'xyz';  sub foo(Str $b) { $a = 3; };   foo($a)
20:26 p6eval rakudo 9a7a1d: OUTPUT«Cannot assign to readonly variable.␤in sub foo (/tmp/scVaeabKpZ:2)␤Null PMC access in get_pmc_keyed()␤current instr.: 'perl6;Perl6;Compiler;eval' pc 289208 (src/gen_actions.pir:24161) (src/gen_setting.pm:3340)␤»
20:26 p6eval rakudo 9a7a1d:  ( no output )
20:26 pmichaud rakudo:  my $a = 'xyz';  sub foo(Str $b) { $a = 3; say $b; };   foo($a)
20:26 p6eval rakudo 9a7a1d: OUTPUT«3␤»
20:26 Tene rakudo: my $a = 5; sub foo($b) { my $c is rw := $b; $c = 6; }; foo($a); say $a;
20:26 p6eval rakudo 9a7a1d: OUTPUT«Cannot assign to readonly variable.␤in sub foo (/tmp/LxHjOOVtEH:2)␤Null PMC access in get_pmc_keyed()␤current instr.: 'perl6;Perl6;Compiler;eval' pc 289208 (src/gen_actions.pir:24161) (src/gen_setting.pm:3340)␤»
20:32 pmichaud anyway, I think I see where this is going.
20:32 Tene Then I'm probably confused.  Nevermind.
20:33 pmichaud I think we end up with the following interesting case, though.
20:33 pmichaud my $a = 5;  sub foo($b) { say $a =:= $b;  $a = 6; #(ok)   $b = 6;  #(fails) }
20:34 pmichaud where the output would be "1"  because $a =:= $b
20:35 pmichaud but even though $a and $b are the "same", we can write to $a but not to $b
20:35 buubot joined #perl6
20:35 pmichaud I don't have a problem with that, if nobody else does :-)
20:36 * moritz_ finds that rather intuitive
20:36 colomon Is there any standard way to get the perlcabal.org Perl 6 documentation downloaded as a whole?  I'd like to have it with me on the road this weekend...
20:36 pugs_svn r27585 | kyle++ | [t/spec] Test for RT #62766
20:36 pmichaud colomon: the pod files are available from the pugs repository in /pugs/docs/Perl6/Spec
20:36 jeekobu pmichaud: Sounds like a mechanism for public/private/friend type semantics
20:37 pmichaud moritz_: I just think someone could be surprised that even though  $a =:= $b, one can perform operations on $a that can't be performed on $b
20:37 colomon pmichaud: so I already have them!  Thanks.
20:37 moritz_ colomon: you can also check out the pugs repository and use the tool in util/smartlinks.pl to generate the HTML from them
20:38 KyleHa pmichaud: In light of previous discussion, I wrote these tests which I'd really like reviewed:  http://dev.pugscode.org/changeset/27585
20:38 pmichaud KyleHa: reviewing
20:38 moritz_ pmichaud: I know; but I can live with thinking that ro-ness is stored in the lexical table, not as part of the container
20:38 colomon moritz_: better yet.  Thanks!
20:38 pmichaud moritz_: but I'm think that then becomes true for typeness also
20:38 pmichaud (which is fine)
20:38 pmichaud *thinking
20:39 pmichaud thus
20:39 moritz_ it makes me ask how you can manipulate such properties (for example for writing custom traits)
20:40 pmichaud my $a = 5; sub foo(Int $b is rw) { say $a =:= $b  #(1);  $a = 'xyz' #(ok);  $b = 'xyz' #(fails) };   foo($a)
20:40 justatheory_ joined #perl6
20:40 pmichaud and thus in answer to my earlier question
20:40 pmichaud my $a = 'xyz';  my Str $b := $a;  $a = 3 #(ok);
20:40 pmichaud with the odd result that $b at that point no longer holds a Str
20:40 moritz_ pmichaud: btw have you seen <http://rakudo.de/rakudo-flow-2.png>? any comments
20:41 moritz_ uhm, that's a bit weirder IMHO
20:41 pmichaud it's the same in the sub examples I just gave
20:41 pmichaud after doing the assignment to $a, the value of $b has changed to something that is incompatible with the type of $b
20:41 kate21de joined #perl6
20:41 moritz_ so binding to a variable makes it forget the container constraints?
20:42 pmichaud no, it's just that the bound constraints don't overload the existing variable's constraints
20:42 moritz_ ah well, I should backlog before asking such questions ;-)
20:42 ruoso moritz_, the contraints are implemented by the container
20:42 ruoso binding replaces the container
20:42 pmichaud ruoso: that's not entirely true -- see the sub examples above
20:44 ruoso pmichaud, in that case the signature needs to implement a proxy container which defines additional contraints
20:44 pmichaud_ joined #perl6
20:44 pmichaud_ ugh, connection to feather is hosed
20:44 ruoso I'm not sure it stays the same after you add additional constraints
20:45 pmichaud_ if the signature implements a proxy container, then the binding operator could do much the same
20:45 pmichaud_ but either way, the point is that signature binding doesn't change the constraints of the thing being bound
20:47 ruoso but that's a different example then the other
20:47 pmichaud_ I'm not sure it's supposed to be different.
20:47 ruoso my Int $a; my Str $b; $a := $b
20:47 ruoso in that case the original container for $a simply vanished
20:48 ruoso so the constraints associated with it are gone as well
20:48 pmichaud1 joined #perl6
20:48 pmichaud_ I'm willing to accept that; I'd like to see it clearly spelled out somewhere that this is the case.
20:48 ruoso fair enough
20:49 pmichaud_ it does mean that signature binding is different from := binding.  That's fine with me also, but I hadn't come across anything that implied to me that they were different.  I was under the impression that we were trying to make them the same.
20:51 ruoso hmm.. if we make them the same
20:51 ruoso my Int $a; my Str $b; $a := $b
20:51 ruoso should fail
20:51 pmichaud_ correct.
20:51 pmichaud_ just like   my Int $a;  sub foo(Str $b) { ... };  foo($a);   # fails
20:52 ruoso but, in fact... I've been thinking $a := $b as different than :($a) := \($b)
20:52 ruoso in mildew
20:53 ruoso $a := $b is actually
20:53 ruoso VAR($A).BIND($b)
20:53 pmichaud_ I can't say that I had a clear guide for how := should work -- but I had never considered the case of typed binding until the earlier discussion on lexical initialization prompted me to think about it again
20:53 ruoso or, more explicitly
20:53 pmichaud_ currently Rakudo does the "replace the container" semantic as well, I think.
20:54 ruoso in smop we use the bvalue concept to support it
20:54 ruoso $scope.<$a>.BIND($b)
20:54 pmichaud_ I'm just curious as to what the ultimate result will be :-)
20:54 ruoso so $scope<$a> returns a bvalue
20:54 ruoso which is a "lazy lookup"
20:54 pmichaud_ Parrot makes bvalue semantics particularly difficult -- we have to implement proxies for it
20:54 ruoso we do with proxies as well
20:55 pmichaud_ TimToady: your opinions on the above would be very helpful to us :-)
20:55 pmichaud_ (when you get a chance, not urgent)
20:55 ruoso btw... in SMOP, I've been using .STORE, .FETCH and .BIND for that matter
20:56 pmichaud joined #perl6
20:56 ruoso I'm not sure that is correct
20:56 pmichaud_ well, if we get an opinion on the correct semantics of the examples above, that will tell us where we have to go :-)
20:58 * ruoso time to decommute &
20:59 justatheory joined #perl6
21:00 justatheory__ joined #perl6
21:01 justatheory joined #perl6
21:05 justatheory___ joined #perl6
21:06 davef joined #perl6
21:06 pmichaud moritz_: the graphic looks pretty good to me
21:06 justatheory____ joined #perl6
21:07 justatheory_ joined #perl6
21:07 moritz_ ok, I'll tune the opacity a bit and blog it ;-)
21:07 moritz_ pmichaud: should I also add the svg (inkscape) to docs/ in rakudo?
21:08 jauaor joined #perl6
21:08 pmichaud moritz_: yes, please
21:08 pmichaud moritz++
21:15 davef std: my %book of Hash of Array of Str;
21:15 p6eval std 27585: OUTPUT«ok 00:02 37m␤»
21:17 kborer_ joined #perl6
21:17 Limbic_Region joined #perl6
21:17 PZt joined #perl6
21:20 pugs_svn r27586 | cspencer++ | Skip a test requiring lazy lists.
21:20 davef hi - given rakudo doesn't yet support ' Array of Array of Num @v4', what's the alternative format to declare this?
21:20 explorer joined #perl6
21:21 Tene davef: one alternative is to just not delare at all.
21:21 moritz_ I don't know if Array is parametric yet, but maybe you can say 'my Positional[Num] @a'
21:22 moritz_ rakudo: say "a\nb\nc".subst(/^^/, '# ', :g);
21:22 p6eval rakudo 9a7a1d:  ( no output )
21:22 moritz_ rakudo: say 'a'
21:22 p6eval rakudo 9a7a1d: OUTPUT«a␤»
21:23 moritz_ bah, that loops
21:23 Tene moritz_: repeated zero-width match
21:24 Tene moritz_: pm says he might fix it during the upcoming big PGE refactor.
21:24 moritz_ I wanted to use that in Test.pm's diag() function
21:26 davef any idea when 'Array of Array' etc is due in rakudo, is it imminent or low priority?
21:28 moritz_ not iminent I think
21:28 moritz_ typed arrays are pretty annoying anway
21:28 moritz_ my Int @a = (1, 2, 3, 4); # type check failure, (1, 2, 3, 4) is just a List, not a List[Int]
21:32 KyleHa yay/nay on this?  http://dev.pugscode.org/changeset/27585
21:32 KyleHa I should look at the log; maybe I missed it.
21:32 moritz_ I just looked at it
21:32 davef std allows ' my Int @a[][]; @a[0,0] = 44;', (rakudo doesn't) is that the same as Array of Array of Int?
21:33 moritz_ the one that loops infinitely is known
21:33 moritz_ davef: it's a multi-dimensional array, which is not quite the same
21:33 moritz_ (but similar)
21:33 moritz_ std: my $a;my $x if 0;$a = $x', 'my $x if 0
21:33 p6eval std 27586: OUTPUT«##### PARSE FAILED #####␤Syntax error (two terms in a row?) at /tmp/5M0dmAQpqV line 1:␤------> [32mmy $a;my $x if 0;$a = $x[31m', 'my $x if 0[0m␤    expecting any of:␤   POST␤   infix or meta-infix␤        infix stopper␤    postfix␤        postfix_prefix_meta_operator␤
21:33 p6eval ..standard stopper␤ statement mo…
21:34 moritz_ std: my $a;my $x if 0;$a = $x
21:34 p6eval std 27586: OUTPUT«ok 00:02 37m␤»
21:35 davef think I need to get a bigger brain for Lisbon :0 -- thanks for your help.
21:35 moritz_ KyleHa: the last one looks pretty scary
21:35 moritz_ KyleHa: basically it disallows line numbers in the error message
21:35 KyleHa Oh, good point.  I hadn't thought of that.
21:36 Chillance joined #perl6
21:37 moritz_ KyleHa: btw your "How I came to contribute to Perl 6" post on perlmonks is best of the week ;-)
21:38 KyleHa Yeah.  8-)
21:38 KyleHa It's in the 10 best of the month now too.
21:39 moritz_ it's good to see that the perl monks aren't tired hearing about Perl 6
21:39 KyleHa The monks are nothing if not patient.
21:40 KyleHa rakudo: my Int $x = "abc"
21:41 p6eval rakudo 9a7a1d: OUTPUT«Assignment type check failed; expected Int, but got Str␤Null PMC access in get_pmc_keyed()␤current instr.: 'perl6;Perl6;Compiler;eval' pc 289208 (src/gen_actions.pir:24161) (src/gen_setting.pm:3340)␤»
21:41 moritz_ except with those who don't read the docs ;-)
21:41 pmichaud KyleHa: still looking at the changes
21:41 KyleHa pmichaud: Thanks!  I thought maybe you'd moved on to something else.
21:41 pmichaud I did get interrupted here, yes (sorry)
21:42 KyleHa No problem.
21:42 KyleHa So that gives the right error message AND a Null PMC.
21:42 pmichaud eval '$x = "abc"; my Int $x';
21:42 pmichaud looks wrong to me.
21:42 pmichaud it should die, but not due to a type error.
21:43 pmichaud it should instead complain that $x is not declared
21:43 pmichaud (line 228)
21:43 KyleHa I can see that.
21:43 KyleHa I was looking at this at the time:  http://irclog.perlgeek.de/perl6/2009-07-16#i_1322205
21:44 KyleHa I'm glad I asked for a review.  There's a lot of alligators in there.
21:44 pmichaud the difference between line 228 and the irclog is the position of the closing '
21:45 KyleHa Aha.  Good catch.
21:45 moritz_ KyleHa++ # attacking the alligators nonetheless
21:51 pugs_svn r27587 | kyle++ | [t/spec] fix tests after review from pmichaud++ and moritz++
21:51 KyleHa OK, gotta commute.
21:51 KyleHa Thanks again for your attention, moritz++ and pmichaud++
21:52 pmichaud KyleHa: thanks for the outstanding tests
21:52 KyleHa *bow*
21:53 pmichaud applying the patch for eval_lives_ok gives me a bunch of spectest failures, though.
21:53 KyleHa That was my experience too.
21:53 pmichaud oh.  we need to fix those failures before I can apply the patch, then
21:53 pmichaud (where "fix" can also mean "fudge")
21:53 KyleHa I suspect those are places that actually need attention, but I didn't look at them to confirm.
21:54 moritz_ I also have slight worries, see my e-mail reply
21:54 moritz_ basically it's rather confusing
21:54 moritz_ to have a dying test code that still fails dies_ok
21:54 moritz_ a diag() could help with some explanataion
21:54 moritz_ but I didn't have enough focus to hack it in myself
21:54 KyleHa The way I think of it is:
21:55 KyleHa A Null PMC is not an "ok" death.
21:55 KyleHa It only dies "ok" if it dies some other way.
21:55 moritz_ KyleHa: I know, I'm not arguing about that
21:55 KyleHa OK.  I didn't actually read your email.
21:55 KyleHa I'll have a look at it at a traffic light on the way home.
21:55 moritz_ ;-)
21:55 KyleHa Gotta run.
22:03 justatheory_ joined #perl6
22:04 pmichaud here's a related item on the binding issue
22:04 pmichaud what should happen with
22:05 pmichaud our $x = 'xyz';  { our Int $x;  say $x;  }
22:06 pmichaud in some sense "our Int $x"  seems to me like it should be close to the same as  "my Int $x := PACKAGE::<$x>"
22:06 pmichaud (module the use of "PACKAGE" there)
22:09 justatheory__ joined #perl6
22:09 pmichaud and at the moment, I'm thinking it'd be really nice if := binding did the same as signature binding.  I could solve a number of Rakudo bugs that way.
22:10 moritz_ interestingly enough Perl 5 heads along a similar direction
22:10 pmichaud Yes.
22:10 pmichaud In particular, I could quickly fix hash and array element binding in Rakudo if it acts like signature binding.
22:11 justatheory___ joined #perl6
22:11 moritz_ chip is working on binding, because it's needed for the formal parameters he wants to introduce
22:12 pmichaud and I can do some very nice refactors of the existing binding and lexical code
22:13 moritz_ to come back to your issue, I always understood 'our' as aliasing to a package variable, so identifiying it with binding to a lexical seems sane to me
22:13 pmichaud yes.
22:15 pmichaud but then the question becomes... does the underlying package variable have constraints?  If so, what sets them?
22:15 moritz_ it seems to follow that you can't declare those using 'our'
22:16 moritz_ or maybe just the first 'our' wins, and conflicting restraints later on throw an error
22:16 moritz_ I mean if you want to temporarily replace those constants, you can still use 'let'
22:17 pmichaud if rand() { our Int $x = 3; } else { our Str $x = 'xyz'; }   # which one wins?  ;-)
22:17 moritz_ it's at compile time, of course
22:18 moritz_ ;-)
22:18 moritz_ Int wins, and Str says "OH NOEZ"
22:19 pmichaud afk for a bit
22:20 kborer joined #perl6
22:27 TimToady std: if rand() { our Int $x = 3; } else { our Str $x = 'xyz'; }   # which one wins?  ;-)
22:27 p6eval std 27587: OUTPUT«##### PARSE FAILED #####␤Obsolete use of rand(); in Perl 6 please use rand instead at /tmp/oUJmwmRkSQ line 1:␤------> [32mif rand([31m) { our Int $x = 3; } else { our Str $x [0m␤FAILED 00:02 36m␤»
22:27 TimToady std: if rand { our Int $x = 3; } else { our Str $x = 'xyz'; }   # which one wins?  ;-)
22:27 p6eval std 27587: OUTPUT«ok 00:02 37m␤»
22:38 kate21de joined #perl6
22:50 ihrd joined #perl6
22:56 kborer_ joined #perl6
23:03 payload joined #perl6
23:04 ihrd left #perl6
23:16 yahooooo joined #perl6
23:19 kborer_ joined #perl6
23:20 donaldh joined #perl6
23:21 justatheory joined #perl6
23:40 kborer joined #perl6
23:41 elmex joined #perl6
23:43 elmex joined #perl6
23:46 ihrd joined #perl6
23:46 ihrd left #perl6
23:47 ihrd joined #perl6
23:47 ihrd left #perl6
23:50 yahooooo joined #perl6
23:58 Whiteknight joined #perl6

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

Perl 6 | Reference Documentation | Rakudo