»ö« Welcome to Perl 6! | perl6.org/ | evalbot usage: 'perl6: say 3;' or rakudo:, niecza:, std:, or /msg p6eval perl6: ... | irclog: irc.perl6.org/ | UTF-8 is our friend!
Set by sorear on 4 February 2011.
Radvendii nom: sub a {say "shouldnt be here"}; 0 && a(); 00:14
p6eval nom 052cc6: ( no output )
Radvendii nom: sub a {say "shouldnt be here"}; 1 && a();
p6eval nom 052cc6: OUTPUT«shouldnt be here␤»
Radvendii nom: given 42 {when Int { 0 && proceed}; when 42 {say "shouldn't be here"}} 00:15
p6eval nom 052cc6: ( no output )
Radvendii nom: given 42 {when Int {"hello" but (0 && proceed)}; when 42 {say "shouldn't be here"}} 00:16
p6eval nom 052cc6: ( no output )
00:22 PacoAir left 00:36 pmurias left 00:45 `10 left, `10 joined 00:54 molaf__ joined 00:58 molaf_ left
sorear good * #perl6 01:17
[Coke] I can now build partcl on nqp. but running it dies with: A method named 'backtrack' already exists in class 'PAST;Regex'. It may have been supplied by a role. 01:24
github.com/partcl/partcl-nqp/tree/nqp if anyone wants to hack on it. 01:30
sorear Radvendii: I use 'rlwrap mono[-sgen] run/Niecza.exe' personally 01:32
Radvendii: niecza is carping about [||], which IMO doesn't make much sense
Radvendii sorear: to which comment are you responding? 01:33
sorear 14:30 < Radvendii> what does niecza mean by "This macro cannot be used as a function" 01:34
13:45 < Radvendii> Is there a way to get command history on niecza? (Like, i know CPAN offers it only after you download some module or something...)
Radvendii ah
thank you
sorry, I couldn't remember what i had said
01:42 tokuhirom left 01:45 datums_nb joined 01:48 datums_nb left 02:10 lutok left
Radvendii nom: note: 5.perl; 02:25
p6eval nom 052cc6: OUTPUT«===SORRY!===␤Confused at line 1, near "note: 5.pe"␤»
benabik nom doesn't know the "fung: args" style yet 02:26
func! 02:27
Radvendii nom: my $a=5; note :$a.perl;
p6eval nom 052cc6: OUTPUT«"a" => 5␤»
Radvendii that's not even what i was trying to do
nor did i know it existed
but that's cool
nom: <w b>.grep: {say $_}; 02:31
p6eval nom 052cc6: ( no output )
Radvendii nom: <w b>.grep: {say $_};
p6eval nom 052cc6: ( no output )
Radvendii alright, why the no output?
nom: say <w b>.grep: {$_}; 02:32
p6eval nom 052cc6: OUTPUT«w b␤»
02:32 wolfman2000 joined
Radvendii but why no output before? 02:33
sorear Radvendii: 'note: 5' is a noop statement that happens to have a label 02:37
you could use goto "note" elsewhere to go to the 5
Radvendii oh right 02:38
but then why "func: args"?
it's not a function...
benabik nom: <a b>.grep({say $_})
p6eval nom 052cc6: ( no output ) 02:39
Radvendii it's not a function...
damn it
benabik Huh. That does do output on my computer.
Radvendii i keep tabbing into iTerm and then hitting "up-enter" to recompile my program, and accidentally being on IRC :P
benabik: not on mine. what version of rakudo are you using? 02:41
benabik 2011.12-145-ged943e6
Radvendii ah. i'm using 2012.01 02:42
it must have broken
02:45 Chillance left
Radvendii gah! 02:45
i keep forgetting to put my variables in //s when I regex them
sorear Radvendii: you shouldn't put anything with side effects in the argument to grep 02:49
Radvendii huh? 02:52
i keep doing <w b>.grep: {$l !~~ $^x} which only matches if $l doesn't "eq" $^x.... 02:53
wait
i do have it in //s
e.g. /$^x/ 02:54
oh
you were talking about the other thign
why shouldn't you put side effects in grep?
so long as it returns False or True...
nom: say ?(<w b>.grep: {'wK' !~~ /$^x/}); say ?(<w b>.grep: -> $x {'wK' !~~ /$x/} #is this a bug? 02:57
p6eval nom 052cc6: OUTPUT«===SORRY!===␤Unsupported use of ?: for the conditional operator; in Perl 6 please use ??!!␤at /tmp/KMJ4g674Y5:1␤»
Radvendii nom: say ?(<w b>.grep: {'wK' !~~ /$^x/}); say ?(<w b>.grep: -> $x {'wK' !~~ /$x/}) #is this a bug?
p6eval nom 052cc6: OUTPUT«Bool::True␤Bool::True␤»
Radvendii wait
what?
that's not what i'm getting... 02:58
oops
i didn't want bools
nom: say (<w b>.grep: {'wK' !~~ /$^x/}); say (<w b>.grep: -> $x {'wK' !~~ /$x/}) #is this a bug?
p6eval nom 052cc6: OUTPUT«w b␤b␤»
Radvendii there we go
why are they different?
03:20 whiteknight left
gfldex looks like a bug to me 03:22
03:22 orafu left 03:23 orafu joined
sorear Radvendii: because grep is lazy and you can't rely on the sub being called in a specific order or at all 03:23
gfldex but the bug might be in a different spot then you think it is
sorear I die a little every time you write <a b>.grep({ say $_ }), Radvendii
Radvendii :P o-oh that's right. lazy. that makes sense. sorry about the death and all. 03:24
gfldex Radvendii: you may want to read perlcabal.org/syn/S05.html#Variable...erpolation 03:25
benabik sorear++ # don't die 03:26
Radvendii OH! 03:28
so what i want is /<$var>/
:D
gfldex maybe 03:29
Radvendii nom: my $var = 'w'; say 'wQ' ~~ /<$var>/
p6eval nom 052cc6: OUTPUT«=> <w>␤␤»
Radvendii nom: my $var = 'w'; say 'wQ' ~~ /$var/ 03:30
p6eval nom 052cc6: OUTPUT«=> <w>␤␤»
Radvendii oh
fooey
so what's the difference?
gfldex at times it helps to bang you head against the wall until you forget anything you know about Perl 5 before you write "use v6;"
03:30 shinobicl___ joined
Radvendii :P 03:31
gfldex the difference is that <$var> forces the match engine to look for a rule with the name that is stored in $var
unless you stick a regex into $var, then it should use that regex in place
if you stick anything that is not Str|Match into $var, well good luck to you 03:32
Radvendii oh. i figured out what my problem this time with them was, it didn't have to do with <>s or such. (and that makes sense, from what you're telling me) 03:34
but i find it odd that .grep: {'a' ~~ /$^x/} should have different results from .grep: -> {'a' ~~ /$x/}
unless you tell me that there's a reason for that 03:35
gfldex $^x will be defined, $x will not be defined 03:37
whereby defined is not in the perl 5 sense defined
you imply that grep is calling the function with a parameter 03:38
i would not bet on that
if it would, you would get the same result for both cases
sorear Radvendii: you get different results because you forgot to add $x to the signature in the second case
gfldex he did not 03:39
03:39 Psyche^ joined
sorear {'a' ~~ /$^x/} is equivalent to -> $x {'a' ~~ /$x/} 03:39
Radvendii oh
i did forget
but that's what i menat
meant*
gfldex sorear: scroll up please
Radvendii when i do supply $x as an argument
the later version works correctly 03:40
the former does not
sorear possibly Rakudo is getting confused because // is a block itself, maybe the parameter is getting attached to the Regex block rather than the Block block
perl6: say (/$^x/).signature 03:41
p6eval niecza v13-357-g9374d97: OUTPUT«===SORRY!===␤␤Placeholder variable $^x may not be used outside of a block at /tmp/1tq2y3ZtNL line 1:␤------> say (/⏏$^x/).signature␤␤Unhandled exception: Check failed␤␤ at /home/p6eval/niecza/boot/lib/CORE.setting lin…
..rakudo 052cc6: OUTPUT«:(Mu , Mu %_!)␤»
..pugs b927740: OUTPUT«*** No such method in class Regex: "&signature"␤ at /tmp/EgzjfgjtTo line 1, column 5 - line 2, column 1␤»
Radvendii apparently not
sorear perl6: my $foo = { 'a' ~~ /$^x/ }; say $foo('cat'); say $foo('dog');
p6eval rakudo 052cc6: OUTPUT«#<failed match>␤#<failed match>␤»
..pugs b927740: OUTPUT«*** No compatible multi variant found: "$foo"␤ at /tmp/lPd92MbBKn line 1, column 33-44␤»
..niecza v13-357-g9374d97: OUTPUT«Match()␤Match()␤»
03:42 Patterner left, Psyche^ is now known as Patterner
sorear perl6: my $foo = -> $x { 'a' ~~ /$x/ }; say $foo('cat'); say $foo('dog'); 03:42
p6eval rakudo 052cc6: OUTPUT«#<failed match>␤#<failed match>␤»
..niecza v13-357-g9374d97: OUTPUT«Match()␤Match()␤»
..pugs b927740: OUTPUT«Error eval perl5: "if (!$INC{'Pugs/Runtime/Match/HsBridge.pm'}) {␤ unshift @INC, '/home/p6eval/.cabal/share/Pugs-6.2.13.20111008/blib6/pugs/perl5/lib';␤ eval q[require 'Pugs/Runtime/Match/HsBridge.pm'] or die $@;␤}␤'Pugs::Runtime::Match::HsBridge'␤"␤*** '<HAND…
Radvendii 'a' !~~ /cat/; 'cat' ~~ /a/
sorear er, wait, I got that backward
Radvendii yup
sorear perl6: my $foo = -> $x { 'cat' ~~ /$x/ }; say $foo('a'); say $foo('o'); 03:43
p6eval niecza v13-357-g9374d97: OUTPUT«#<match from(1) to(2) text(a) pos([].list) named({}.hash)>␤Match()␤»
..rakudo 052cc6: OUTPUT«=> <a>␤␤#<failed match>␤»
..pugs b927740: OUTPUT«Error eval perl5: "if (!$INC{'Pugs/Runtime/Match/HsBridge.pm'}) {␤ unshift @INC, '/home/p6eval/.cabal/share/Pugs-6.2.13.20111008/blib6/pugs/perl5/lib';␤ eval q[require 'Pugs/Runtime/Match/HsBridge.pm'] or die $@;␤}␤'Pugs::Runtime::Match::HsBridge'␤"␤*** '<HAND…
sorear perl6: my $foo = { 'cat' ~~ /$^x/ }; say $foo('a'); say $foo('o');
p6eval rakudo 052cc6: OUTPUT«#<failed match>␤#<failed match>␤»
..niecza v13-357-g9374d97: OUTPUT«#<match from(1) to(2) text(a) pos([].list) named({}.hash)>␤Match()␤»
..pugs b927740: OUTPUT«*** No compatible multi variant found: "$foo"␤ at /tmp/VEWmgo0MET line 1, column 35-44␤»
Radvendii that's what i've been experiencing
sorear that's very strange
it's not a problem with you
I might even say bug 03:44
Radvendii thanks for the assurence, i tend to assume everything is
sorear perl6: my $foo = { 'cat' ~~ /$^x/ }; say $foo.signature
Radvendii (my fault, that is)
p6eval niecza v13-357-g9374d97: OUTPUT«:(Any $x)␤»
..pugs b927740: OUTPUT«:()␤»
..rakudo 052cc6: OUTPUT«:(Mu \$_)␤»
Radvendii regexes tend to screw up all sorts of variables
sorear nom: my $foo = { /$^x/ }; say $foo.signature
p6eval nom 052cc6: OUTPUT«:(Mu \$_)␤»
Radvendii $_, *, etc.
sorear nom: my $foo = { /$^x/ }; say $foo('cat').signature
p6eval nom 052cc6: OUTPUT«:(Mu , Mu %_!)␤»
gfldex nom: my $foo = { say $^x; 'a' ~~ /$^x { say $^x } /;}; $foo('a');
p6eval nom 052cc6: OUTPUT«===SORRY!===␤Placeholder variable $^x may not be used here because the surrounding block takes no signature␤at /tmp/BM2GEerwsE:1␤»
sorear Radvendii: remember that a Regex is just a funny kind of Sub, and it has a scope of its own 03:45
Radvendii sorear: oh. that's weird. not expected at least... well, i know now
gfldex and a block inside a Regex is a funny kind of sub aswell
Radvendii i knew that much 03:46
why didnt the above code work?
gfldex mine?
Radvendii yeah
gfldex because the regex engine called the most inner block with no parameter 03:47
Radvendii ah
gfldex that's a runtime error
Radvendii i see
sorear $^x, to a first approximation, attaches to the innermost curlies
gfldex: No, it's a compile time error. Notice the '===SORRY!==='
Radvendii those variables are like extra $_s
gfldex wow, perl 6 got quite clever already
sorear blocks embedded in a regex are forbidden to have parameters 03:48
gfldex: STD has caught this case for at least a year
nom: /{$^x}/
p6eval nom 052cc6: OUTPUT«===SORRY!===␤Placeholder variable $^x may not be used here because the surrounding block takes no signature␤at /tmp/H_3SLpUQpj:1␤»
sorear b: /{$^x}/
p6eval b 1b7dd1: ( no output )
Radvendii :P
ah b: does anyone use that anymore?
sorear looks like b doesn't do it 03:49
03:49 plutoid joined
sorear Radvendii: yes 03:49
Radvendii sorear: for real? for what?
sorear Radvendii: nom still has more rough edges than b does
Radvendii oh
sorear so, officially, we tell production users to stick with b for now
Radvendii i see
sorear where 'production' approximately means 'star' 03:50
iiuc there's a star release planned for next week
gfldex there are quite a few things that nom does better thought
Radvendii gfldex: such as?
gfldex better error messages as a start 03:51
it's a fairly long list
Radvendii mhmm
okay
(that wasn't meant to be doubtful, just asenting) 03:54
benabik Ah.... 04:13
Figured out the grep issue, I think. 04:14
Grep returns something lazy, so if you never ask for the values, it never calls the sub.
nom: (<a b>.grep: { .say })[0]
p6eval nom 052cc6: OUTPUT«a␤»
benabik Radvendii: ^^ 04:15
Radvendii benabik: yup. we were discussing that earlier. essentially, the take away lesson is never put code you want to run in a grep statement 04:16
benabik Oh. I got distracted in the middle here, missed that convo.
I was building a new copy of nom trying to figure out what "broke". :-D 04:17
sorear o/ benabik 04:18
benabik o/ sorear
Radvendii there is something that we believe "broke" 04:19
(without the quotes... :P)
nom: my $f = -> { 'cat' ~~ /$^x/ }; say $f('a').perl 04:20
p6eval nom 052cc6: OUTPUT«Too many positional parameters passed; got 1 but expected 0␤ in block <anon> at /tmp/OFrkFnzPvI:1␤ in block <anon> at /tmp/OFrkFnzPvI:1␤ in <anon> at /tmp/OFrkFnzPvI:1␤»
Radvendii sorear: i guess indeed the regex makes it's own scope 04:21
quite inconvenient
how come it worked for you though?
benabik nom: (-> { $^x }).signature.say 04:22
Radvendii nom: my $foo = { 'cat' ~~ /$^x/ }; say $foo('a'); say $foo('o');
p6eval nom 052cc6: OUTPUT«===SORRY!===␤Placeholder variable cannot override existing signature␤at /tmp/8RxRLehpi3:1␤»
nom 052cc6: OUTPUT«#<failed match>␤#<failed match>␤»
Radvendii that's what it was
no lambda
nom: my $foo = { 'cat' ~~ /$^x/ }; say $foo('a'); say $foo('o');
p6eval nom 052cc6: OUTPUT«#<failed match>␤#<failed match>␤»
Radvendii nom: 'cat' ~~ /'a'/
p6eval nom 052cc6: ( no output )
Radvendii nom: say 'cat' ~~ /'a'/
p6eval nom 052cc6: OUTPUT«=> <a>␤␤»
Radvendii sorear: if regexs did create their own scope, it wouldn't accept the argument at all... 04:23
nom: my $foo = { /$^x/.perl.say }; say $foo('a'); say $foo('o');
p6eval nom 052cc6: OUTPUT«regex _block1014(Mu , Mu %_!) { ... }␤Bool::True␤regex _block1014(Mu , Mu %_!) { ... }␤Bool::True␤»
Radvendii cocks an eyebrow 04:24
nom: my $foo = { /$^x/.say }; say $foo('a'); say $foo('o');
p6eval nom 052cc6: OUTPUT«_block1014␤Bool::True␤_block1014␤Bool::True␤»
Radvendii oh...
any way to get it to print out what it really is?
colomon doubt it 04:25
reverse engineering code like that is something none of the p6s do yet, to my knowledge
gfldex there is a debugger for //
Radvendii gfldex: how do i get my hands on it? / what do i type? 04:26
gfldex perl6advent.wordpress.com/2011/12/0...rdebugger/
planetsix.perl.org/ for more 04:27
Radvendii wow. i've gotta clean up all of my tabs
(in safari)
i'm still having trouble installing panda, so do any of you ahve the grammar debugger already? 04:29
im going to go take a shower, ill bbl 04:40
04:51 birdwindupbird joined 04:59 drbean left 05:00 drbean joined 05:04 Radvendii left 05:22 dukeleto left 05:23 dukeleto joined, dukeleto left 05:24 dukeleto joined 05:25 dukeleto left 05:26 dukeleto joined, dukeleto left, dukeleto joined, dukeleto left, dukeleto joined 05:48 replore_ joined 05:51 plutoid left 05:55 shinobicl___ left
sorear niecza: say 42.fmt('%08x') 06:00
p6eval niecza v13-357-g9374d97: OUTPUT«0000002a␤»
sorear niecza: say 42.fmt('%08X')
p6eval niecza v13-357-g9374d97: OUTPUT«0000002A␤»
sorear niecza: say (-42).fmt('%08X')
p6eval niecza v13-357-g9374d97: OUTPUT«FFFFFFD6␤»
sorear nom: say (-42).fmt('%08X')
p6eval nom 052cc6: OUTPUT«FFFFFFFFFFFFFFD6␤»
moritz o/ 06:06
sorear o/ moritz
snarkyboojum stupid question - how does one get a decimal representation of a Rat, i.e. I don't want scientific notation, I want decimal notation :D 06:07
tadzik .Numeric?
sorear niecza: say (1/1024).Num
p6eval niecza v13-357-g9374d97: OUTPUT«0.0009765625␤»
sorear niecza: say (1/1048576).Num 06:08
snarkyboojum how about something like 1/998001
p6eval niecza v13-357-g9374d97: OUTPUT«9.5367431640625E-07␤»
sorear niecza: say (1/1048576).fmt('%f')
p6eval niecza v13-357-g9374d97: OUTPUT«??␤»
snarkyboojum doesn't seem to work
sorear niecza: say (1/1048576).fmt('%d')
p6eval niecza v13-357-g9374d97: OUTPUT«0␤»
sorear niecza: say (1/1048576).fmt('%g')
p6eval niecza v13-357-g9374d97: OUTPUT«Unhandled exception: invalid format specifier␤ at /home/p6eval/niecza/lib/CORE.setting line 0 (sprintf @ 1) ␤ at /home/p6eval/niecza/lib/CORE.setting line 640 (Cool.fmt @ 3) ␤ at /tmp/UepwgQ_yd1 line 1 (mainline @ 2) ␤ at /home/p6eval/niecza/lib/CORE.…
sorear very strange result for %f
nom: say (1/1048576).fmt('%f')
p6eval nom 052cc6: OUTPUT«0.000001␤»
sorear nom: say (1/1048576).fmt('%.12f')
p6eval nom 052cc6: OUTPUT«0.000000953674␤»
sorear nom: say (1/998001).fmt('%.12f')
p6eval nom 052cc6: OUTPUT«0.000001002003␤»
sorear nom: say sqrt 998001 06:09
p6eval nom 052cc6: OUTPUT«999␤»
snarkyboojum say (1/998001).fmt('%.100f')
eek
06:09 kaleem joined
sorear that's an interesting number 06:09
nom: say (1/998001).fmt('%.100f') 06:10
p6eval nom 052cc6: OUTPUT«0.0000010020030040050059552870663145962559781310119433328509330749511718750000000000000000000000000000␤»
snarkyboojum nom: say (1/998001).fmt('%.100f')
p6eval nom 052cc6: OUTPUT«0.0000010020030040050059552870663145962559781310119433328509330749511718750000000000000000000000000000␤»
tadzik hehe, been reading hacker news, haven't you? :)
snarkyboojum why the truncation?
:P
sorear course it'll run into Num issues
snarkyboojum @tadzik
sorear you can't get more than ~17 useful digits out of a general Num
snarkyboojum how do get a useful 100 digit number out of it? :D
sorear and currently you can't go from Rat to Str except through Num 06:11
snarkyboojum looks at colomon
sorear snarkyboojum: echo 'oscale=120; 1/998001' | bc
just 'scale', sorry
snarkyboojum 0?
TimToady
.oO( %f for fatrats :)
snarkyboojum awww.. I wanted to use perl6 ;) 06:12
sorear: thank ye ;) for the *nix pipeline 06:14
still want a perl6ish way to do it ;)
TimToady if we can have a pi spigot, we can certaintly have any other kind of spigot 06:15
snarkyboojum TimToady: a 'spigot' being a tap or valve? :D 06:17
sorear it wouldn't hurt to be better than everyone at everything, but it's not much of a priority of mine atm 06:18
snarkyboojum I particularly like the association with "bunghole" for some reason
sorear: I think it's a reasonable request - perhaps it's an unreasonably reasonable request tho ;D 06:19
sorear it's an explicit priority of TimToady's 06:20
snarkyboojum physical challenge for colomon then I reckon :P 06:21
TimToady perl6: my $x = 1/998001; print $x.floor, '.'; for ^100 { $x *= 10; print my $digit = $x.floor; $x -= $digit; }; print "\n"; 06:23
p6eval pugs b927740, rakudo 052cc6, niecza v13-357-g9374d97: OUTPUT«0.0000010020030040050060070080090100110120130140150160170180190200210220230240250260270280290300310320␤»
TimToady wow, complete agreement! 06:24
06:26 arlinius left
TimToady snarkyboojum: ^^ 06:27
snarkyboojum TimToady: sweet :)
06:33 replore_ left
TimToady note that won't work for negatives without stripping the sign 06:33
06:34 koban joined 06:35 koban left
sorear niecza: say Bool.so 06:41
p6eval niecza v13-357-g9374d97: OUTPUT«Bool()␤»
sorear it seems several spectests expect <a b> === <a b> to be True 06:45
dalek ecza: 301a891 | sorear++ | lib/ (2 files):
Add WHICH, proper ===, ObjAt modelled on (but significantly divergent from) Rakudo-nom
ast: b05a6c1 | sorear++ | / (4 files):
Unfudge suprisingly few tests that depended on value-type === for niecza
06:46
sorear phenny: tell [Coke] multi method WHICH(Date:D:) { ObjAt.new(str => $!daycount, ref => self.WHAT) } 06:48
phenny sorear: I'll pass that on when [Coke] is around.
07:09 GlitchMr joined 07:31 wtw joined 07:37 GlitchMr left 08:31 GlitchMr joined 08:33 mj41 joined 08:43 fsergot left 08:49 bkolera joined 08:57 pnu left 09:00 koban joined, koban left 09:02 pnu joined
sorear -> sleep 09:05
09:05 fsergot joined, GlitchMr42 joined 09:06 GlitchMr left 09:07 MContagious joined 09:10 agentzh joined
masak good morning, #perl6! 09:12
moritz \o masak 09:13
masak perl6: say 1 / 998001 09:19
p6eval rakudo 052cc6: OUTPUT«1.00200300400501e-06␤»
..niecza v13-358-g301a891: OUTPUT«1.002003004005006E-06␤»
..pugs b927740: OUTPUT«0.000001002003004005006007008009010011012␤»
masak cf news.ycombinator.com/item?id=3514721
nom: my $r = 1/998001; loop { say ($r * 1000).fmt("%03d"); $r *= 1000; $r -= $r.Int } 09:23
p6eval nom 052cc6: OUTPUT«(timeout)000␤001␤002␤003␤004␤005␤006␤007␤008␤009␤010␤011␤012␤013␤014␤015␤016␤017␤018␤019␤020␤021␤022␤023␤024␤025␤026␤027␤028␤029␤030␤031␤032␤033␤034␤035␤036␤037␤038␤039␤040␤041␤042␤043␤044␤045␤046␤047␤048␤049␤050␤051␤052␤053␤054␤055␤056␤057␤058␤059␤060␤061␤062␤063␤064…
masak niecza: my $r = 1/998001; loop { say ($r * 1000).fmt("%03d"); $r *= 1000; $r -= $r.Int }
p6eval niecza v13-358-g301a891: OUTPUT«(timeout)000␤001␤002␤003␤004␤005␤006␤007␤008␤009␤010␤011␤012␤013␤014␤015␤016␤017␤018␤019␤020␤021␤022␤023␤024␤025␤026␤027␤028␤029␤030␤031␤032␤033␤034␤035␤036␤037␤038␤039␤040␤041␤042␤043␤044␤045␤046␤047␤048␤049␤050␤051␤052␤053␤054␤055␤056␤057␤058␤059␤060␤06…
masak it's a rational number which produces the integer sequence 000..997, 999 :) 09:25
09:28 c1sung left 09:40 c1sung joined 09:42 daxim joined
masak also, another beautiful Wikipedia list via @luqui on Twitter: en.wiktionary.org/wiki/Category:Eng...ntractions 09:43
"That bo's'n over in the fo'c'sle wouldn't've amounted to a ha'p'orth!" 09:45
09:45 domidumont left
masak .oO( English as she is s'p'ke ) 09:46
09:48 domidumont joined 09:52 agentzh left
bbkr rakudo: sub foo ( :$id? where { say "I should not be here when there is no param passed"} ) {}; foo() # is this a bug? 10:07
p6eval rakudo 052cc6: OUTPUT«I should not be here when there is no param passed␤»
arnsholt Don't think so. It's an optional argument, and it's not passed 10:09
10:10 fasad joined
arnsholt If you want to require the named to be passed, say :$id! 10:10
bbkr yes, i made it optional on purpose to show that where{} section is triggered when it should not be 10:11
i mean - how ca you check subset rule of something that was not passed to you ?
arnsholt Herp. I can't read, apparently. Sorry 10:12
10:12 agentzh joined
fasad masak: hi ! 10:13
masak: I just copy-pasted ur chomp! game (strangelyconsistent.org/blog/june-15-2011-chomp) but get i get this error: Confused at line 15, near "PLAYER:\nlo" 10:14
i'm using rakudo-nom 10:15
moritz nom doesn't like the labels 10:17
fasad moritz: u mean it can't handle labels? 10:18
moritz correct 10:19
and it's spelled "you", not "u" :-)
fasad hmm.. so i need to rewrite the code... 10:20
moritz: :-O 10:21
moritz or implement labels in nom :-)
fasad lol...
moritz niecza: foo: while 1 { last foo; }
p6eval niecza v13-358-g301a891: ( no output )
moritz or use niecza
fasad one more doubt, on strangelyconsistent.org/blog/june-1...-operators , towards the end, "binds tightly" & "binds loosely", is he talking about operator "precedence" ? 10:25
moritz yes 10:26
fasad ok, thanks 10:27
english is my second language so sometimes don't get the hang of some phrases :| 10:28
i installed rakudo-nom using rakudo.org/how-to-get-rakudo-nom/, how do i keep it updated? 10:31
moritz you occasionally run 'git pull', and then 'make install' (and if that complains that you need to run Configure.pl, you run Configure.pl again, and then 'make install') 10:33
jnthn morning, #perl6 10:34
fsergot o/ :)
10:36 Trashlord left
fasad moritz: i should skip 'make' ? 10:36
10:37 GlitchMr42 is now known as GlitchMr
moritz fasad: 'make install' implies 'make' 10:37
fasad moritz: oh. thanks 10:38
bbkr how can I force empty method signature? for example I want to declare "method foo () {}" and I don't want to "foo(id=>123)" be dispatched to it. 10:47
10:48 takesako_ left
moritz bbkr: all method signatures have an implicit *%_ attached to it 10:50
but maybe
arnsholt bbkr: That's multi sub foo(:$id!) IIRC
moritz nom: class A { method a(*%a where !%a) } }; A.a(foo => bar)
p6eval nom 052cc6: OUTPUT«===SORRY!===␤Missing block at line 1, near "} }; A.a(f"␤»
moritz nom: class A { method a(*%a where !%a) {} }; A.a(foo => bar)
p6eval nom 052cc6: OUTPUT«===SORRY!===␤CHECK FAILED:␤Undefined routine '&bar' called (line 1)␤»
moritz nom: class A { method a(*%a where !%a) {} }; A.a(foo => 'bar') 10:51
p6eval nom 052cc6: OUTPUT«Constraint type check failed for parameter '%a'␤ in method a at /tmp/GkikCo6H_E:1␤ in block <anon> at /tmp/GkikCo6H_E:1␤ in <anon> at /tmp/GkikCo6H_E:1␤»
moritz bbkr: that would be a way
bbkr that should do, thanks :)
arnsholt nom: multi sub foo() { say "no" }; multi sub foo(:$id!) { say $id }; foo(); foo(id => 1); # Works as well 10:52
p6eval nom 052cc6: OUTPUT«no␤1␤»
11:02 MContagious left
jnthn moritz: Does S03-metaops/not.rakudo fail for you also? 11:23
dalek ecza: e993223 | (Paweł Murias)++ | p5test/ (8 files):
Added p5test which test various stages of linking in a perl5 interpreter to mono.
11:24 pmurias joined
pmurias colomon: hi 11:24
pmurias notices he wrote the commit msg in broken english :( 11:25
dalek kudo/nom: 966f65c | jnthn++ | src/core/ (3 files):
Implement <prior>, this time without busting a bunch of spectests.
11:27
kudo/nom: b890f79 | jnthn++ | t/spectest.data:
Run S05-metasyntax/prior.t.
ast: d5e732f | jnthn++ | S05-metasyntax/prior.t:
Correct what would appear to be a thinko.
pmurias colomon: the p5test script which i comited should help diagnose why the p5 interop fails to build on your machine 11:29
dalek ecza: 0aaf9bf | (Paweł Murias)++ | p5test/p5test.pl:
Avoid harcoding the .so extension when building shared libraries from p5test.
11:31
11:45 fasad left
colomon pmurias++ 11:45
bbkr rakudo: one(Array,Hash) # should junction work on types? I cannot find in spec. 11:49
p6eval rakudo 052cc6: OUTPUT«Cannot look up attributes in a type object␤ in method infinite at src/gen/CORE.setting:4749␤ in method infinite at src/gen/CORE.setting:4432␤ in method infinite at src/gen/CORE.setting:4749␤ in method infinite at src/gen/CORE.setting:4432␤ in method gimme at s…
11:49 Trashlord joined
bbkr consequence of syntax "$x ~~ Array" should be possibility to use "$x ~~ Array|Hash" 11:50
moritz bbkr: I think it should work
jnthn Should work.
bbkr reports bug 11:51
rakudo: Array|Hash
moritz bbkr++
p6eval rakudo 052cc6: OUTPUT«Cannot look up attributes in a type object␤ in method infinite at src/gen/CORE.setting:4749␤ in method infinite at src/gen/CORE.setting:4432␤ in method infinite at src/gen/CORE.setting:4749␤ in method infinite at src/gen/CORE.setting:4432␤ in method gimme at s…
moritz nom: 1|Any 11:55
p6eval nom 052cc6: ( no output )
moritz nom: Any|1
p6eval nom 052cc6: ( no output )
moritz nom: List|1
p6eval nom 052cc6: OUTPUT«Cannot look up attributes in a type object␤ in method infinite at src/gen/CORE.setting:4749␤ in method infinite at src/gen/CORE.setting:4432␤ in method infinite at src/gen/CORE.setting:4749␤ in method infinite at src/gen/CORE.setting:4432␤ in method gimme at src/…
moritz something is sensitive to listness
nom: say 2 | <a b c>
p6eval nom 052cc6: OUTPUT«any(2, a b c)␤» 11:56
moritz but why?
nom: say 2 | 1..*
p6eval nom 052cc6: OUTPUT«(timeout)»
moritz nom: say (List, List).eager 11:57
p6eval nom 052cc6: OUTPUT«use of uninitialized value of type List in string context␤use of uninitialized value of type List in string context␤ ␤»
moritz nom: sub f(*@a) { @a.eager }; f List, 1 11:59
p6eval nom 052cc6: OUTPUT«Cannot look up attributes in a type object␤ in method infinite at src/gen/CORE.setting:4749␤ in method infinite at src/gen/CORE.setting:4432␤ in method gimme at src/gen/CORE.setting:4738␤ in method eager at src/gen/CORE.setting:4715␤ in sub f at /tmp/ig7i3cZ50h:1…
moritz nom: (List, 1).eager
p6eval nom 052cc6: ( no output )
jnthn nom: (List, 1).list.eager 12:01
p6eval nom 052cc6: OUTPUT«Cannot look up attributes in a type object␤ in method infinite at src/gen/CORE.setting:4749␤ in method infinite at src/gen/CORE.setting:4432␤ in method gimme at src/gen/CORE.setting:4738␤ in method eager at src/gen/CORE.setting:4715␤ in block <anon> at /tmp/XcHBV…
moritz mmm
TimToady niecza: say 2 | 1..* 12:02
p6eval niecza v13-358-g301a891: OUTPUT«any(2..Inf, 1..Inf)␤»
TimToady niecza: Array|Hash
p6eval niecza v13-358-g301a891: ( no output )
TimToady niecza: say Array|Hash
p6eval niecza v13-358-g301a891: OUTPUT«any(Array, Hash)␤»
colomon pmurias: tests 4 and 5 fail, both with System.DllNotFoundException: /Users/colomon/tools/niecza/p5test/test4lib.dylib 12:03
TimToady those both give Unitialized value in string context warnings locally for niecza
niecza: say (List, List).eager
p6eval niecza v13-358-g301a891: OUTPUT«Unhandled exception: Unable to resolve method eager in class Parcel␤ at /tmp/UtoJ4OSD8V line 1 (mainline @ 2) ␤ at /home/p6eval/niecza/lib/CORE.setting line 3609 (ANON @ 3) ␤ at /home/p6eval/niecza/lib/CORE.setting line 3610 (module-CORE @ 62) ␤ at /h…
12:05 mj41 left
TimToady I guess it's the REPL that is giving the warnings 12:06
12:06 drbean left 12:07 drbean joined
moritz I might have a patch for the Array|Hash thing 12:12
but of course I'll only know in 20 minutes after the setting has been compiled ... :/
Timbus i preferred when it just took 2gb of my ram 12:13
jnthn Well, you're both welcome to contribute to the serialization work I'm doing. :P 12:15
moritz jnthn: I do consider it 12:16
the bigint stuff showed me that I can do a bit C stuff, with guidance :-) 12:17
jnthn: what's the plan?
jnthn moritz: I've started work on the nqp/bs branch (bs = bounded serialization, but I can't be bothered to type that everytime... :)) 12:18
moritz: So far the main engine for it is in src/6model/serialize.c.
tadzik yeah, keep telling yourself it's not a pun ;)
jnthn tadzik: shh :P
At least it's not as bad as the Perl 6 Coding Contest :P 12:19
tadzik :>
jnthn moritz: Also tests in t/serialize/01-basic.t.
moritz (bs) yeah, I've guessed what it means :-) 12:20
jnthn moritz: Plan is something like: 1) get P6opaque serialization working, which shouldn't be too bad. 2) make cross-references between objects work. Also in theory not too hard. 3) design closure serialization mechanism (hard). 4) get STable serialization in place, at which point we should be able to serialize types. 12:21
12:21 mj41 joined 12:22 drbean left
moritz for serializing P6opaque objects, can we count on the type object being available? 12:22
I hope so :-)
jnthn moritz: The rule is that you can rely on the representation data being available.
moritz ok
jnthn moritz: Which contains enough to do serialization.
moritz: I didn't quite get to handling type-objectness yet. 12:23
dalek ast: 806d3f7 | jnthn++ | S12-class/namespaced.t:
Untodo a test and make it handle CHECK time detection of missing subs.
12:24
ast: cfcbb8c | jnthn++ | S05-grammar/polymorphism.t:
Fix a thinko, and tweak to avoid an issue with compile-time detection of something that hadn't use to get that.
kudo/nom: 7f8c71c | jnthn++ | src/ (3 files):
First crack at getting /<Foo::Bar::baz>/ working again...think we didn't have that since the alpha days. Passes various tests.
12:25
kudo/nom: 6eae67e | jnthn++ | t/spectest.data:
Run S12-class/namespaced.t and S05-grammar/polymorphism.t.
masak I notice from the backlog that snarkyboojum++ beat me to the 1/998001 thing ;)
jnthn o/ masak! 12:26
masak \o !
was there ever a resolution about the /$^x/ thing? who's right, Niecza or Rakudo?
I'm sort of siding with Niecza there...
jnthn nom: /:my $x/; say $x
p6eval nom b890f7: OUTPUT«===SORRY!===␤Unrecognized regex metacharacter (must be quoted to match literally) at line 1, near "my $x/; sa"␤»
jnthn nom: /:my $x;/; say $x
p6eval nom b890f7: OUTPUT«Any()␤»
jnthn nom: /$^x;/ 12:27
p6eval nom b890f7: OUTPUT«===SORRY!===␤Preceding context expects a term, but found infix / instead at line 1, near "$^x;/"␤»
jnthn nom: /$^x/
p6eval nom b890f7: ( no output )
jnthn Hm, that should really whine.
masak it considers the regex to be a block.
jnthn I wish they were.
Alas, I think the spec says otherwise.
masak nod. 12:28
jnthn I am a tad surprised that the :my thing works out and $^x doesn't, though. 12:29
masak: Macro hacking today? :)
12:30 drbean joined
masak yes \o/ 12:33
jnthn \o/
masak but as with any day-at-home, a lot of other little things slip in... :)
12:33 bkolera left, amkrankruleuen left
masak gonna do ~30 of $dayjob before I get going. 12:33
jnthn heh, yes, I should do a little of that too :) 12:34
12:36 bkolera joined
dalek ast: a5ebaab | jnthn++ | S05-grammar/polymorphism.t:
Oops meant to unfudge this one.
12:36
12:41 drbean left 12:43 drbean joined 12:53 PacoAir joined 12:54 drbean left
dalek ast: 991dbdb | moritz++ | S03-metaops/not.t:
rakudo does not like empty todo fudges
12:54
12:54 drbean joined 13:08 drbean left 13:09 drbean joined
moritz nom: my @t; sub tracked(&f) { @t.push: &f }; tracked sub f() { say 'OH HAI' }; @t>>.() 13:09
p6eval nom 6eae67: OUTPUT«OH HAI␤»
moritz pseudo DSLs ftw! 13:10
jnthn :)
jnthn fixed >>.() recently :)
moritz nom: sub stupid (|$) { }; stupid sub routine() { 'does nothing' } 13:12
p6eval nom 6eae67: ( no output )
13:19 bluescreen10 left 13:21 drbean left 13:23 drbean joined 13:25 bluescreen10 joined
moritz jnthn: it seems that you haven't told ACT (the conference web system) that you want to attend GPW2012 13:29
jnthn moritz: Really? 13:30
moritz: I thought I had to do that in order to submit talks!
moritz jnthn: at least the guy who writes the invoices said that... :-) 13:31
jnthn: seems you are signed up correctly, and our treasurer is confused 13:32
jnthn moritz: Ah, I didn't buy a ticket...do I need to do that?
Or are speakers immune from this? :)
moritz jnthn: I think you should 13:33
it just triggers the treasurer to write an invoice to you, and leave him less confused
jnthn done 13:35
moritz thanks 13:36
dalek ast: d22f208 | moritz++ | S32-str/split.t:
a lone rakudo unfudge
13:36 Trashlord left 13:37 jlaire joined 13:49 kaleem left
masak oh! 13:49
masak checks if he has signed up
seems I have. 13:50
but... I should buy a ticket, too, by the above discussion... 13:51
moritz: regular price, right?
pmurias colomon: could you nopaste test4.exe.config? 13:52
masak has now bought a ticket 13:53
jnthn masak: Speakers >= 20 mins get reduced rate (50 EUR) 13:54
[Coke] yawns.
phenny [Coke]: 06:48Z <sorear> tell [Coke] multi method WHICH(Date:D:) { ObjAt.new(str => $!daycount, ref => self.WHAT) }
[Coke] rss feeds for github aren't escaping xml in commit messages. 13:57
13:57 jlaire left
[Coke] <prior> vanished in one of them, e.g. 13:57
13:58 jlaire joined
masak jnthn: oh! too late. oh well, I'm happy to pay full price if it comes to that. 13:58
jnthn [Coke]: Ouch! :)
masak [Coke]: I'm sure github would like to hear about this. 13:59
jnthn ponders a troll commit ;) 14:00
[Coke] jnthn: I will add it as a TODO. 14:01
colomon pmurias: gist.github.com/1688920
pmurias: (sorry for delay, busy cleaning for company due to arrive in an hour) 14:02
pmurias np ;)
the .dylib file exists?
colomon test4lib.dylib, yes 14:03
8368 bytes long, does that sound right?
afm # shoveling snow
[Coke] sorear, colomon: I now have rakudo's Temporal.pm building, we get 159 more tests and a lot of runtime issues; I'll clean those up and commit sometime this weekend.
14:04 joe___ joined
[Coke] jnthn: any feedback you might have on partcl/partcl-nqp's nqp branch is greatly appreciated. ;) 14:04
colomon [Coke]++
jnthn
.oO( When will Niecza produce something Rakudo can nab to get more tests... )
[Coke] jnthn: hee. ;)
how much of rakudo's perl6 came from pugs? 14:05
(any?)
moritz maybe parts of Test.pm
joe___ hi perl6 ! a stupid question . what's this .()?
moritz but nothing in the setting
timotimo what's the correct way to assign "say" to a &var? it seems my &debug = say will call say without argument and try to set the return value to &debug. 14:06
masak joe___: it's a function call.
nom: sub foo { say "OH HAI" }; foo.()
p6eval nom 6eae67: OUTPUT«OH HAI␤Method 'postcircumfix:<( )>' not found for invocant of class 'Bool'␤ in <anon> at src/gen/Metamodel.pm:3418␤ in block <anon> at /tmp/xCh4ZCXlFQ:1␤ in <anon> at /tmp/xCh4ZCXlFQ:1␤»
masak oh right.
jnthn masak: Need &
:)
moritz timotimo: $var = &say
masak nom: sub foo { say "OH HAI" }; &foo.()
p6eval nom 6eae67: OUTPUT«OH HAI␤»
masak \o/
jnthn The larger value Rakudo got from Pugs was the test suite built during it as well as the many spec improvements/clarifications.
timotimo moritz: can you explain why that works? why wouldn't i use the &sigil?
joe___ thanks masak
masak jnthn: yeah, brain not booted up enough yet. need coffee :P
jnthn Generally, the later you start building a Perl 6 implementation, the better off you are. :) 14:07
moritz timotimo: leaving out the sigil implies calling the sub immediately
jnthn timotimo: You can put anything in a scalar
nom: sub foo() { say 'hi' }; my &bar = &foo; bar() 14:08
p6eval nom 6eae67: OUTPUT«hi␤»
jnthn You can do that also.
14:09 bkolera left
timotimo ah. the error i was getting was actually from somewhere else - i was trying to set an empty block to &debug with &debug = {}, but of course that's an empty hash, not an empty block 14:10
{$_} instead works great
jnthn timotimo: &debug = -> { } # maybe clearer
moritz or {;} 14:11
14:11 xinming left
joe___ moritz's code .in the situation @t>>.() what is the function called?no function name? 14:12
14:13 xinming joined
moritz joe___: each entry in @t is a subroutine 14:13
(though there's just one inthere)
masak I wonder what the big downside would be of having {} be a Hash, but auto-promote to an empty Block when someone expects it.
moritz in my example 14:14
masak (bad masak, trying to subvert the type system)
timotimo: how's learning Perl 6 going? I'm curious.
14:15 Maddingue left
joe___ moritz: thanks. where is the doc I can read it about it? 14:15
timotimo lots of bashing my head against the interactive interpreter :)
14:15 Maddingue joined
PerlJam repl++ 14:15
timotimo now i'm trying to conditionally overwrite the global "say" if $debug is set to False, but that's not turning out so well 14:16
dalek ecza: e0b4e76 | (Paweł Murias)++ | p5test/p5test.pl:
try various gcc invocations in p5test
timotimo (i'm making a recursive fibonacci sequence calculator with memoization)
(i was very, very pleased with "multi fib(Int $x where %memo) { %memo{$x} }") 14:17
moritz joe___: S03 talks about the >> mhyper 14:18
timotimo: that's cute :-)
masak nom: my &real-say = &say; sub say { &real-say("LOL, NO U CAN'T") }; say 42
p6eval nom 6eae67: OUTPUT«===SORRY!===␤CHECK FAILED:␤Calling 'say' will never work with argument types (int) (line 1)␤ Expected: :()␤»
pmurias colomon: i made p5test try various ways of creating the shared library, you could check if any of them helps
joe___ moritz: thanks again.
masak nom: my &real-say = &say; sub say(*@) { &real-say("LOL, NO U CAN'T") }; say 42
p6eval nom 6eae67: OUTPUT«maximum recursion depth exceeded␤ in sub say at /tmp/K5ymsi5EMb:1␤ in sub say at /tmp/K5ymsi5EMb:1␤ in sub say at /tmp/K5ymsi5EMb:1␤ in sub say at /tmp/K5ymsi5EMb:1␤ in sub say at /tmp/K5ymsi5EMb:1␤ in sub say at /tmp/K5ymsi5EMb:1␤ in sub say at /tmp/K5ymsi5EMb… 14:19
masak oh right.
moritz helps to introduce a new scope
masak nom: sub say(*@) { $*OUT.say("LOL, NO U CAN'T") }; say 42
p6eval nom 6eae67: OUTPUT«LOL, NO U CAN'T␤»
timotimo it seems the sub say assignment happens before the code is run
masak timotimo: right, I botched it up.
timotimo: the '&say' in the assignment refers to my new sub. 14:20
moritz my &outer-say = &say; my $debug = 1; do { my &say = $debug ?? &outer-say !! sub (|$) { 'do nothing' }; say 'foo' }
nom: my &outer-say = &say; my $debug = 1; do { my &say = $debug ?? &outer-say !! sub (|$) { 'do nothing' }; say 'foo' }
p6eval nom 6eae67: OUTPUT«foo␤»
timotimo that was also my problem in my MAIN, i set "only sub say(*@a) {}", but apparently that only set say in the MAIN. then i used our in front and it happened always, regardless of whether the if around it would pass or not. or something. didn't analyse it thoroughly
moritz nom: my &outer-say = &say; my $debug = 0; do { my &say = $debug ?? &outer-say !! sub (|$) { 'do nothing' }; say 'foo' } 14:21
p6eval nom 6eae67: ( no output )
masak \o/
moritz timotimo: subroutines and subroutine lookup are both lexically scoped
timotimo: so an 'our' in front really doesn't change anything unless you explictly call with a namespace
14:22 joe___ left
masak moritz: what's the difference between 'subroutines' and 'subroutine lookup' in that sentence? :) 14:22
timotimo nom: say "huh."; sub say (*@a) {}; say "oh well.";
p6eval nom 6eae67: ( no output )
timotimo i'm used to this being different from python
but that's okay, just need to learn it once :)
moritz masak: well, there was a time where subroutines where lexical, but subroutine lookup was lexical + our-scope 14:23
masak nom: our sub foo { say "OH HAI" }; main::foo
p6eval nom 6eae67: OUTPUT«Could not find symbol 'main::&foo'␤ in block <anon> at /tmp/nOIgAI1Xr6:1␤ in <anon> at /tmp/nOIgAI1Xr6:1␤»
moritz timotimo: subroutine lookup is done before runtime, and postdeclarations are OK
masak shouldn't that be '&main::foo'?
moritz nom: foo(); sub foo() { say 'in foo, postdeclared' } 14:24
timotimo yes, that's what i thought. now i have to run
p6eval nom 6eae67: OUTPUT«in foo, postdeclared␤»
masak moritz: not sure I understand your distinction.
moritz masak: if it help you, think of $*foo variables, which can be declared lexically, but looked up dynamically 14:25
*helps 14:26
masak moritz: so you're talking about the scope on the one hand, and the lookup chain on the other? 14:27
it's like the declaration and the use have to make contact, and both have different reach.
or may have different reach. 14:28
moritz correct
masak but it's important not to be sloppy there. dynamic *variables* are still looked up statically/lexically. their *values* are looked up through the call chain. 14:29
14:29 jaldhar left
masak similarly with private attributes. 14:29
moritz huh
masak er, not a good comparison :)
moritz in what way are dynamic variables looked up statically?
jnthn huh
moritz std: $*a
p6eval std 47c76b3: OUTPUT«ok 00:01 108m␤»
jnthn masak: They're looked up using the dynamic chain :) 14:30
moritz if there was any kind of static lookup involved, that would die
masak I thought you had to do 'my $*a' even with dynamic vars...
jnthn masak: They're declared in a given lexical scope.
masak right.
jnthn masak: The lookup of them is entirely dynamic.
masak ok.
jnthn: it's weird, I distinctly remember us talking about this at the 2010 YAPC::EU attendees' dinner. 14:31
but maybe I'm mixing up "lexical scope" with "lexical variable lookup". 14:32
jnthn masak: You don't drink enough beer at YAPC::EU attendees' dinners. :P
masak jnthn: O RLY? how else would I be able to understand macros? huh? huh? :P
jnthn :P
jnthn is constantly bemused by masak's ability to remember discussions from years ago along with the location they took place :) 14:33
moritz remembers discussing macros with masak++ in breakfast hall of the hotel in Copenhaagen 2010 14:34
gist.github.com/1689053
masak remembers that breakfast discussion too 14:36
that's when we first realized that ASTs aren't closures, but still need to retain the lexical environment in which they were created.
then we forgot it for a while, and now we're back to being aware of it ;) 14:37
moritz I remember that my conclusion was mostly "I don't want to be the guy who implements macros" 14:38
:-)
masak yeah, ha ha! poor schmuck! :P 14:40
moritz std: 1 1
masak he's going to have to reach into the OUTER pointer or... something...
p6eval std 47c76b3: OUTPUT«===SORRY!===␤Two terms in a row at /tmp/9DoH7rgpR1 line 1:␤------> 1 ⏏1␤ expecting any of:␤ bracketed infix␤ infix or meta-infix␤ statement modifier loop␤Parse failed␤FAILED 00:01 108m␤»
masak nom: sub foo($x? where { .defined }) { say "OH HAI" }; foo 14:41
p6eval nom 6eae67: OUTPUT«Constraint type check failed for parameter '$x'␤ in sub foo at /tmp/nYpvuacgNi:1␤ in block <anon> at /tmp/nYpvuacgNi:1␤ in <anon> at /tmp/nYpvuacgNi:1␤»
masak what say you? should the above run the where clause or not?
this is re rt.perl.org/rt3//Public/Bug/Displa...?id=109182
jnthn masak: I was dubious about that ticket.
moritz masak: it's wrong 14:42
jnthn masak: We used to have a bug where we didn't type check default values.
moritz type checks also apply to defaults
jnthn Right 14:43
Yeah, I think the ticket is wrong.
moritz and optional params are just some weird kind of automatic undefined default
jnthn It's not so hard to imagine a where condition that matches on undefined and defined values.
14:44 wolfman2000 left
masak rejects toclet 14:44
[Coke] was ist eine toclet? 14:46
masak typing from the wrong angle :P 14:47
[Coke] wonders why masak's reply to 109134 displays incorrectly. 14:48
jnthn Yeah, it's best to hold your hands at a right angle to the keyboard :P
[Coke] (to the point where it's showing as a different thread.) 14:49
Did you reply via email or inside of RT?
colomon pmurias: gist.github.com/1689126 # and back to cleaning
jnthn goes for a stroll to help him ponder serialization stuff 14:50
pmurias colomon: it turns out -m32 helps, thanks 14:51
masak [Coke]: inside RT. it displayed correctly already when I wrote it.
s/correctly/incorrectly/ 14:52
[Coke]: so RT botched it up somehow.
jnthn: my keyboard is on the floor, and I was typing as I was standing up... :) 14:58
dalek ecza: f54066a | (Paweł Murias)++ | p5test/p5test.pl:
Use the right compiler invocation in the last test in p5test.pl
14:59
fsergot nom: my @a = <a b c>; say @a.elems; 15:04
p6eval nom 6eae67: OUTPUT«3␤»
15:05 birdwindupbird left 15:06 tokuhirom joined
[Coke] nqp: use NQPP6Regex; use NQPP6Regex; say "alive?" 15:08
p6eval nqp: OUTPUT«Confused at line 1, near "say \"alive"␤current instr.: 'nqp;HLL;Grammar;panic' pc 23433 (src/stage2/gen/NQPHLL.pir:6734) (src/stage2/gen/NQPHLL.pm:329)␤»
[Coke] nqp: use NQPP6Regex; use NQPP6Regex; say "alive?";
p6eval nqp: OUTPUT«Confused at line 1, near "say \"alive"␤current instr.: 'nqp;HLL;Grammar;panic' pc 23433 (src/stage2/gen/NQPHLL.pir:6734) (src/stage2/gen/NQPHLL.pm:329)␤»
[Coke] nqp: use NQPP6Regex; use NQPP6Regex; say("alive?");
p6eval nqp: OUTPUT«alive?␤»
pmichaud good morning, #perl6 15:10
masak pmichaud! \o/ 15:11
[Coke] ho, pmichaud++
fsergot nom: sub a( *%a? ) { say 1; }; a(); 15:13
p6eval nom 6eae67: OUTPUT«===SORRY!===␤Malformed block at line 1, near "( *%a? ) {"␤»
fsergot nom: sub a( *"a? ) { say 1; }; a(); 15:14
p6eval nom 6eae67: OUTPUT«===SORRY!===␤Malformed parameter at line 1, near "*\"a? ) { s"␤»
fsergot nom: sub a( *@a? ) { say 1; }; a();
p6eval nom 6eae67: OUTPUT«===SORRY!===␤Malformed block at line 1, near "( *@a? ) {"␤»
fsergot nom: sub a(*@a?){ say 1; }; a();
p6eval nom 6eae67: OUTPUT«===SORRY!===␤Malformed block at line 1, near "(*@a?){ sa"␤»
masak std: sub a( *@a? ) {}
p6eval std 47c76b3: OUTPUT«===SORRY!===␤Unable to parse signature at /tmp/F_u1oaPbOd line 1:␤------> sub a⏏( *@a? ) {}␤Couldn't find final ')'; gave up at /tmp/F_u1oaPbOd line 1:␤------> sub a( *@a⏏? ) {}␤ expecting any of:␤ constraint…
masak fsergot: I don't think it makes much sense to make slurpy arrays optional. 15:15
fsergot masak: You are right, I just wanted to check it. :)
masak curiosity++ 15:16
fsergot nom: sub a(*@a){ say 1; }; a();
p6eval nom 6eae67: OUTPUT«1␤»
fsergot Hmm, works as if ? was there :) 15:17
nom: sub a(*%a){ say 1; }; a(); 15:18
p6eval nom 6eae67: OUTPUT«1␤»
fsergot nom: sub a(*%a){ say defined %a; }; a();
p6eval nom 6eae67: OUTPUT«Bool::True␤»
fsergot Why not false? :)
[Coke] niecza: sub a(*%a){ say defined %a; }; a(); 15:20
masak fsergot: because Array and Hash are created in a defined state.
p6eval niecza v13-358-g301a891: OUTPUT«Bool::True␤»
[Coke] niecza: sub a(*%a?){ say defined %a; }; a();
p6eval niecza v13-358-g301a891: OUTPUT«===SORRY!===␤␤Unable to parse signature at /tmp/gJJ05xJNQN line 1:␤------> sub a(⏏*%a?){ say defined %a; }; a();␤Couldn't find final ')'; gave up at /tmp/gJJ05xJNQN line 1:␤------> sub a(*%a⏏?){ say defi…
jnthn o/ pmichaud
masak fsergot: there's a long rant/RT ticket about it, where I don't like it using many words to say so. 15:21
fsergot: I was looking for it today; didn't find it.
fsergot: nowadays, I think it's a good idea for arrays/hashes to always be defined and ready to be used.
fsergot: mostly because the alternative would be a mess.
fsergot masak: so is there any way to check if there is any items in *%hash? 15:22
jnthn if %hash { ...yes there are... }
fsergot thanks :) 15:23
masak fsergot: oh, here it is: rt.perl.org/rt3/Ticket/Display.html?id=64928
fsergot nom: sub a(*%a){ say %a.Bool; }; a();
p6eval nom 6eae67: OUTPUT«Bool::False␤»
masak fsergot: what jnthn said. or %hash.elems or %hash.keys or +%hash
fsergot Thanks :) 15:24
jnthn Though %hash burns least CPU cycles :)
masak hurries the optimizer along 15:25
15:25 wtw left
pmichaud even ?%hash works 15:27
similarly, ?@array works nicely without having to reify all of the elements of @array :-P
masak even ~%hash works!
:P
pmichaud as opposed to +@array, which does reification 15:28
fsergot :)
masak oh, true.
yeah, I wouldn't write +@array in my own code.
jnthn assumes if @array { } works out just the same as ?@array
masak I prefer my casts to be implicit.
jnthn: yah, cus 'if' boolifies.
jnthn Right. 15:29
pmichaud since ?@array is better than +@array for checking non-emptiness, I recommend ?%hash over +%hash for the same reason.
s/for the same reason/for consistency/
jnthn fwiw, in Rakudo, ?%hash will also be faster than +%hash, though only marginally.
pmichaud a bit more than marginally, if you turn around and use the results in a boolean context 15:31
jnthn True.
pmichaud if ?%hash { ... } is likely to be faster than if ?+%hash { ... }
jnthn Oh, for sure. I was more meaning that ?@array vs +@array is potentially the difference between O(1) and O(n), whereas ?%hash and +%hash are both O(1), just varying in constant factor. 15:32
pmichaud wfm
dalek p/bs: 6e75c9a | jnthn++ | src/PAST/Regex.pir:
Fix what appears to be an inverted condition in the old regex engine's charlist prefix computation.
15:37
p/bs: 95a5b70 | jnthn++ | t/serialization/01-basic.t:
Correct test count.
p/bs: a5990b0 | jnthn++ | src/6model/serialization.c:
Initial twiddle to handle type objects a bit better during serialization.
15:40 Chillance joined
masak nom: my $a = 5; sub foo($b?) { $a += $b }; foo 15:40
p6eval nom 6eae67: OUTPUT«use of uninitialized variable $b of type Any in numeric context␤»
pmichaud what value should I give to --gen-nqp to mean "use whatever nqp/ source is already available" ? 15:41
i.e., to treat the current nqp/ source tree as being adequate without doing a git checkout/fetch/update
masak nom: my $a = 5; sub foo($b?) { $a += $b }; BEGIN { foo }; say $a 15:42
p6eval nom 6eae67: OUTPUT«use of uninitialized variable $b of type Any in numeric context␤5␤»
jnthn pmichaud: Is a --use-nqp maybe clearer?
pmichaud might be easily conflated with --with-nqp
jnthn pmichaud: Oh, you mean it should build it
But not fetch it 15:43
pmichaud correct
jnthn --build-nqp :)
--gen-nqp=local
pmichaud 'local' might work for now. 15:44
jnthn pmichaud: Guess the difficulty is if we end wiht a branch called "local" :)
15:44 Khisanth left
jnthn
.oO( --gen-nqp=this-one-right-here )
15:44
pmichaud well, this will also ultimately end up in the nqp and rakudo configures as well, with similar meaning
15:44 kaare_ joined
jnthn pmichaud: We don't get to specify a directory that contains the nqp to build, which is why I wondered about another option 15:45
pmichaud another option can work also... not sure what to call it
--nqp-source={dir}
jnthn --nqp-source perhaps
pmichaud maybe
jnthn heh :)
pmichaud but I'd like the option to Star's Configure.pl to be pretty minimal 15:46
jnthn nom: say ('great minds', 'all fools').pick :)
p6eval nom 6eae67: OUTPUT«===SORRY!===␤Confused at line 1, near "say ('grea"␤»
jnthn nom: say ('great minds', 'all fools').pick # :)
p6eval nom 6eae67: OUTPUT«great minds␤»
jnthn \o/
pmichaud i.e., I don't want to have someone have to do Configure.pl --nqp-source=nqp --parrot-source=parrot
which is why "--gen-nqp" and "--gen-parrot" kinda works 15:47
15:47 tokuhirom left
jnthn pmichaud: Could star's Configure have those as defaults? Or are they bad ones? 15:47
pmichaud --build-nqp and --build-parrot are now sounding better
15:47 tokuhirom joined
jnthn Yeah, those work. 15:47
pmichaud Configure.pl --build-parrot
jnthn Does that still imply that you get an NQP?
pmichaud yes 15:48
anytime you build a new parrot, you have to get a new NQP based on it
otherwise things don't work :)
jnthn Makes sense. :)
Yes, working is generlaly preferred :)
*generally
pmichaud if we do that, then --gen-parrot and --gen-nqp can always refer to the "retrieve copy via git" option, while --build-parrot={dir} and --build-nqp={dir} can be the "use the source already in {dir}" option. 15:49
and star's Configure.pl can default {dir} when they aren't supplied.
masak TimToady: if 'macro infix:<+>' shadows the core definition of &infix:<+> in a scope, what does '[+]' do? (and other similar meta'd operators) 15:50
15:51 aloha left 15:52 tokuhirom left
masak oh carp. in writing tests to cover my D1 progress so far, I discovered a case that I don't implement correctly! :) 15:54
seems 'macro infix:<+>' works -- with any previously existing operator -- but 'macro infix:<foo>' doesn't work. 15:55
strangely, it works fine with 'sub infix:<foo>'.
ah well. tests++
15:57 aloha joined 15:58 Khisanth joined
jnthn pmichaud: +1 15:59
masak: See routine_def and you'll likely spot something you're missing in macro_def :)
15:59 agentzh left
fsergot nom : my @a = 1,2,3,4,5; say map { $_++ } <== @a; 16:00
nom: my @a = 1,2,3,4,5; say map { $_++ } <== @a;
p6eval nom 6eae67: OUTPUT«1 2 3 4 5␤»
fsergot :(
jnthn nom: my @a = 1,2,3,4,5; say map { ++$_ } <== @a;
p6eval nom 6eae67: OUTPUT«1 2 3 4 5␤»
masak jnthn: I had just concluded that, too :)
jnthn++
might be some more rebase slippage. 16:01
jnthn fsergot: er, I dunno even know quite how that is parsing :)
masak 'cus I copied routine_def way back then.
jnthn nom: my @a = 1,2,3,4,5; say (map { ++$_ } <== @a);
p6eval nom 6eae67: OUTPUT«2 3 4 5 6␤»
masak checks routine_def
jnthn fsergot: Was just precedence. But note
fsergot It works! :)
jnthn nom: my @a = 1,2,3,4,5; @a ==> map { ++$_ } ==> say 16:02
p6eval nom 6eae67: OUTPUT«2 3 4 5 6␤»
fsergot jnthn: is there another way to do this? :)
jnthn fsergot: What exactly are you trying to do? Increment everything in the array?
fsergot Yes :)
jnthn nom: my @a = 1,2,3,4,5; @a>>++; say @a; 16:03
p6eval nom 6eae67: OUTPUT«2 3 4 5 6␤»
jnthn nom: my @a = 1,2,3,4,5; say ++<<@a;
p6eval nom 6eae67: OUTPUT«2 3 4 5 6␤»
fsergot nom: my @a = 1,2,3,4,5; say @a>>++;
p6eval nom 6eae67: OUTPUT«1 2 3 4 5␤»
jnthn fsergot: Right, because ++ is post-increment. 16:04
fsergot Clear. :)
jnthn, i was just trying. :)
jnthn felher: I was just 'splainin'. :) 16:05
er
fsergot: ^^
...tab fail :)
masak don't bring felher into this! :P
masak does a diff of routine_def and macro_def 16:11
pmichaud hmmm... adding --build-parrot and --build-nqp makes a lot more permutations of options. 16:12
How about --gen-parrot={path} and --gen-nqp={path} ? 16:13
masak ah, I see moritz++' exceptions work in the changes... shouldn't matter...
fsergot :)
pmichaud ...where we detect {path} by the presence of a slash 16:14
(and maybe backslash, for those people burdened with windows)
masak ...oh, and something about inlining information... no that shouldn't matter either... 16:15
pmichaud: I always do just --gen-parrot. what does/would the {path} value mean if it didn't contain any slashes? 16:16
pmichaud it means checkout a specific branch of parrot
--gen-parrot=master always get's Parrot's master branch
*gets
jnthn pmichaud: Disambiguating on slashes works I guess 16:17
16:17 mj41 left
pmichaud alternatively I could disambiguate by the existence of {path} 16:17
i.e., if the argument to --gen-nqp is a directory, use that directory, otherwise treat it like a tag for a git checkout
masak jnthn: $*W.install_lexical_symbol now takes a :clone(1) argument. I don't have that in my code. might that make a difference?
jnthn That also works
masak: Make a difference for...what? :) 16:18
pmichaud any preference among the folks here ?
jnthn pmichaud: I don't feel too strongly. It's very unlikely that nqp will have a branch called nqp.
masak jnthn: I can do 'sub infix:<foo>' just fine in my codebase, but 'macro infix:<foo>' fails for some reason. trying to understand why by looking at differences between routine_def and macro_def.
jnthn pmichaud: So going on "does it exist as a directory" is likely fine. 16:19
pmichaud I think that's ultimately cleaner
it's just a configure script, so we can change it if it becomes too problematic
masak +1
jnthn masak: Grammar.pm:1456
masak looks 16:20
oh!
dang, so I'm probably missing that bit in the macro_def rule! 16:21
hadn't even thought to look there yet. jnthn++
by the way, there's plenty of code duplication, but I'm not sure yet whether unifying macro_def and routine_def will lead to cleanitude, or insanitude. 16:22
moritz maybe both :-) 16:24
jnthn clear insanitude? 16:25
masak .oO( clearly insane )
16:25 Trashlord joined 16:27 daxim left
masak jnthn: it's refreshing to see how previously insurmountable problem now translate to "do something clever with $*W"-type solutions :) 16:30
s/problem/problems/
jnthn++ # that did the trick 16:33
jnthn yay
dalek kudo/macros2: ce3d4ac | masak++ | src/Perl6/Grammar.pm:
copy new routine_def rule to macro_def

