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