With judicious changes, of course.
Noticed that we were out of sync because new macro operators couldn't be defined (but new sub operators could).
16:35
felher hihi :0 16:37
* :)
tadzik masak: why did you remove { $*DECLARATOR_DOCS := '' }? 16:38
dalek ast: 4bb04af | masak++ | S06-macros/macros-d1.t:
[S06-macros/macros-d1.t] new test file

Tests the various forms of defining and calling macros. No real variable interaction yet, except between the macro body and the outside.
masak tadzik: 'cus I didn't see it routine_def... 16:39
tadzik huh
masak tadzik: I just copied things over as I saw them.
ok, review welcome on that test file.
it's perhaps worth pointing out that all of those 6 tests pass on the macros2 branch.
tadzik well, if podtest passes that's fine with me :) 16:40
16:40 raiph left
masak tadzik: running podtest. 16:41
jnthn masak: Need that test still be skipped?
dalek ast: 83fb76d | masak++ | S06-macros/macros-d1.t:
[S06-macros/macros-d1.t] oops, removed old 'skip'
jnthn That was quick :P
masak jnthn: :P
masak .oO( bet that masak guy codes when he's asleep, too... )
tadzik: 'make podtest' passes in the macros2 branch. 16:44
tadzik fine then :) 16:47
is there anything like &sub_name.WHY related to macros, is it even possible?
16:48 kaleem joined
moritz ĸi m., m......……………… 16:52
masak shouldn't be any different from a regular sub.
moritz: hi Ronja!
16:53 moritz is now known as ronja
masak :P 16:53
ronja he de!
16:53 ronja is now known as moritz
bbkr rakudo: class A { has $.x = 1; has $.y = $.x; }; class B is A { has $.x = 2; }; B.new.x.say # one should expect "2". however assignment to $.y in parent class broke it somehow. 16:57
p6eval rakudo 6eae67: OUTPUT«Any()␤»
bbkr without assignment it works 16:58
rakudo: class A { has $.x = 1; }; class B is A { has $.x = 2; }; B.new.x.say
p6eval rakudo 6eae67: OUTPUT«2␤»
jnthn bbkr: $.x is *virtual*.
bbkr: And attributes are initialized top-down.
oh but...hm 16:59
timotimo rakudo: sub postfix:<yourmom>(Str $a) { "$a is sooooooooo fat" }; say "Mrs. Foo" yourmom;
p6eval rakudo 6eae67: OUTPUT«===SORRY!===␤Confused at line 1, near "say \"Mrs. "␤»
jnthn gets curious about what is going onthere
timotimo how do i properly do this?
jnthn timotimo: You're not allowed space before a postfix :P
timotimo rakudo: sub postfix:<yourmom>(Str $a) { "$a is sooooooooo fat" }; say "Mrs. Foo"yourmom; 17:00
p6eval rakudo 6eae67: OUTPUT«Mrs. Foo is sooooooooo fat␤»
timotimo that's excellent!
jnthn So was your mom!
timotimo :)
moritz rakudo: sub postfix:<yourmom>(Str $a) { "$a is sooooooooo fat" }; say "Mrs. Foo"\yourmom;
p6eval rakudo 6eae67: OUTPUT«Mrs. Foo is sooooooooo fat␤»
bbkr jnthn: should I report a bug with this one?
moritz that also works
jnthn bbkr: I think I know what's going on. 17:01
moritz for example if you want to call postfix:<i> (imaginary number) on a variable, you have to write $x\i
timotimo ah, i see
TimToady or ($x)i
moritz because $xi would parse the variable with identifier xi
jnthn bbkr: The short answer is that you should be using has $.y = $!x;
TimToady in any case, $x.i is something else
timotimo does the \ serve other purposes other than separate things where no space would be allowed?
TimToady sure, \t is still a tab :) 17:02
moritz nom: say 'foo'.\ uc
p6eval nom 6eae67: OUTPUT«===SORRY!===␤Confused at line 1, near "say 'foo'."␤»
timotimo of course
moritz nom: say 'foo'\ .uc
p6eval nom 6eae67: OUTPUT«FOO␤»
moritz useful if you want line breaks or vertical alignment
TimToady is thinking about allowing an X. infix
jnthn bbkr: The long answer is that your $.x call is virtual so it touches an attribute in the subclass, which we didn't initialize yet. Touching it results in a kind of auto-vivification. Then, when we get to applying the defaults, we see the attribute $!x in the subclass was already touched so don't re-initialize it.
timotimo oh, you can put an arbitrary amount of whitespace there?
neat.
moritz we call that "unspace" 17:03
TimToady \ as a hide newline falls neatly out of it too
jnthn bbkr: I don't actually consider it a bug BUT the fact we let you write $.x there and not at least warn is a bug.
moritz jnthn: I thought reading should never result in autoviv
not even here, I'd say
jnthn moritz: It's not vivification per se. 17:04
moritz: It's that the REPR lazily generates the scalar container.
moritz: Touching $!x forces it to do so. The fact it's done so makes it consider the attribute "touched" and thus it won't get initialized.
TimToady std: class A { submethod BUILD () { $.a }}
p6eval std 47c76b3: OUTPUT«===SORRY!===␤Virtual call $.a may not be used on partially constructed object at /tmp/xfSlMIimAD line 1:␤------> class A { submethod BUILD () { ⏏$.a }}␤Check failed␤FAILED 00:01 110m␤»
TimToady perl6: class A { submethod BUILD () { $.a }} 17:05
p6eval niecza v13-358-g301a891: OUTPUT«===SORRY!===␤␤Virtual call $.a may not be used on partially constructed object at /tmp/Y3yO4g5tep line 1:␤------> class A { submethod BUILD () { ⏏$.a }}␤␤Unhandled exception: Check failed␤␤ at /home/p6eval/niecza/boot…
..pugs b927740, rakudo 6eae67: ( no output )
dalek ar: 6f77dda | pmichaud++ | skel/tools/lib/NQP/Configure.pm:
Copy NQP::Configure library from nqp repo.
ar: e798a04 | pmichaud++ | Makefile:
Some minor Makefile updates.
ar: 7c94ff3 | pmichaud++ | skel/Configure.pl:
Initial re-write of Configure.pl (based on Rakudo's Configure.pl, with new options for --gen-nqp and --gen-parrot.)
pmichaud that's a partial update of star's configure subsystem; I need lunch here and will finish it up when I get back.
TimToady initializers should also prohibit virtual calls, I suspect
jnthn TimToady: Same
PerlJam bbkr: it's part of that assignment isn't assignment things that you get with = on declarations
timotimo is infix:< \> > the right way to redeclare the > operator?
jnthn std: class C { has $.x; has $.y = $!x; } 17:06
p6eval std 47c76b3: OUTPUT«ok 00:01 109m␤»
TimToady infix:«>» should work
or infix:['>']
jnthn TimToady: Before, ^^ was busted in STD, I think.
timotimo cool :)
jnthn std: class C { has $.x; has $.y = $.x; }
PerlJam std: my $\ x;
p6eval std 47c76b3: OUTPUT«===SORRY!===␤Virtual call $.x may not be used on partially constructed object at /tmp/OL8na0lAYT line 1:␤------> class C { has $.x; has $.y = ⏏$.x; }␤Check failed␤FAILED 00:01 109m␤»
std 47c76b3: OUTPUT«===SORRY!===␤Unsupported use of $\ variable; in Perl 6 please use the filehandle's :ors attribute at /tmp/n7eR2OQbik line 1:␤------> my $\⏏ x;␤Parse failed␤FAILED 00:01 108m␤»
PerlJam std: my \\ x;
p6eval std 47c76b3: OUTPUT«===SORRY!===␤Malformed my at /tmp/e0xtnu_lFv line 1:␤------> my ⏏\\ x;␤ expecting any of:␤ scoped declarator␤ statement end␤ statement list␤Parse failed␤FAILED 00:01 107m␤» 17:07
jnthn TimToady: Guess it got fixed in the initializer changes \o/
TimToady: That solves my last blocker to nabbing the partial invocant stuff from STD.
dalek ast: 5805a6f | moritz++ | integration/error-reporting.t:
be less strict in line number matching
bbkr jnthn: thanks for detailed explanation, i'm confused now if I should report lack of warning bug since STD says this construct is OK
TimToady unspace is only really allowed where a space might make a syntactic difference
jnthn bbkr: We should complain about the code you wrote at compile time. 17:08
bbkr: So please do file a ticket on that.
timotimo rakudo: sub infix:['>($a){}']($a, $b) { say "$a and then something weird and $b" }; 99 >($a){} 100;
p6eval rakudo 6eae67: OUTPUT«===SORRY!===␤Variable $a is not predeclared at line 1, near "){} 100;"␤»
timotimo i demand this to work!
:))
TimToady we can't check for unspace everywhere someone might crazily insert one
PerlJam TimToady: I was just fishing for unintended consequences.
jnthn timotimo: Feel free to file a Rakudo bug on that not working. :)
TimToady and the spaceless unspace certainly only works at the postfix position, I think 17:09
PerlJam (easier to empirically test than to look at the code to figure out what's what :)
moritz rakudo: sub infix:«>($a){}>($a, $b) { say "$a and then something weird and $b" }; 99 >($a){} 100;
p6eval rakudo 6eae67: OUTPUT«===SORRY!===␤Variable $a is not predeclared at line 1, near "){}>($a, $"␤»
timotimo didn't you forget to use »?
moritz not enough LTM I guess
jnthn moritz: Er, mis-matched «
moritz erm, yes
not enough moritz brain :-) 17:10
rakudo: sub infix:«>($a){}»($a, $b) { say "$a and then something weird and $b" }; 99 >($a){} 100;
p6eval rakudo 6eae67: OUTPUT«===SORRY!===␤:w list must have a value known at compile time at line 1, near "($a, $b) {"␤»
timotimo whu?
jnthn ...heh, it tried to do interpolation? :)
moritz timotimo: it tries to interpolate the $a
timotimo that's amusing
moritz rakudo: sub infix:«>(\$a){}»($a, $b) { say "$a and then something weird and $b" }; 99 >($a){} 100;
p6eval rakudo 6eae67: OUTPUT«===SORRY!===␤:w list must have a value known at compile time at line 1, near "($a, $b) {"␤»
moritz aye
jnthn And (quite correctly) whines that it doesn't know the value 17:11
moritz well no
jnthn moritz: The {} will be interpolated too :)
moritz it should first complain that $a isn't declared, no? :-)
rakudo: sub infix:«>(\$a)\{}»($a, $b) { say "$a and then something weird and $b" }; 99 >($a){} 100;
p6eval rakudo 6eae67: OUTPUT«===SORRY!===␤Variable $a is not predeclared at line 1, near "){} 100;"␤»
moritz bah, what a weird language... :-)
[Coke] .u | 17:13
phenny U+007C VERTICAL LINE (|)
[Coke] .u '
phenny U+0027 APOSTROPHE (')
timotimo rakudo: sub infix:«>\»']»($a, $b) { say "$a, a fish and $b" }; "rakudo" >»'] "niecza";
p6eval rakudo 6eae67: OUTPUT«===SORRY!===␤Confused at line 1, near "\"rakudo\" >"␤»
TimToady std: sub infix:«>\»']»($a, $b) { say "$a, a fish and $b" }; "rakudo" >»'] "niecza"; 17:14
p6eval std 47c76b3: OUTPUT«===SORRY!===␤Bogus term at /tmp/1vILsRfrru line 1:␤------> { say "$a, a fish and $b" }; "rakudo" >⏏»'] "niecza";␤Parse failed␤FAILED 00:01 115m␤»
TimToady hmm 17:15
std: sub infix:«>O']»($a, $b) { say "$a, a fish and $b" }; "rakudo" >O'] "niecza"; 17:16
p6eval std 47c76b3: OUTPUT«ok 00:01 114m␤»
TimToady something going wonky with the unicode maybe 17:17
timotimo std: sub infix:«>☃']»($a, $b) { say "$a, a snowman and $b" }; "rakudo" >☃'] "niecza"; 17:18
p6eval std 47c76b3: OUTPUT«ok 00:01 114m␤»
TimToady std: sub infix:['>»\']']($a, $b) { say "$a, a fish and $b" }; "rakudo" >»'] "niecza";
p6eval std 47c76b3: OUTPUT«ok 00:01 115m␤»
TimToady perl6: sub infix:['>»\']']($a, $b) { say "$a, a fish and $b" }; "rakudo" >»'] "niecza";
p6eval rakudo 6eae67: OUTPUT«===SORRY!===␤Missing « or » at line 1, near "'] \"niecza"␤»
..niecza v13-358-g301a891: OUTPUT«rakudo, a fish and niecza␤»
..pugs b927740: OUTPUT«decodeUTF8': bad data: '\187'␤decodeUTF8': bad data: '\187'␤*** ␤ Unexpected ":['>\187\\']']($"␤ expecting "::", "handles", "is", bare trait, subroutine parameters, trait or block␤ at /tmp/ClYwbh8PZH line 1, column 10␤»
TimToady niecza++ 17:19
timotimo awesome :)
TimToady so something about parsing the :«» I guess
and apparently a STD bug 17:20
jnthn Rakudo simply doesn't do the infix:['...'] form yet, iirc. 17:21
timotimo it doesn't?
TimToady my guess is that the backslash isn't being removed from \»
jnthn timotimo: oh, maybe it does'''
17:22 Radvendii joined
TimToady std: sub infix:«>\»']»($a, $b) { say "$a, a fish and $b" }; "rakudo" >\»'] "niecza"; 17:22
p6eval std 47c76b3: OUTPUT«ok 00:01 114m␤»
timotimo rakudo: sub infix:['aha']($a, $b) { say "$a, mhm, aha, oh yes, $b!" }; "foo" aha "bar";
p6eval rakudo 6eae67: OUTPUT«===SORRY!===␤CHECK FAILED:␤Undefined routine '&aha' called (line 1)␤»
jnthn nom: sub infix:['abc']($a, $b) { say 'lol' }; 1 abc 2
p6eval nom 6eae67: OUTPUT«===SORRY!===␤Preceding context expects a term, but found infix instead at line 1, near ""␤»
TimToady yes, it's not removing the backslash
Radvendii o/
jnthn nom: sub infix:<abc>($a, $b) { say 'lol' }; 1 abc 2
p6eval nom 6eae67: OUTPUT«lol␤»
TimToady how can the grammar be trying to call a routine 'aha' that is in the infix position?
nom: sub infix:['abc']($a, $b) { say 'lol' }; infix 1 2 17:24
p6eval nom 6eae67: OUTPUT«===SORRY!===␤Preceding context expects a term, but found infix instead at line 1, near ""␤»
TimToady nom: sub infix:['abc']($a, $b) { say 'lol' }; infix 1, 2 17:25
p6eval nom 6eae67: OUTPUT«===SORRY!===␤Preceding context expects a term, but found infix instead at line 1, near ""␤»
TimToady nom: sub infix :['abc'] ($a, $b) { say 'lol' }; infix 1, 2
p6eval nom 6eae67: OUTPUT«===SORRY!===␤Malformed block at line 1, near "($a, $b) {"␤»
jnthn TimToady: Oh heh. I bet it's declaring an infix:<>, which matches the empty string
TimToady: Therefore, it's considered a valid infix everywhere. :)
timotimo oooooooh, that's terrible :))
TimToady I was wondering if it was parsing the :[] as a trait, but apparently not 17:26
jnthn timotimo: So it parses 1 <empty infix> aha <empty infix> 2 :)
er, TimToady
...why i no can tab complete today?
timotimo apologies for nick-colliding
TimToady I could rename myself to TMTOWTDI
jnthn I could look at what I'm about to send too :) 17:27
TimToady you have more of an excuse not to than most of us :)
timotimo obviously, my contribution today will turn perl6 into a better language 17:30
TimToady just don't suggest dropping the semicolons :) 17:31
timotimo can i define a postfix:<;>? ;)
sub postfix:[';']($a) { say "$a and a semicolon"; } <- this is an infinite recursion then? 17:32
TimToady likely
Radvendii try with a space before the ;
TimToady niecza: sub postfix:[';']($a) { say "$a and a semicolon"; } 17:33
p6eval niecza v13-358-g301a891: OUTPUT«Potential difficulties:␤ &postfix:<;> is declared but not used at /tmp/HwYPhBkEZC line 1:␤------> sub postfix:[';']⏏($a) { say "$a and a semicolon"; }␤␤»
TimToady hmm
didn't timeout
Radvendii nom: sub postfix:[';']($a) { say "$a and a semicolon" ; }; "foo";
p6eval nom 6eae67: OUTPUT«(timeout)»
TimToady nom doesn't do []
Juerd Did foo:['bar'] use to be foo:{'bar'} before?
timotimo rakudo: sub postfix:[';']($a) { say "$a and a semicolon" }
this timeouts for me locally - why?
p6eval rakudo 6eae67: OUTPUT«(timeout)» 17:34
Radvendii nom: sub postfix:<;>($a) { say "$a and a semicolon" ; } ; "foo";
p6eval nom 6eae67: OUTPUT«foo and a semicolon␤»
Radvendii bam
you just have to put a space before the ';' that ends a statement
timotimo: wait... you didn't have a ';' to end any statements... 17:35
jnthn timotimo: It's all related to the postfix:['...'] form not working.
timotimo interesting, with <;> it works, with [';'] it doesn't
probably, yes
Radvendii oh
jnthn: what do the specs say it should look like? <op> or ['op']?
jnthn Radvendii: Both should work. 17:36
(iirc)
TimToady niecza: sub postfix:[';']($a) { say "$a and a semicolon"; }; "foo";
p6eval niecza v13-358-g301a891: OUTPUT«Potential difficulties:␤ &postfix:<;> is declared but not used at /tmp/zpXh9c4_2q line 1:␤------> sub postfix:[';']⏏($a) { say "$a and a semicolon"; }; "foo␤␤»
TimToady niecza is probably special casing the terminators liek ; 17:37
*like
niecza: sub postfix:[';']($a) { say "$a and a semicolon"; }; "foo"\;
p6eval niecza v13-358-g301a891: OUTPUT«foo and a semicolon␤»
TimToady hah
Radvendii nice
TimToady niecza: sub postfix:[';']($a) { say "$a and a semicolon"; }; "foo".;
p6eval niecza v13-358-g301a891: OUTPUT«foo and a semicolon␤» 17:38
Radvendii nom: say (a => "foo").WHAT
p6eval nom 6eae67: OUTPUT«Pair()␤»
Radvendii what happened to => just quoting the other side...
oh
i guess this allows you to do named arguments...
TimToady if it didn't quote the a it would complain about starting a term with => 17:39
since a would be a listop
Radvendii nono, i thought it _just_ quoted the a. not making a "pair()" 17:40
TimToady => always makes a Pair
Radvendii nom: .say for (a => "foo")
p6eval nom 6eae67: OUTPUT«"a" => "foo"␤»
Radvendii i expected that to print out "a"\n"foo" 17:41
i realize that that is wrong now
TimToady why? This isn't Perl 5, and => isn't a fat comma
dalek p/bs: cec284e | jnthn++ | t/serialization/01-basic.t:
Add a test for P6opaque serialization when attributes are natives.
p/bs: 29fdcd0 | jnthn++ | src/6model/serialization. (2 files):
Start to stub in reference serialization.
p/bs: 7c1c75a | jnthn++ | src/6model/reprs/P6opaque.c:
Fill out P6opaque's serialize and deserialize.
p/bs: 0839038 | jnthn++ | t/serialization/01-basic.t:
Fix P6opaque with native attrs tests.
timotimo => doesn't make a pair if i override the infix:«=>» operator inappropriately :))
TimToady always lies, except when he doesn't
Radvendii TimToady: right. i was still thinking in perl5, time to go hit my head against a wall again, :P 17:43
timotimo does perl6 offer something like ruby wherein you can "open up" an already defined class and add new stuff? 17:44
bbkr timotimo: yes, MONKEY_TYPING
TimToady if you say "use MONKEY_TYPING;" and then use "augment"
PerlJam Radvendii: It's okay if you let Perl 5 be your default assumption about how Perl 6 works, as long as you are flexible in adjusting that immediately :)
timotimo oh god, how terrible :)
PerlJam timotimo: exactly!
TimToady indeed
an idea straight out of Ada
"with UNCHECKED_TYPE_CONVERSION" 17:45
Radvendii TimToady: i still like MONKEY_TYPING better. :P it's got a perl6 zing to it
TimToady well, the Ada declaration was for unsafe conversions, not monkey typing 17:46
bbkr timotimo: class A {}; use MONKEY_TYPING; augment class A { method foo { say "banana"}}; A.foo
TimToady we used to call it monkey patching like everyone else, but monkey typing is funnier
PerlJam FAQ: I always expect to get the works of Shakespeare when I use MONKEY_TYPING, is there something less confusing?
bbkr timotimo: where A{}is somethong you got from somewhere
TimToady and it is, in fact, changing the type
timotimo when does perl6 get A_THOUSAND_MONKEYS_TYPING?
TimToady now that's an idea 17:47
PerlJam timotimo: whenever it is needed.
Radvendii but in all seriousness, you've gotta use "augment" anyways, why require people to use MONKEY_TYPING?
TimToady to punish them for it
PerlJam Radvendii: To *really* discourage people from doing it. 17:48
TimToady and to put something right up at the front that their boss can see
Radvendii :Þ why?
PerlJam Radvendii: it's destructive enough that they should have to think at least tqice before doing it.
bbkr Radvendii: to distinguish hacks and experiments from production code
PerlJam er, twice
Radvendii i guess... 17:49
but no thinking twice before overloading ';' eh?
:P
TimToady monkeys don't usually think of that
and there's not a major language *cough* like Ruby *cough* that does that 17:50
PerlJam Radvendii: ruby has made monkey patching a way of life, so there's a whole slew of programmers ready to do it. How many programmers do you know who think to overload .... blah TimToady types too fast
Radvendii mhmm... 17:51
PerlJam idly wonders if "*cough*like Ruby*cough*" is an allomorph of tmesis
timotimo prefix:<{> is also a nice sub to define 17:52
Radvendii nom: my $a = "foo"; <a b c>.map: {say $a; say $^a}
p6eval nom 6eae67: ( no output )
Radvendii timotimo: not at all!
PerlJam I guess so
Radvendii nom: my $a = "foo"; eager <a b c>.map: {say $a; say $^a}
p6eval nom 6eae67: OUTPUT«a␤a␤b␤b␤c␤c␤»
Radvendii yeah, i know why that's happening, but it's a little confusing. i guess i should be using longer names than "$a" 17:53
maybe the compiler should test that the $^a is the first reference to $a in a block
TimToady std: my $a = "foo"; eager <a b c>.map: {say $a; say $^a}
p6eval std 47c76b3: OUTPUT«===SORRY!===␤$a has already been used as a non-placeholder in the surrounding block,␤ so you will confuse the reader if you suddenly declare $^a here at /tmp/l1iVtelRJ_ line 1:␤------> "foo"; eager <a b c>.map: {say $a; say ⏏$^a}[0…
TimToady maybe it should :P
Radvendii hahahahaha
touché
TimToady that's one of my favorite messages 17:54
Radvendii i thought niecza was being silly for complaining like that
but apparently it's in the specs 17:55
17:56 face1 joined
face1 nom: my @a = 1..3; my @b = 4..6; (@a Z @b).map: { say $^a,$^b} 17:58
p6eval nom 6eae67: ( no output )
Radvendii nom: my @a = 1..3; my @b = 4..6; eager (@a Z @b).map: { say $^a,$^b} 17:59
p6eval nom 6eae67: OUTPUT«14␤25␤36␤»
Radvendii face1: .map is lazy
face1 thanks!
Radvendii np
np 18:00
agh!
i keep doing that
18:03 face1 left 18:06 cognominal left, cognominal joined
TimToady std: my $a = "foo"; eager <a b c>.map: {say $a; my $a = 42; } 18:07
p6eval std 47c76b3: OUTPUT«===SORRY!===␤Lexical symbol '$a' is already bound to an outer symbol (see line 1);␤ the implicit outer binding at line 1 must be rewritten as OUTER::<$a>␤ before you can unambiguously declare a new '$a' in this scope at /tmp/L162wxLG6f line 1:␤---…
TimToady it's really the same category as that error
std: my $a = "foo"; eager <a b c>.map: {say OUTER:<$a>; say $^a} 18:08
p6eval std 47c76b3: OUTPUT«===SORRY!===␤Undeclared name:␤ 'OUTER:<$a>' used at line 1␤Check failed␤FAILED 00:01 111m␤»
TimToady std: my $a = "foo"; eager <a b c>.map: {say OUTER::<$a>; say $^a}
p6eval std 47c76b3: OUTPUT«ok 00:01 111m␤»
TimToady niecza: my $a = "foo"; eager <a b c>.map: {say OUTER::<$a>; say $^a}
p6eval niecza v13-358-g301a891: OUTPUT«===SORRY!===␤␤$a has already been used as a non-placeholder in the surrounding block,␤ so you will confuse the reader if you suddenly declare $^a here at /tmp/XLl6jl2tXv line 1:␤------> ager <a b c>.map: {say OUTER::<$a>; say …
Radvendii i think it's resonable not to allow it 18:09
TimToady but the OUTER should fix that message
niecza: my $a = "foo"; eager <a b c>.map: {say $^a}
p6eval niecza v13-358-g301a891: OUTPUT«===SORRY!===␤␤$a has already been used as a non-placeholder in the surrounding block,␤ so you will confuse the reader if you suddenly declare $^a here at /tmp/VSS2cDSuY4 line 1:␤------> my $a = "foo"; eager <a b c>.map: {say ⏏…
TimToady hmm, it just doesn't like the shadowing
niecza: my $a = "foo"; eager <a b c>.map: -> $a {say $a} 18:10
p6eval niecza v13-358-g301a891: OUTPUT«===SORRY!===␤␤Undeclared routine:␤ 'eager' used at line 1␤␤Potential difficulties:␤ $a is declared but not used at /tmp/Vo7nTPBA6D line 1:␤------> my ⏏$a = "foo"; eager <a b c>.map: -> $a {sa␤␤Unhandled exception: Che…
TimToady I find it difficult to believe that niecza has made it this far without eager
I guess the fact that list assignment is eager hides the lack 18:11
niecza: sub eager (|lst) { my @ = lst }; eager <a b c>.map: {say $_} 18:16
p6eval niecza v13-358-g301a891: OUTPUT«a␤b␤c␤»
TimToady and eager is so hard to implement :P
niecza: sub eager (|lst) { my @ = lst }; my $foo = eager <a b c>.map: {$_}; say $foo.WHAT 18:17
p6eval niecza v13-358-g301a891: OUTPUT«Array()␤»
TimToady well, I guess that's not quite right
[Coke] TimToady: it's clearly not impacting our ability to run spec tests. ;)
TimToady erm 18:18
Radvendii TimToady: i don't get that syntax, the (|lst) and the bare sigil... 18:19
TimToady niecza: sub eager (|lst) { my \ = lst }; my $foo = eager <a b c>.map: {$_}; say $foo.WHAT
p6eval niecza v13-358-g301a891: OUTPUT«===SORRY!===␤␤Malformed my at /tmp/SZN12NCA0a line 1:␤------> sub eager (|lst) { my⏏ \ = lst }; my $foo = eager <a b c>.map:␤␤Parse failed␤␤»
TimToady niecza: sub eager (|lst) { my (|) = lst }; my $foo = eager <a b c>.map: {$_}; say $foo.WHAT
p6eval niecza v13-358-g301a891: OUTPUT«Parcel()␤»
TimToady that's better
you can always use a bare sigil to declare something anonymous 18:20
Radvendii woah
and | is a sigil?
TimToady not really...for the others, see S06:1140 18:21
it's more like the * in a slurpy parameter
Radvendii oh
TimToady but it can also be used anonymously, which is something we just fixed a couple days ago 18:22
niecza: sub eager (|lst) { my (|) = lst }; eager <a b c>.map: *.say 18:23
p6eval niecza v13-358-g301a891: OUTPUT«a␤b␤c␤»
TimToady niecza: sub eager (|lst) { my (|) = lst }; <a b c>.map: *.say
p6eval niecza v13-358-g301a891: OUTPUT«Potential difficulties:␤ &eager is declared but not used at /tmp/njV6d5ITzf line 1:␤------> sub eager ⏏(|lst) { my (|) = lst }; <a b c>.map: *.␤␤a␤b␤c␤»
TimToady niecza: sub eager (|lst) { my (|) = lst }; gather <a b c>.map: *.say
p6eval niecza v13-358-g301a891: OUTPUT«Potential difficulties:␤ &eager is declared but not used at /tmp/ygskLXTCNP line 1:␤------> sub eager ⏏(|lst) { my (|) = lst }; gather <a b c>.␤␤»
TimToady niecza: sub eager (|lst) { my (|) = lst }; gather eager <a b c>.map: *.say
p6eval niecza v13-358-g301a891: ( no output ) 18:24
TimToady hmm that should have output if eager is being...eager...
I guess assignment to a sig turned it into more of a binding 18:25
niecza: sub eager (|lst) { return |my @ = lst }; gather eager <a b c>.map: *.say
p6eval niecza v13-358-g301a891: ( no output )
TimToady niecza: sub eager (|lst) { my @ = lst }; gather eager <a b c>.map: *.say
p6eval niecza v13-358-g301a891: ( no output )
TimToady that should work 18:26
sorear: ^^
niecza: sub eager (|lst) { my @ = |lst }; gather eager <a b c>.map: *.say 18:27
p6eval niecza v13-358-g301a891: ( no output )
18:27 PacoAir left, c1sung left, zamolxes left, slavik left, cxreg left, Yappoko___ left, sirhc left, tokuhirom3 left 18:28 zamolxes joined, cxreg joined, sirhc joined, sirhc left, sirhc joined, c1sung joined, Yappoko___ joined, tokuhirom3 joined
TimToady niecza: sub eager (|lst) { my @x = |lst; say @x; @x }; gather eager <a b c>.map: *.say 18:28
p6eval niecza v13-358-g301a891: ( no output )
18:28 slavik joined
TimToady niecza: sub eager (|lst) { my @x = lst; say @x; @x }; gather eager <a b c>.map: *.say 18:29
p6eval niecza v13-358-g301a891: ( no output )
TimToady niecza: sub eager (|@lst) { my @x = @lst; say @x; @x }; gather eager <a b c>.map: *.say
p6eval niecza v13-358-g301a891: OUTPUT«Potential difficulties:␤ Unsupported use of | with sigil; nowadays please use | without sigil at /tmp/vQjYPw805H line 1:␤------> sub eager (|@lst⏏) { my @x = @lst; say @x; @x }; gather e␤␤»
TimToady nom: sub eager (|@lst) { my @x = @lst; say @x; @x }; gather eager <a b c>.map: *.say 18:30
p6eval nom 6eae67: ( no output )
TimToady nom: sub eager (|@lst) { my @x = @lst; say @x; @x }; (gather eager <a b c>.map: *.say)[0] 18:31
p6eval nom 6eae67: OUTPUT«Nominal type check failed for parameter '@lst'; expected Positional but got Capture instead␤ in sub eager at /tmp/gd9RHVUKOI:1␤ in code <anon> at /tmp/gd9RHVUKOI:1␤ in sub coro at src/gen/CORE.setting:4621␤ in method reify at src/gen/CORE.setting:4596␤ in method …
TimToady niecza: sub eager (|lst) { my @x = lst; say @x; @x }; (gather eager <a b c>.map: *.say)[0]
p6eval niecza v13-358-g301a891: OUTPUT«a␤b␤c␤\((Bool::True, Bool::True, Bool::True).list)␤»
dalek p/bs: 516fc77 | jnthn++ | t/serialization/01-basic.t:
Sketch out a test for serializing circular references between objects.
p/bs: f29733c | jnthn++ | t/serialization/01-basic.t:
Use the official op for adding things to an SC.
p/bs: ecb463b | jnthn++ | src/6model/serialization (3 files):
Implement serialization of references to other objects, which makes a cross-reference to another SC if needed, or if the object is in no SC adds it to ours and puts it onto the serialization worklist. Test for circular reference serialization now passes.
TimToady okay, that seems to have worked 18:32
niecza: sub eager (|lst) { my (|) = lst; }; (gather eager <a b c>.map: *.say)[0]
p6eval niecza v13-358-g301a891: OUTPUT«a␤b␤c␤»
TimToady \o/ 18:33
niecza: sub eager (|lst) { my (|) = lst; }; (gather say eager <a b c>.map: *.say)[0]
p6eval niecza v13-358-g301a891: OUTPUT«a␤b␤c␤\((Bool::True, Bool::True, Bool::True).list)␤»
TimToady sorear: ^^ I think is a correct(-ish) implementation of eager :) 18:36
niecza: sub sink (|lst) { my (|) = lst; return; }; (gather sink <a b c>.map: *.say)[0] 18:38
p6eval niecza v13-358-g301a891: OUTPUT«===SORRY!===␤␤Action method statement_prefix:sink not yet implemented at /tmp/QsFVYs3KP8 line 1:␤------> turn; }; (gather sink <a b c>.map: *.say⏏)[0]␤␤Unhandled exception: Unable to resolve method statement_level in c…
TimToady heh 18:39
niecza: sub sink (|lst) { my (|) = lst; return; }; (gather sink(<a b c>.map: *.say))[0]
p6eval niecza v13-358-g301a891: OUTPUT«a␤b␤c␤» 18:40
TimToady niecza: sub sink (|lst) { my (|) = lst; return; }; my $x := sink(<a b c>.map: *.say); 18:41
p6eval niecza v13-358-g301a891: OUTPUT«Potential difficulties:␤ $x is declared but not used at /tmp/XDkgjEn62E line 1:␤------> nk (|lst) { my (|) = lst; return; }; my ⏏$x := sink(<a b c>.map: *.say);␤␤a␤b␤c␤»
TimToady \o/
Radvendii what does sink do? 18:42
never mind
colomon TimToady: are there spectests for eager? 18:43
TimToady a few 18:44
[Coke] more unicode: www.unicode.org/versions/Unicode6.1.0/
dalek p/bs: 11ac086 | jnthn++ | t/serialization/01-basic.t:
A test for multi-level tracing of the object graph during serialization; passes.
18:45
Radvendii never mind 18:46
aaaagh
nom: say -1 < [&](0,7) < 1 18:54
p6eval nom 6eae67: OUTPUT«all(Bool::True)␤»
Radvendii ..?
nom: say -1 < all(0,7) < 1 18:55
p6eval nom 6eae67: OUTPUT«all(Bool::True, Bool::False)␤»
Radvendii nom: say -1 < ([&](0,7)) < 1
p6eval nom 6eae67: OUTPUT«all(Bool::True, Bool::False)␤»
Radvendii so what's happening without parens?
TimToady niecza: say -1 < [&](0,7) < 1 18:56
p6eval niecza v13-358-g301a891: OUTPUT«all(Bool::True, Bool::False)␤»
TimToady bug, I'd say
sorear good * #perl6
TimToady o/ 18:57
colomon \o
Radvendii o/
TimToady nom: say all(0,7).perl 18:58
p6eval nom 6eae67: OUTPUT«all(0, 7)␤»
TimToady nom: say [&](0,7).perl
p6eval nom 6eae67: OUTPUT«all((0, 7))␤»
Radvendii i assume the extra ()s doesn't effect anything?
TimToady hmm
it shouldn't, but apparently it does 18:59
all provides a list context, so extra parens should just flatten
nom: say all((0,7)).perl
p6eval nom 6eae67: OUTPUT«all(0, 7)␤»
TimToady and in fact they do flatten in the actual call
Radvendii [&](0,7).perl.perl 19:00
TimToady but the [&] is not flattening something it should
Radvendii nom: say [&](0,7).perl.perl
p6eval nom 6eae67: OUTPUT«all("(0, 7)")␤»
colomon Radvendii++
TimToady nom: say ([&] 0,7).perl
p6eval nom 6eae67: OUTPUT«all(0, 7)␤»
TimToady ooh, it's keeping the extra argument parens, seemingly
Radvendii thank you colomon, what for though?
colomon Radvendii: coming up with an interesting variation to try 19:01
TimToady our newest fuzzer :)
Radvendii TimToady: so we'll just have to go all lisp with ([&] 0,7) :P
TimToady the other should be equivalent, but isn't in nom 19:02
Radvendii colomon: oh, thank you
TimToady jnthn: ^^
sorear TimToady: Chaining operators currently desugar to &&-chains, which does not do so well with junctions ... 19:06
TimToady: why should gather eager ... work? Doesn't gather suppress execution of the RHS? 19:07
TimToady: I don't understand what my (|) = rhs is supposed to do, and I am certain Niecza does not implement it correctly
TimToady that's why I added a [0] on the gather one 19:08
sorear: niecza was correct on the junction, but not nom 19:09
Radvendii nom: my $a=5; $a.undef; say defined $a;
p6eval nom 6eae67: OUTPUT«Method 'undef' not found for invocant of class 'Int'␤ in block <anon> at /tmp/WeBSCElGHE:1␤ in <anon> at /tmp/WeBSCElGHE:1␤» 19:10
Radvendii nom: my $a=5; undef $a; say defined $a;
p6eval nom 6eae67: OUTPUT«===SORRY!===␤Unsupported use of undef as a verb; in Perl 6 please use undefine function or assignment of Nil␤at /tmp/fGsCGpFSr_:1␤»
Radvendii :D i love good error messages
jnthn nom: [&](0,7).perl 19:11
p6eval nom 6eae67: ( no output )
jnthn nom: [&](0,7).perl.say
p6eval nom 6eae67: OUTPUT«(0, 7)␤»
jnthn TimToady: Does the method call not bind tighter than [&]? 19:12
Radvendii oh... that's right...
TimToady [&]() should be a special form just like foo()
Radvendii nom: say Nil 19:13
p6eval nom 6eae67: OUTPUT«Nil␤»
jnthn TimToady: Hm, oddness. Will have to see what STD's doing that Rakudo's grammar ain't. 19:14
sorear niecza: say 0 <= any(-5,15) <= 10; 19:15
p6eval niecza v13-358-g301a891: OUTPUT«any(Bool::True, Bool::False)␤»
TimToady at line 3325 STD is forcing [&] to parse as a term, so () is a postfix to it, rather than [&] being a prefix 19:16
sorear: right, it should not work like that 19:17
jnthn TimToady: Thanks, will take a look after dinner 19:18
bbi20
TimToady chained operator really need to act like a function with multiple args: chain:['<=','<=']($a,$b,$c) or some such 19:19
or chain([&[<=],&[<=]], $a, $b, $c) 19:20
19:20 jevin joined
TimToady so that it threads the N-way comparisons correctly 19:21
awwaiid you gunna make a 3-op and 4-op and 5-op version of that?
oh wit
I misread
TimToady well, it's slightly problematic to thread a *@foo parameter
awwaiid chain is the function that takes a list of ops and a list of thigns to go between them 19:22
forget I kabitzed anything
TimToady but I don't think we currently autothread slurpies, so it is potentially a real problem
might have to gen such a function at need, or treat Any *@terms specially 19:23
sorear I'm sure something can be done
TimToady there's something vaguely macro-y about it, that wants it to pretend there's a variadic list of non-variadic parameters... 19:24
I'm sure something can be hacked too, but it'd be nice if it just fell out from some other generaliztion 19:25
*zat
otoh, it's supposed to short-circuit, so we really need to be passing a list of thunks, which is probably harder to get the typology right on, if we're going to rely on type mismatch to dispatch junctions outside of Any 19:29
0 > any(2,3) > die "phooey" # shouldn't die 19:30
so that part of && semantics can't go away
niecza: say 0 > any(2,3) > die "phooey" 19:31
p6eval niecza v13-358-g301a891: OUTPUT«any(Bool::False, Bool::False)␤»
TimToady another possiblity if it gets too intractable is to prohibit junctions after the 2nd term, and define chain($, $, *@ [&]) or so 19:34
19:35 kaleem left
TimToady chain($, $, Callable *@) is perhaps more readable 19:35
oh, forgot the operator list, but you take my meaning... 19:36
dalek ar: 1339c15 | pmichaud++ | skel/tools/lib/NQP/Configure.pm:
Updates to enable --gen-parrot and --gen-nqp to accept directory path values.
jnthn back 19:38
sorear o/ jnthn, pmichaud 19:39
TimToady the basic problem is that you can't know the lazy callable is going to return a junction until you call it, and then you're already past the junction threader dispatch 19:40
sorear oh, hmm
and that makes it difficult to implement the &/| precedence rule :| 19:41
TimToady maybe junctions have to transitively thunk their parts when they find themselves thunked 19:42
so we know it's a junction argument, but it evaluates the junction itself lazily
or just a specially marked junctive thunk 19:43
basically we need to turn Thunk of Junction into Junction of Thunk for chaining, and perhaps other thunky spots 19:49
gah, I've been trying to backlog all morning, and failing, and soon I will throw a lunch exception... 19:50
pmichaud hopes to not be around for the lunch tossing 19:51
TimToady maybe I could have a tossed salad
pmichaud for me, it's a toss-up
19:52 PacoAir joined
TimToady masak: the trouble with promoting {} to Block is that you don't know it until someone actually calls .() on it 19:53
so we'd have to make Hash respond to .(), and probably succeed only if the Hash is empty 19:54
jnthn TimToady: Ah, and it's line 2042 where it checks the <term> flag, if I follow correctly?
jnthn thinks he sees what's going on :)
sorear pmichaud: I could use a high-level overview of Rakudo LoL and how it integrates with **@list, iteration, etc
TimToady jnthn: yes 19:55
19:55 bluescreen10 left 19:56 mj41 joined 19:57 birdwindupbird joined
sorear hopes TimToady's Lunch exception is resumable 19:58
TimToady maybe {}.() should warn "{} better written as {;}" if we can pass the original line info through to the run-time 20:01
or maybe it should just silently DWTM 20:02
like we try to do with other allomorphic literals 20:03
20:03 GlitchMr left
TimToady the difference here is that {} has to be mutable 20:04
and it's a bit bogus to respond to () after you've put data into it 20:06
but the thing is, there are many places where {} is perfectly fine for an empty block, so we probably also need to treat it as one when binding to Callable 20:07
otherwise we suddenly have the situation that built-ins are different from user-defined control structures
20:08 bluescreen10 joined
TimToady so maybe we just need a HashBlock of some sort that transmutes to a Hash when you put stuff in it 20:08
sorear we already have that situation, the builtins are syntactical statement_prefixes 20:09
TimToady yes, I think about that from time to time too, and wonder if there's a way to fix that so that listops can override builtins 20:10
the grammar is not as unified as it could be on that 20:11
some way of treating grammar rules that look like listops as in the same namespace 20:13
'course, then people would have to start writing OUTER::<if> $x {...} # :-) 20:14
sorear No comma?
TimToady OUTER::<if> referring to the keyword if
assuming sub if was defined and treated if as a listop 20:15
20:15 buubot_backup left
TimToady it's...not something I'm contemplating changing right now :) 20:15
dalek ar: b5588c2 | pmichaud++ | skel/ (2 files):
Update Configure.pl and Makefile.in for new configuration.
20:16 Trashlord left
sorear If if were a listop, wouldn't it need to be OUTER::<if> $x, {...} # ? 20:16
TimToady at the moment, requiring if() is probably good enough, and more than other languages provide
no, the outer one is the special syntax we already have
!
OUTER::<if> would be statement_prefix:if 20:17
the inner if would be the user's shadow if
it's right on the borderline of how far do we want to go to get rid of the concept of keywords
alas, either way we go will break future programs if we decide to go the other way 20:18
dalek ar: 4abcc07 | pmichaud++ | skel/ (2 files):
Move module-install script into tools/build (where the rest of the build things go nowadays).
ar: 25725a6 | pmichaud++ | / (3 files):
Update Makefile to download modules again; remove obsolete build/ scripts.
20:20
20:20 phenny left
ecza: e9ac09d | sorear++ | src/NieczaActions.pm6:
Fix compilation of "is endsym"
20:25
pmichaud jnthn: ping 20:26
ENOPHENNY 20:27
sorear pmichaud: ping. Where is a good place to start studying LoL? 20:28
jnthn pmichaud: pong
sorear nom: use MONKEY_TYPING; augment class Any { method pie() { 5 } }; say Any.pie
pmichaud jnthn: I'll have to take care of kid stuff here for a while; star's Configure.pl is pretty well set as far as the basics go. "make VERSION=2012.01" will create a image in rakudo-star-2012.01/ , "make tarball VERSION=2012.01" will make a tarball from that dir
p6eval nom 6eae67: OUTPUT«5␤»
sorear nom: use MONKEY_TYPING; augment class Any { method pie() { 5 } }; say "moo".pie 20:29
p6eval nom 6eae67: OUTPUT«5␤»
pmichaud sorear: the synopses are the only good place afaik. That and the TimToady master himself. :)
jnthn pmichaud: OK, thanks :)
pmichaud the makefile templates and the like have been moved into tools/ and tools/build/, just like nqp & rakudo
jnthn pmichaud: Excellent.
sorear pmichaud: the synopses don't adequately explain how LoL is implementable
pmichaud the system is good enough to get to building + installing rakudo, I didn't work on module precompile or install yet 20:30
sorear: agreed, they don't.
I have to go pick up kids from school now; next time we catch each other online I can try to explain what little I've figured out :)
sorear I beleive you implemented LoL for Rakudo
OK
nom: use MONKEY_TYPING; augment class Any { method pie() { 5 } }; say "moo".^find_method('pie')
jnthn pmichaud: I'll give it a try and see how it works out.
p6eval nom 6eae67: OUTPUT«pie␤»
pmichaud I implemented _a_ LoL for Rakudo, I'm not sure it's correct (I'm not sure it's incorrect either, for now it's pretty close)
jnthn: msg me if you run into any problems, feel free to be mucking with configure/makefiles/build scripts. 20:31
sorear nom: use MONKEY_TYPING; augment class Any { method pie() { 5 } }; say "moo".^can('pie')
p6eval nom 6eae67: OUTPUT«pie␤»
pmichaud afk # kid pickup
sorear nom: use MONKEY_TYPING; class A { method x() { 5 } }; class B is A { }; class C is B { }; augment class B { method x() { 17 } }; say C.x 20:33
p6eval nom 6eae67: OUTPUT«5␤»
sorear thought so 20:34
jnthn yeah, I know about that one.
sorear any plans to make it work? 20:35
20:35 Chillance left
jnthn sorear: I intend to, but I didn't decide how 6model's "announcements" or whatever system should look like. 20:35
sorear jnthn: you're going to do announcements in 6model? 20:36
[Coke] TimToady: go all tcl on everybody. keyword, schmeeword.
20:36 Chillance joined, buubot_backup joined
sorear jnthn: the conclusion I've come to is that 6model + serialization + announcements are absolutely incompatible 20:37
jnthn sorear: Dunno. Somebody suggested that to me, I didn't figure it out sufficiently yet.
20:37 buubot_backup left
sorear jnthn: and that when I add 6model, either serialization or announcements has to go :| 20:37
which means worse augment support
jnthn sorear: Yeah, how to do augment + serialization sanely without re-implementing object-level git is a tricky one. :) 20:39
TimToady sorear: the basic idea of lol is implicit in the getarg described in S07:212; lol is a function that does getarg on each parcel/item and turns it into something that doesn't flatten (Seq in the old school terminology, though maybe something different now) 20:41
sorear
.oO( use the new Parrot libgit2 bindings )
jnthn ;-)
[Coke] wonders why autounfudge keeps hanging on niecza (not even while running mono.)
jnthn sorear: It's plausbile to imagine some kinda write-barrier that triggers if you modify an object that is in any SC other than the current one, and adds it to the current compilation unit's SC in some way such that there's enough info to do replacement as needed. 20:43
TimToady I guess lol is really just .tree(*.item) 20:44
maybe tree should be renamed .retree
or .treemap 20:45
20:45 ksi joined
TimToady though it's specifically mapping by level, not node type, so maybe some other name is better 20:45
.stratify or some such 20:46
Radvendii i love/hate that awkward moment when one put's in debug 'say' statements, and all of a sudden it works. and then when one takes out all of the debug, it still works... and as far as one knows, one didn't change any of the actual code...
TimToady I usually do that with u in vim, so I know exactly what state it was in before regarding semicolons and such (but I rely heavily on :autowrite when I ^Z) 20:47
.oO(vim as a poor man's version control system)
20:49
[Coke] TimToady: didn't you used to use emacs and mock vim users?
TimToady I haven't used emacs since it was Gosling's emacs, and vim didn't exist yet 20:50
[Coke] conflates vim and vi, sorry. ;)
TimToady gnu emacs was always too much for my arthritic pinkie 20:51
doy TimToady: have you tried the new persistent undo feature yet? (in vim 7.3) 20:52
Radvendii :autowrite? 20:53
does that do what it sounds like it does?
20:55 silug left
Radvendii alright, why would nom not give me the line number for this error: use of uninitialized variable $v of type Any in numeric context 20:56
TimToady it writes the file out every time you suspend, so your workflow can go back and forth between editing and testing very rapidly 20:59
assuming you want to test from the command line 21:00
Radvendii TimToady: sweet
doy persistent undo tracks the state of the undo tree between vim invocations, so you can do that same thing even if you close/reopen vim
TimToady doy: no I haven't
ah, that's nice
Radvendii it doesn't recognize autowrite
doy Radvendii: :set autowrite 21:01
TimToady I just keep it set in my .vimrc
and occasionally get very confused when editing with vim on someone else's login :) 21:02
"That should have fixed it! Why did it fail again!?! Oh, right..."
Radvendii hahah 21:03
21:03 phenny joined
sorear Radvendii: what's the difference between Radvendii and Ravdendii? 21:04
21:04 buubot_backup joined 21:06 jferrero joined, silug joined
Radvendii in one of them the v comes first? 21:06
21:06 bacek left
Radvendii sorear: is this a trick question? 21:06
21:06 bacek joined
sorear one of them is your NICK string, the other is your USER string 21:06
Radvendii oh 21:07
it was probably a typo :P
sorear wonders if the argument to USER has a name
bbkr1 hmm, I have problem with IO::Socket::INET listener not fetching whole request or recv(). has anyone else experienced this on NOM?
TimToady timotimo: the usual idiom for memoization is %memo{$key} //= newvalue(), which has the advantage of not looking the memo up twice, and the disadvantage of still being broken in nom because //= isn't short-circuiting right
Radvendii sorear: what do you mean? 21:08
TimToady nom: my $x = 42; $x //= die "oops" # just checking
p6eval nom 6eae67: OUTPUT«oops␤ in block <anon> at /tmp/g_8k5HjU8n:1␤ in <anon> at /tmp/g_8k5HjU8n:1␤»
TimToady pugs: my $x = 42; $x //= die "oops" # just checking 21:09
p6eval pugs b927740: ( no output )
TimToady niecza: my $x = 42; $x //= die "oops" # just checking
p6eval niecza v13-358-g301a891: ( no output )
TimToady yes, just broken in nom
Radvendii im off for shabbat. see y'all on saturday night/sunday 21:10
TimToady shalom
21:11 bacek left 21:12 Radvendii left
pmurias sorear: hi 21:13
sorear: where should I put a p5 script I want to use to build the p5 interop? 21:14
21:17 buubot_backup left
dalek ast: f1da377 | jnthn++ | S05- (3 files):
Re-fudging for Rakudo.
21:22
kudo/nom: d707ddf | jnthn++ | src/Perl6/ (3 files):
Pull the entire assertion:name handling into Rakudo by overriding the one in P6Regex. Clears up a hack from this morning's patch. Also make it possible for /<x>/ to call a lexical regex x { ... }; it's a compile time decision.
kudo/nom: c8a80fb | jnthn++ | t/spectest.data:
Run three more test files.
kudo/nom: 0bcf489 | jnthn++ | docs/ChangeLog:
Start on this month's ChangeLog.
21:28
ecza: bef38b1 | (Paweł Murias)++ | / (3 files):
Make the perl5 interop work outside the niecza directory and hopefully on Mac OS X too (not tested yet).
21:31
pmurias colomon: ping 21:32
colomon pong
pmurias colomon: see above commit ;)
colomon have some tax stuff I really need to get done in the next 20 minutes. (sigh) 21:33
pmurias ok
it can wait
21:33 estrabd left
pmurias ;) 21:33
the niecza stuff that is
21:37 mtk left
cognominal jnthn, sorear, What are annoncement? 21:40
*announcements 21:41
21:44 buubot_backup joined
jnthn cognominal: Essentially events expressed in terms of objects. 21:56
dalek p/bs: fa9ba4f | jnthn++ | t/serialization/01-basic.t:
Tests for Integer/Float/String serialization (not really 6model stuff, but we need to be able to).
21:58
p/bs: bc443c1 | jnthn++ | src/6model/serialization.c:
Implement serialization of Integer/Float/String; tests pass.
21:58 kaare_ left
sorear pmurias: hi 21:59
colomon pmurias: is there a simple test I can use to see if things are working? (pause in taxes while wife writes cover letter) 22:04
dalek ar: 7c1a236 | jnthn++ | Makefile:
Remove a stray slash.
22:11 birdwindupbird left 22:16 alvis joined
masak TimToady: letting {}.() work and produce nothing sounds like quite a benign exception, actually. as long as it still fails for all other hashes. 22:19
22:21 mj41 left
cognominal jnnthn: like that? book.pharo-project.org/book/Languag...uncements/ 22:22
colomon pmurias: still having issues. must run to kinkos to fax what looks like a short novel to the IRS 22:24
22:26 kfo_ joined 22:28 kfo left 22:36 mj41 joined 22:39 jferrero left
pmurias colomon: perl t/run_spectests_p5 runs the p5 interop tests 22:39
colomon: and p5test tries to pin down what is broken 22:40
22:40 jferrero joined 22:42 mj41 left 22:44 skids joined
jnthn phenny: ask moritz if he could drop a latest book build into the star repo - I don't have the build environment for it on this machine 22:45
phenny jnthn: I'll pass that on when moritz is around.
jnthn phenny: tell moritz also Pie.pm compilation fails in svg-plot, so I removed it from the modules list for this release 22:46
phenny jnthn: I'll pass that on when moritz is around.
masak jnthn: ooc, why does Pie.pm compilation fail? 22:47
jnthn phenny: tell moritz That said, my release plan is tomorrow afternoon so if you have it fixed by then...
phenny jnthn: I'll pass that on when moritz is around.
benabik That's not a good tag line: "Rakudo Star, now with less Pie"
jnthn masak: It tries to use some trait that doesn't exist
masak huh!
jnthn masak: I didn't dig any further
masak ok.
sounds eminently fixable, though.
jnthn I may in a moment. Just one this in a state where all the stuff in it works. Adding more working stuff in is fine from that.
s/one/want/ 22:48
eek, I missed including Grammar::Debugger 22:49
dalek ar: 5b0bc3e | jnthn++ | Makefile:
Various module list tweaks.
22:50
22:57 jferrero left 23:06 pmurias left, jferrero joined
dalek ar: 3e76f85 | jnthn++ | / (2 files):
Add back svg-plot; one file not building doesn't bust the overall build. Also sync the other modules list in Makefile.in.
23:07
ar: a2d802f | jnthn++ | / (2 files):
Case fail.
23:11
23:13 jferrero left 23:16 whiteknight joined
sorear hello, whiteknight 23:17
whiteknight Hello sorear
PerlJam greetings 23:18
23:23 cognominal_ joined 23:25 cognominal left 23:27 jferrero joined
sorear niecza: sub foo(|x) { say x }; foo(:q) 23:30
p6eval niecza v13-363-ge9ac09d: OUTPUT«\(|{"q" => Bool::True})␤»
sorear :q
hugme hugs sorear, good vi(m) user!
[Coke] :wq! 23:34
hugme hugs [Coke], good vi(m) user!
masak спокойной ночи, #perl6 o/ 23:41
sorear o/ masak
dalek ecza: 2537901 | sorear++ | lib/CORE.setting:
Fudge typing on Match.synthetic
ecza: 4c94673 | sorear++ | src/NieczaGrammar.pm6:
Remove last straggling use of nextwith
masak спит
dalek ast: 0c93c21 | coke++ | S02-types/ (2 files):
niecza autounfudge
jnthn спиттинг is a disgusting habbit :P 23:42
bbkr1 do we have any working HTTP standalone server? except HTTP::Easy and HTTP::Server::Simple as both are broken when it comes to multipart request reading 23:48
23:49 bkolera joined
bbkr1 this silence means "no, you are stuck with PSGI" :) 23:49
jnthn bbkr1: I think HTTP::Easy is the most maintained one of those, so you could file a github issue about it there. 23:51
sorear looks like I'm going to have to reinstate the role cache somehow 23:53