»ö« | perl6.org/ | nopaste: paste.lisp.org/new/perl6 | evalbot usage: 'perl6: say 3;' or rakudo:, alpha:, pugs:, std:, or /msg p6eval perl6: ... | irclog: irc.pugscode.org/ | UTF-8 is our friend!
Set by lichtkind on 5 March 2010.
sorear is trying to implement := in the general case 00:00
unfortunately, this means eliminating infix:<:=>
since := on variables has to be a parser special
so I want to understand the sig-binding stuff so I can port it into the parser
00:01 rgrau_ left
sorear but this helps. 00:01
jnthn It doesn't have to be parser specific, I don't think. 00:03
er, parser special 00:04
sorear it actually should be a macro 00:05
;)
what's the correct way to use perl6 --target=parse? 00:06
jnthn There's an incorrect way? :-) 00:07
I usually just perl6 --target=parse and then type in the thing I want the parse tree for into the REPL
sorear It's acting buggy, and IIRC it's a known bug
yeah, that gave me get_pmc_keyed() not implemented in class 'Undef'
jnthn Oh, ouch. :-(
sorear not a known bug ? 00:08
00:08 cdarroch left
jnthn That means that something we're parsing somewhere is too reliant on the actions. 00:08
Probably
Well, --target=parse is a delicate balancing act.
(of keeping enough in grammar.pm)
It's intended to work, but sometimes things go awry. 00:09
sorear I thought --target=parse ran the actions, but dumped $/ instead of $/.ast
jnthn No
It doesn't run the actions
Thus why it's a little "fun" to get right :-)
--target=past runs the actions and dumps the PAST.
I don't know of a way to run the actions but then dump the parse tree.
sorear currently is trying to find out how my ($x, $y) := (1, 2); say $y parses 00:10
jnthn Does --target=parse work generally
?
oh
It *may* be that bindcheck (or whatever it's called - the reducecheck thingy for :=) wants to look at the AST
And doesn't handle the case where there isn't one.
sorear looking at the PIR, I see that a Signature is being constructed and passed to infix:<:=> 00:11
lue o hai!
sorear I want to see the grammar/action code responsible for parsing my ($x, $y) as a Signature constructore
hmm. 00:12
rakudo: my %*COMPILING; say pir::typeof__SP(Perl6::Compiler.compile("2+2", target=>"past"))
p6eval rakudo 3d3893: OUTPUT«PAST;Block␤»
lue how's := going? 00:13
sorear er, no, got that backward
jnthn sorear: It's parsed that way because declarator parses a <signature> there 00:14
The reducecheck for bind is what decides to actually use the produced signature of the LHS rather than to just use the list
(Since it may be instead a list assignment.) 00:15
lue wanders what the japanese for "way of the camel" is.
jnthn rakudado, iirc
lue tries WWWJDIC again, it didn't say that last time :/ 00:17
I get different types of camels... 00:18
sorear How did I not know before today that reducechecks exist? 00:19
diakopter seems to recall sorear mentioning reducecheck previously 00:21
sorear I was going to implement a different but related feature that I happened to choose the same name for 00:22
*very closely related
diakopter heh :)
sorear closely related enough that neither I nor TimToady became confused as a result 00:23
diakopter hah.
TimToady handles ambiguity well.
00:24 yinyin joined
lue Yes it does. 00:25
sorear wanders off to read the source of EXPR 00:30
Tene I read that as "reducechucks" at first.
sorear I look forward to the day we kill PIR. 00:31
diakopter no comment 00:32
lue me too :)
more specificially, all of rakudo's .pir files. 00:33
(PMC death is a good first step maybe, if you want to kill PIR)
sorear PMCs and classes are going to be unified eventually 00:34
so e.g. Int will just become a built-in class with methods written in C
lue
.oO(it'd be nice to kill C dependency as well [more])
00:35
sorear I wonder if Perl6 rules are strictly more powerful than LALR(1)
lue
.oO(then rakudo would be an autonomous anarcho-syndicalist commun— compiler)
sorear I suspect not, but finding the corner case that proves this could be hard
diakopter [Coke]: thanks for adding my blog 00:39
TimToady strictly speaking, Perl 6 grammars can *include* any bottom-up parser including LALR(n) if they choose, just as STD incorporates an operator precedence parser. :) 00:40
sorear *include*? 00:41
[Coke] diakopter: np.
00:42 lest_away is now known as lestrrat
TimToady a grammar is just a set of methods 00:42
well, maybe not "just" :)
sorear So I can write a subclass of Grammar with an extra parsing engine. I see.
TimToady: Can I get your input on the aggregate binding thing?
TimToady not if it involves PIR :) 00:43
sorear No, no
This is a semantic issue, the kind you could spectest
What part of the aggregate API is used for bindings?
$my-object[1] := $foo; # What method or multisub do I need to implement for this? 00:44
lue TimToady: what's japanese for "way of the camel"? It's bugging me. 00:45
TimToady you need to put $my-object[1] into a context that its array knows it should return a bvalue (using ruoso++'s terms)
jnthn (bvalue) Ah, yes, that's the word I was trying to recall when I was thinking that infix:<:=> as a normal multi going away felt wrong. 00:46
sorear TimToady: How do I spell the bvalue form of postcircumfix:<[ ]> ?
TimToady where 'bvalue' indicates one *less* level of indirection than lvalue, basically
sorear one *less* level of indirection than a lvalue is an rvalue, no? 00:47
TimToady no, that's one more level
er, wait
too many negatives
yes
spinclad lue: you've heard that already, rakuda-do
TimToady I think he wants 駱駝道 00:48
sorear so, bvalues are being added to Perl6. How do I spell the bvalue equivalent to "is rw" in signatures and subs? 00:49
lue alright. Just have no idea where the dash goes. I remember a while ago you saying something about that.
TimToady it's not clear to me that there is a Perl 6 notation for that, other than := 00:50
spinclad raku/da/do
spinclad guesses
TimToady but if there were, it would be something the current :exists modifier on subscripts 00:51
sorear TimToady: If there's no Perl 6 notation for returning bvalues, how am I to implement an array-like class with bindable elements?
TimToady or :delete, either of which are about the higher level of indirection
sorear so perhaps postcircumfix:<[ ]>($my-object, 1, :bind($foo)) ? 00:52
TimToady by having methods that return pointers instead of pointees
spinclad how do those adverbs attach to the right level of indirection? 00:53
TimToady we haven't defined a user-visible pointer type
spinclad: that's getting dangerously close to the circularity saw 00:54
the location of which is something Perl 6 does not mandate
sorear So... what would the method which makes $foo[1] := $bar work, look like?
Or is it not possible to implement in user code?
TimToady Perl 6 DOESN'T CARE
officially
jnthn sorear: It's guts. At least, for now. 00:55
TimToady until you make me change my mind :)
jnthn If multiple implementations all end up doing something that can easy enough be unified, otoh...
sorear Oh, I was going on the "It should be possible to implement user classes which behave like any standard type" premise
jnthn ...then there's probably a case for spec.
sorear but I can see this being a post-6.0 thing 00:56
TimToady sure, but that's for the implementors to negotiate, not me
sorear goes off and implements the easiest solution
TimToady goes off to stir-fry on behalf of someone too short to do so comfortably... 00:58
lue that's not fair... 駱駝道 doesn't show up in any kanji dictionary except WWWJDIC, and they don't provide stroke order! :(
spinclad one aspect of the circularity saw is using it to remove its own guards (so you can do the fine/hard work) without slicing off your own fingers 00:59
01:00 wknight8111 left
spinclad wanders off dinner-ward 01:01
01:01 quester_ left
lue Why doesn't the recursive saw exist? :) 01:02
spinclad the circularity saw is _definitively_ recursive!
Tene lue: because it can only cut itself, and already did.
spinclad likes Tene's answer 01:03
01:04 stephenlb left 01:05 plobsing joined
lue Implement := to bind functions to implement := to bind functions... (wonder how accurate that is...) 01:05
diakopter but what if the circularity saw is a bandsaw that thinks it's a jigsaw aspiring to be a circular saw? 01:14
lue
.oO(Banjo-Tooie...)
01:15
Circle is bandsaw thinks is jigsaw wants circular.
diakopter "I want to rotate, but I think I'm reciprocating [but I'm actually revolving)"
lue diakopter: if that's the case, then it has fulfilled its dream. 01:16
diakopter (]
lue [b,g)
y = (x+3)/5 if x+b = g-2 01:17
lue gets the urge to implement this in P6 --> netninja.com/files/robotfindskitten/ 01:21
afk 01:24
jnthn digs into sorting through his 1200+ Iceland photos 01:27
01:29 lisppaste3 joined
colomon pictures! 01:31
:)
01:42 jonrafkind joined
diakopter plobsing: I replied while you were gone; say something so phenny tells you the message 01:54
01:57 jonrafkind left 01:58 jonrafkind joined 02:12 patspam left
plobsing something 02:16
phenny plobsing: 10 May 14:36Z <diakopter> tell plobsing actually yes, I did consider tail-recursive invocation of the frames, since supposedly that's enforced much more consistently on .NET4 and recent Mono, but I haven't gotten there yet. It would actually be a very simple change.
plobsing cool
02:44 elmex left, elmex joined
sorear rakudo: proto sub foo($) { say "TOP" }; multi sub foo(Mu $) { say "Mu" }; multi sub foo(Any $) { say "Any" }; foo(pir::new__PS('StringBuilder')); 02:45
p6eval rakudo 3d3893: OUTPUT«Mu␤»
sorear rakudo: proto sub foo($) { say "TOP" }; multi sub foo(Mu $) { say "Mu" }; multi sub foo(Any $) { say "Any" }; foo(pir::new__PS('ResizablePMCArray'));
p6eval rakudo 3d3893: OUTPUT«Mu␤»
02:52 fda314925 left 02:53 fda314925 joined 02:58 agentzh joined 03:00 plobsing left 03:01 plobsing joined, mj41_ joined, athomason left 03:03 literal left, oskie left, aindilis left 03:04 oskie joined, aindilis joined, mj41 left, mj41_ is now known as mj41 03:05 gabiruh left 03:06 gabiruh joined, japhb left, TimToady left 03:07 bbkr left, bbkr joined, TimToady joined 03:10 athomason joined 03:14 szabgab left
diakopter wheh 03:14
sorear whey!
03:15 szabgab joined, s1n joined 03:18 bbkr left, bbkr joined 03:20 literal joined 03:25 gfx joined 03:26 szabgab left, szabgab joined 03:29 snarkyboojum joined
diakopter I got blogsome again diakopter.blogspot.com/2010/05/what...whats.html 03:32
sorear diakopter: you forgot to label it "perl6", so it's not showing on planet 03:34
diakopter ooops
thanks
fixed :D 03:35
lue how do you label it perl6? My blog's not on planet, but still.
03:35 snarkyboojum left
diakopter on blogspot there's a field below the rich text editor area 03:35
lue what if you don't use blogspot? 03:36
is it just a tag?
diakopter yes; a tag 03:37
lue is having a hard time finding stroke order for these characters: 駱駝道 and it's annoying 03:38
lue , if it gets critical, may have to use (*_gulp_*) a book
04:06 JimmyZ joined 04:07 Guest7343 left 04:13 meppl joined 04:14 aindilis left 04:19 snarkyboojum joined
lue *cough* gitorious is a lot shinier than github. It's also worth noting KDE went (or will go) github->gitorious 04:32
snarkyboojum diakopter++ # another exciting blog post! :) 04:34
04:34 lestrrat is now known as lest_away
snarkyboojum lue: gitorious is shinier? how so? I find it clunkier.. 04:35
.
lue the front page was shiny. 04:36
snarkyboojum haha
lue I meant it literally.
snarkyboojum oops - wrong window
:)
lue And when I signed up for github a while ago, I was a little put off by the payment plans to get more features. (Orange-)Red flags go off in my head. 04:37
rakudo: say abs(-3) 04:39
p6eval rakudo 3d3893: OUTPUT«3␤»
lue rakudo: multi sub circumfix:<| |>($a){abs($a);}; say |-5|; my $b = 32; say |$b|; 04:40
p6eval rakudo 3d3893: OUTPUT«error:imcc:syntax error, unexpected '\n'␤ in file 'EVAL_1' line 46202121␤Confused at line 11, near "say |-5|; "␤current instr.: 'perl6;HLL;Grammar;panic' pc 501 (ext/nqp-rx/src/stage0/HLL-s0.pir:327)␤»
lue ō.o
JimmyZ o 04:41
phenny JimmyZ: 10 May 16:47Z <TimToady> tell JimmyZ your eval at irclog.perlgeek.de/perl6/2010-05-09#i_2311370 doesn't work because {...} interpolates into double quotes before the eval ever runs
JimmyZ wonders whether it's a bug or not. and how he could make it working. 04:42
snarkyboojum complaining about "Could not find sub 28_1273553089.93674" definitely looks bug-ish, if only error message bug-ish 04:45
:)
lue the magic of generated PIR code. 04:46
snarkyboojum and "Null PMC access in get_string()" definitely looks bug-ish
:)
rakudo: eval "use MONKEY_TYPING; class Foo{ }; augment class Foo { my method Str() { 'hi'; } } ; say ~Foo"
p6eval rakudo 3d3893: OUTPUT«Null PMC access in get_string()␤current instr.: '_block14' pc 29 (EVAL_1:0)␤»
lue I've always wondered; what kind of access is null? 04:47
must be very cold-hearted :)
04:48 am0c joined
lue feels that his prolonged exposure to Perl 6 has forever infected him to compusively include t/ folders. He seems them everywhere 04:49
TimToady rakudo: eval 'use MONKEY_TYPING; class Foo{ }; augment class Foo { my method Str() { "hi"; } } ; say ~Foo' 04:50
p6eval rakudo 3d3893: OUTPUT«Foo()␤»
TimToady note the difference if you swap the single and double quotes
JimmyZ: ^^
JimmyZ rakudo: my $a = time; (1,1, * + *, ... *).batch(28).perl.say; say time-$a;
p6eval rakudo 3d3893: OUTPUT«No exception handler and no message␤current instr.: '&fail' pc 18062 (src/builtins/Junction.pir:481)␤»
JimmyZ rakudo: my $a = time; (1,1, * + * ... *).batch(28).perl.say; say time-$a; 04:51
p6eval rakudo 3d3893: OUTPUT«(1, 1, 2, 3, 5, 8, 13, 21, 34, 55, 89, 144, 233, 377, 610, 987, 1597, 2584, 4181, 6765, 10946, 17711, 28657, 46368, 75025, 121393, 196418, 317811)␤0.248106002807617␤»
TimToady it is not a bug for curlies to interpolate into double quotes, but it is a bug for you to expect them not to. :) 04:52
JimmyZ rakudo: eval 'use MONKEY_TYPING; class Foo{ }; augment class Foo { method Str() { "hi"; } } ; say ~Foo'
p6eval rakudo 3d3893: OUTPUT«Foo()␤»
lue
.oO(PEBKAC!)
JimmyZ I think it's a bug. 04:54
rakudo: $a = Foo; eval 'use MONKEY_TYPING; class $a{ }; augment class Foo { method Str() { "hi"; } } ; say ~Foo'
p6eval rakudo 3d3893: OUTPUT«Symbol '$a' not predeclared in <anonymous>␤current instr.: 'perl6;PCT;HLLCompiler;panic' pc 152 (compilers/pct/src/PCT/HLLCompiler.pir:108)␤»
JimmyZ rakudo: $a = Foo; eval "use MONKEY_TYPING; class $a{ }; augment class Foo { method Str() { "hi"; } } ; say ~Foo"
p6eval rakudo 3d3893: OUTPUT«Useless declaration of has-scoped Method in a module; add our or my to install it in the lexpad or namespace␤Useless declaration of has-scoped Method in a module; add our or my to install it in the lexpad or namespace␤Symbol '$a' not predeclared in <anonymous>␤current instr.:
..'perl…
JimmyZ rakudo: my $a = Foo; my $b = "use MONKEY_TYPING; class $a{ }; augment class Foo { method Str() { "hi"; } } ; say ~Foo"; eval $b 04:55
p6eval rakudo 3d3893: OUTPUT«Useless declaration of has-scoped Method in a module; add our or my to install it in the lexpad or namespace␤Useless declaration of has-scoped Method in a module; add our or my to install it in the lexpad or namespace␤Could not find sub &Foo␤current instr.: '_block14' pc 29
..(EVAL_1…
TimToady you can't use double quotes like that
JimmyZ rakudo: my $a = Foo; my $b = "use MONKEY_TYPING; class $a{ }; augment class Foo { method Str() { 'hi'; } } ; say ~Foo"; eval $b
p6eval rakudo 3d3893: OUTPUT«Useless declaration of has-scoped Method in a module; add our or my to install it in the lexpad or namespace␤Useless declaration of has-scoped Method in a module; add our or my to install it in the lexpad or namespace␤Could not find sub &Foo␤current instr.: '_block14' pc 29
..(EVAL_1…
TimToady you can't use double quotes like that
JimmyZ rakudo: my $a = Foo; my $b = 'use MONKEY_TYPING; class $a{ }; augment class Foo { method Str() { "hi" } } ; say ~Foo'; eval $b 04:56
p6eval rakudo 3d3893: OUTPUT«Could not find sub &Foo␤current instr.: '_block14' pc 29 (EVAL_1:0)␤»
JimmyZ rakudo: my $a = 'Foo'; my $b = 'use MONKEY_TYPING; class $a{ }; augment class Foo { method Str() { "hi" } } ; say ~Foo'; eval $b
p6eval rakudo 3d3893: ( no output )
lue something seems suspicious about putting that long line of code in double quotes, I don't what....
JimmyZ TimToady: why does {...} interpolate into double quotes? 04:57
TimToady curlies interpolate in double quotes
because that's what curlies do in Perl 6
lue afk (compiling)
JimmyZ rakudo: eval 'use MONKEY_TYPING; class Foo" "; augment class Foo { method Str() { "hi"; } } ; say ~Foo' 04:58
p6eval rakudo 3d3893: ( no output )
04:58 sorear left, sorear joined
JimmyZ hmm, the error message is not as expecting 05:03
TimToady rakudo: eval 'use MONKEY_TYPING; class Foo" "; augment class Foo { method Str() { "hi"; } } ; say ~Foo'; say $! 05:05
p6eval rakudo 3d3893: OUTPUT«Malformed package declaration at line 1, near "\" \"; augme"␤»
snarkyboojum rakudo: sub foo() { say "hi" }; say "foo()";
p6eval rakudo 3d3893: OUTPUT«foo()␤»
snarkyboojum rakudo: sub foo() { say "hi" }; "{foo()}";
p6eval rakudo 3d3893: OUTPUT«hi␤»
05:06 broquaint left
TimToady rakudo: "blah blah blah blah blah { method Str() { 'hi'; } } blah blah blah blah" 05:06
p6eval rakudo 3d3893: OUTPUT«Useless declaration of has-scoped Method in a module; add our or my to install it in the lexpad or namespace␤Useless declaration of has-scoped Method in a module; add our or my to install it in the lexpad or namespace␤»
TimToady that message?
or the one I printed out with 'say $!'? 05:07
05:07 broquaint joined
sorear Why is the error generated twise? 05:10
snarkyboojum rakudo: my $t = Q<use MONKEY_TYPING; class Foo { }; augment class Foo { method Str() { "Foobar!" } }; say ~Foo.new>; eval $t
p6eval rakudo 3d3893: OUTPUT«Foobar!␤»
05:14 snarkyboojum left, broquaint left 05:19 iblechbot joined, TiMBuS joined
diakopter <open discussion/thoughts about a p6 runtime> 05:24
my initial idea to making the p6 runtime on the CLR is to start out by doing absolutely no compilation/optimization, and reifying literally everything the specs, er, reify. 05:26
without exception
that is, not limiting what's visible to the user to the things spec'd 05:27
but making the entire runtime transparent
so everything runs at the same level
no encapsulation, no stratification 05:28
and once it's "working" from there (as a definitional interpreter of sorts), begin to look for optimization opportunities.
05:29 araujo left
diakopter this strategy is, per my understanding, similar to the one taken by google's chrome. 05:29
STD will JIT the code to perlesque, which perlesque will JIT to CIL, which the CLR will JIT to machine code, all "inline". 05:30
each compilation unit. 05:31
er
scratch that first step; it's not really necessary; STD will JIT the p6 code to CIL via runsharp (not via perlesque via runsharp), sorry, I forgot. 05:32
my rationale for making everything run at the same level is that there are no barriers, nothing to prevent global visibility, and things can be JFDId much more straightforward,ly 05:33
05:33 jonrafkind left
diakopter then the barriers can be erected and optimizations/compilations put in place 05:34
e.g. there will be a CLR class for every VAST class in viv. 05:35
and the ones viv generates based on STD. 05:36
diakopter drowned out by a symphony of crickets; it must be cricket mating season and the perfect temperature.
er, cacophony, not symphony
</open discussion/thoughts about a p6 runtime, from me at least> 05:45
05:45 bakedb__ joined 05:46 Su-Shee joined 06:01 snarkyboojum joined 06:05 quester_ joined
sorear diakopter: I'm not going to work on any other Perl6 implementation until R* is out 06:05
JimmyZ TimToady: Useless declaration of has-scoped Method in a module 06:11
06:14 japhb joined 06:16 uniejo joined, viklund joined
snarkyboojum bought the dragon book yesterday :) 06:23
sorear plays with git rebase -i for the first time 06:25
snarkyboojum FWIW, it got a laugh out of me in the Preface, so that's a good sign.. I think 06:32
06:36 Tene left 06:44 PZt left 06:45 [mark] joined 06:46 iblechbot left 06:49 pnu left 06:50 jhuni joined 06:59 JimmyZ left
sorear rakudo: my ($x, $y) := (1, 2) 06:59
p6eval rakudo 3d3893: ( no output )
sorear hmm. I think I broke i
06:59 simcop2387 left
sorear ah, turning off $*AUTOPRINT unbreaks it 07:00
07:02 JimmyZ joined 07:05 molaf joined
dalek kudo: 53fda34 | sorear++ | (3 files):
Enable support for --stagestats in Rakudo

Makefile system to pass --stagestats to Rakudo when compiling the setting and Test.pm in --makefile-timing builds. Signed-off-by: Moritz Lenz [email@hidden.address]
07:10
sorear that was fast 07:11
moritz_ I try to give patch authors feedback very fast 07:14
but I can only do that for fairly trivial patches :(
JimmyZ has a fairly trivial patche in RT 07:15
07:15 simcop2387 joined
sorear finds that many patch queues have an average wait time greater than the code churn half-life, making them useless 07:15
sorear is very pleased now
dalek kudo: efbcce6 | plobsing++ | src/pmc/p6opaque.pmc:
De-dup item_str in p6opaque.pmc

Closes RT #74996 Signed-off-by: Moritz Lenz [email@hidden.address]
07:16
07:16 \\shade\\ joined
sorear What's the big secret on rt.perl.org? While trying to find my ticket, I got a lot of "No permission to view ticket" stuff 07:16
moritz_ the spam queue hides tickets from everybody
07:17 broquaint joined
sorear aha. 07:17
07:19 quester_ left
moritz_ JimmyZ: your patch in RT #74434 adds a BOM to src/builtins/Str.pir that makes the build fail 07:21
JimmyZ it's not my patch
07:22 aesop joined
moritz_ you're not 'jimmy' in RT? 07:22
sorry then
JimmyZ it's rurban
yes, I'm jimmy
moritz_ confuses stuff
sorry, I gave the wrong ticket number 07:23
JimmyZ the RT #74434 is not mime.
moritz_ RT #74942
JimmyZ moritz_: github.com/rakudo/rakudo/commit/30e...665d7b8024 07:24
moritz_ is this the same as your patch?
JimmyZ yep 07:25
eternaleye (backlogging) moritz_: that new programming jargon link is wonderful. I particularly like Pokémon Exception Handling (When you've gotta catch 'em all!)
JimmyZ moritz_: it's in branch 07:26
moritz_ it doesn't seem to be merged 07:27
otherwise I would have gotten a conflict
JimmyZ moritz_: it was ignored.
07:28 justatheory left, Bzek joined
JimmyZ 30ef6fac01afdc51e5ff269ad13442665d7b8024 is the only worth one for merge 07:28
07:30 drbean left
moritz_ uh, what branch is this? 07:31
JimmyZ immutable_strings
moritz_ thought that was merged
JimmyZ nope 07:32
moritz_ otherwise we couldn't have built
eternaleye (still backlogging) moritz_: (masak and lichtkind aren't here) re augment and supersede, I can see at least supersede being useful on multi methods, not just roles, classes, and grammars. It would allow you to replace a multi rather than creating an ambiguous dispatch.
JimmyZ actually, jnthn didn't know there is a new replace op.
sorear moritz_: I'm deliberately not ticketing my macro attempts, as they're very prototypey and I expect to completely redo them at some point after I have full operator overloading working 07:43
07:50 gfx left
moritz_ eternaleye: since multi method dispatch works by looking in most derived classes first, you'll never get an ambiguous dispatch between multis of a parent and a child class 07:58
sorear: but please ticket your lexical-persistence-in-REPL patch(es)
sorear moritz_: I already have 08:00
I think 08:01
moritz_ 17 minutes ago :-)
no wonder I didn't see it earlier
eternaleye moritz_: Whoops, I meant multi sub. Sorry. 08:06
moritz_ std: superseed sub foo () { }
p6eval std 30614: OUTPUT«===SORRY!===␤Undeclared routine:␤ 'superseed' used at line 1␤Check failed␤FAILED 00:01 113m␤»
moritz_ std: superseede sub foo () { }
p6eval std 30614: OUTPUT«===SORRY!===␤Undeclared routine:␤ 'superseede' used at line 1␤Check failed␤FAILED 00:01 111m␤»
moritz_ std: supersede sub foo () { }
p6eval std 30614: OUTPUT«===SORRY!===␤Can't supersede symbol &foo without MONKEY_TYPING at /tmp/Y6xx23pZHi line 1:␤------> supersede sub foo⏏ () { }␤Potential difficulties:␤ Can't supersede symbol &foo because it doesn't exist at /tmp/Y6xx23pZHi line 1:␤------>
..su…
moritz_ can't type
std: use MONKEY_TYPING; supersede sub foo () { } 08:07
p6eval std 30614: OUTPUT«ok 00:01 110m ./lib/MONKEY_TYPING.pm6␤Potential difficulties:␤ Can't supersede symbol &foo because it doesn't exist at /tmp/lnOGAgimum line 1:␤------> use MONKEY_TYPING; supersede sub foo⏏ () { }␤ok 00:01 111m␤»
moritz_ std: sub foo() { use MONKEY_TYPING; supersede sub foo () { }
p6eval std 30614: OUTPUT«===SORRY!===␤Unable to parse block at /tmp/Tsw9JYajdo line 1:␤------> sub foo() {⏏ use MONKEY_TYPING; supersede sub foo ()␤Couldn't find final '}'; gave up at /tmp/Tsw9JYajdo line 1 (EOF):␤------> MONKEY_TYPING; supersede sub foo () {
..}[3…
moritz_ std: sub foo() ; use MONKEY_TYPING; supersede sub foo () { }
p6eval std 30614: OUTPUT«===SORRY!===␤Missing block at /tmp/005pednk1I line 1:␤------> sub foo() ⏏; use MONKEY_TYPING; supersede sub foo (␤ expecting any of:␤ block␤ routine_def␤ trait␤Parse failed␤FAILED 00:01 111m␤»
moritz_ std: sub foo() {}; use MONKEY_TYPING; supersede sub foo () { }
p6eval std 30614: OUTPUT«ok 00:01 111m␤»
eternaleye std: multi sub foo( Int $i ) { say $i; }; use MONKEY_TYPING; supersede sub foo( Int $i ) { say -$i; }; foo( 3 );
p6eval std 30614: OUTPUT«ok 00:01 113m␤»
eternaleye rakudo: multi sub foo( Int $i ) { say $i; }; use MONKEY_TYPING; supersede sub foo( Int $i ) { say -$i; }; foo( 3 ); 08:08
p6eval rakudo 3d3893: OUTPUT«"supersede" not yet implemented at line 11, near " sub foo( "␤current instr.: 'perl6;HLL;Grammar;panic' pc 501 (ext/nqp-rx/src/stage0/HLL-s0.pir:327)␤»
eternaleye :(
moritz_ sorear: the lexical persistence patch is suprisingly non-intrusive :-) 08:10
dalek kudo: d47ce57 | jimmy++ | src/builtins/Str.pir:
use replace instead of substr
08:20
kudo: 75b3762 | rurban++ | build/Makefile.in:
Install man page
08:21 JimmyZ_ joined, JimmyZ left, JimmyZ_ is now known as JimmyZ
snarkyboojum git pulls 08:23
08:27 IllvilJa joined
IllvilJa o/ 08:27
snarkyboojum \o 08:28
oooh - shiny new man pages :) 08:32
it'd be be nice to specify the --target stages in the man page perhaps? seeing how they're not really documented anywhere that I know of 08:33
moritz_ snarkyboojum: sure 08:34
snarkyboojum: a patch that lists the stages you know of would already be a great start
snarkyboojum moritz_: sure thing 08:35
08:37 dakkar joined
snarkyboojum moritz_: I'm not sure I'm qualified to explain each --target option though :) 08:41
moritz_ snarkyboojum: listing them is already a good start 08:43
parse = a representation of the parse tree
PAST = an intermediate, internal format
POST = another intermediate, internal format, a bit more low level than PAST
PIR = parrot-level assembler
PBC = byte code
(not sure if all of them are supported) 08:44
snarkyboojum these are the targets I know about
parse past post pir evalpmc
Su-Shee POPCORN = perl object packer calculating object's Rat number. ;) 08:45
moritz_ doesn't know anything about evalpmc
:-)
snarkyboojum I've never used it, just cleaned it from HLLCompiler.pir a while back
perhaps not worth documenting
s/cleaned/gleaned/
moritz_: gist.github.com/397080 08:50
08:51 JimmyZ_ joined, pnu joined 08:53 JimmyZ left, JimmyZ_ is now known as JimmyZ
moritz_ snarkyboojum: thanks, will apply soon 08:56
(doing other things right now)
snarkyboojum moritz_: o/
08:58 iblechbot joined 08:59 agentzh left
moritz_ nopaste.snit.ch/20525 next "This week's contribution to Perl 6" challenge 08:59
feedback welcome
08:59 agentzh joined
snarkyboojum moritz_: raising the bar on the last challenge :) 09:00
09:00 masak joined
snarkyboojum I like 09:00
masak oh hai
snarkyboojum masak: o/
IllvilJa masak: hai 09:01
moritz_ Applying: Added valid --target stages
fatal: corrupt patch at line 10
snarkyboojum :O
moritz_ :( somehow my git doesn't like snarkyboojum's patch
snarkyboojum :(
09:02 am0c left
snarkyboojum moritz_: I generated it via 'git format-patch HEAD^' 09:03
moritz_: have had success with that in the past
moritz_ snarkyboojum: so I thought... but my git is older than yours
snarkyboojum moritz_: oic :(
moritz_ snarkyboojum: I guess it trips over the dots on empty lines
I'm used to seeing blanks there 09:04
masak: nopaste.snit.ch/20525 review/suggestions welcome
snarkyboojum moritz_: oh right - you obviously know more about patches than I do :)
seems quite a blunder to create patch backwards incompatibility between git versions 09:05
moritz_ aye
I've now applied it by hand :/
snarkyboojum moritz_: o/ :)
masak moritz_: 'However it uses' is not the same as 'However, it uses'. 09:07
moritz_ adds a comma
masak moritz_: 'sub directory' -> 'subdirectory' 09:09
moritz_ deletes a blank
masak++
masak the rest looks good. moritz_++
moritz_ perlgeek.de/blog-en/perl-6/contribu...-test.html 09:10
dalek kudo: 8236cef | snarkyboojum++ | docs/running.pod:
Document valid --target= command line options
09:11
snarkyboojum masak: when you have time - what obvious/newbie thing am I doing to break my tardis tests :) gist.github.com/397105 09:13
09:17 am0c joined
masak ostatic.com/blog/guest-post-why-per...on-or-ever 09:18
seems like a well-written article.
I love to see the 'sibling' meme take root ♥
snarkyboojum "but the language is alive, well, and still holding the Internet together" :) 09:21
09:26 xinming left 09:28 xinming joined
moritz_ submitted the link to reddit/programming 09:34
szabgab++ already submitted it perl/, but the perl people already know it's alive :-) 09:35
szabgab yeah, it should be under programming so we can get all the FUD from the snake people :-)
09:36 lest_away is now known as lestrrat
szabgab moritz_, do you take moritz++ or moritz_++ ? 09:37
moritz_ szabgab: yes :-)
I don't care much either way
moritz_ collects my IRC karam, moritz my commit karma 09:38
masak as in Perl 6, the underscore indicates that something is 'internal' :)
moritz_ no, it indicates that the name without the _ is already taken :* 09:39
09:39 iblechbot left
moritz_ s/\*/(/ 09:39
masak :)
09:44 rurban joined 09:45 jhuni left 09:47 rurban left, rurban joined 09:48 yinyin left, rurban left
snarkyboojum the comments on blogs.perl.org/users/leon_timmerman...erent.html seem to be FUDish :( 09:49
snarkyboojum clones masak to set the comment record straight :) 09:50
moritz_ wonders if that was a deep or a shallow clone 09:51
masak seems not to have worked on this end :/ 09:52
'You know, that's the one thing that bothers me about Perl 6. Like Lisp, it's too flexible.' -- that's not FUD, that's praise. :) 09:53
they might as well have said "Perl 6 is too awesome!"
moritz_ doesn't understand why use of macros should make Perl knowledge any less portable than a classic (OO or procedural) API 09:54
masak snarkyboojum: I didn't think the comments were so bad, overall. there were a few honest questions about how Perl 6 will do homoiconicity, and a few comments questioned the premise of the article. I don't see that as FUD. 09:56
snarkyboojum masak: maybe I'm introducing FUD about so-called FUDish comments 09:57
masak: I guess what I was reaching for was "It'd be nice for an educated Perl 6 voice to be present" or something along those lines 09:58
if that doesn't sound too FUDish :)
moritz_ feels not educated when it comes to macros 09:59
masak well, I agree with many of the hesitations and criticisms :)
and sorear's recent experiments have, I believe, corroborated that macros are underspecified.
er, I mean "sorear++'s" 10:00
moritz_ which is no surprise at all
snarkyboojum is glad is classified his statement with an -ish suffix :P 10:01
moritz_ agreesish 10:02
snarkyboojum :P
masak another comment in favour of the recent proto/multi spec change: I've often (wrongly) assumed that I'd still retain the Mu.new method when only adding multi .new methods in my classes. that wasn't so, but with the new spec (and if Mu.new is a multi method), it is. 10:03
10:04 plobsing left 10:10 drbean joined
masak sushi & 10:14
10:26 fridim joined 10:28 DG joined, DG left
dalek kudo: 9f1395c | moritz++ | src/pmc/p6lowlevelsig.pmc:
fix build with g++, patch courtesy of mikehh
10:32
10:33 saaki left, kaare joined 10:34 kaare is now known as Guest66250 10:36 JimmyZ left, Arroz_ joined
Su-Shee ah. that posting. 10:52
ah that two postings. (which are both wrong imho.. ;) 10:54
snarkyboojum Su-Shee: which one? 11:05
colomon moritz_++ for getting those patches committed. 11:07
snarkyboojum colomon: o/ 11:08
Su-Shee snarkyboojum: the one of "perl 6 is the new lisp" and "perl isn't going away soon"
colomon \o
snarkyboojum Su-Shee: ah
11:09 iblechbot joined 11:13 gpw left 11:14 gpw joined 11:30 agentzh left 11:37 araujo joined 11:40 pmurias joined 11:46 sundar joined
takadonet morning all 11:49
sundar takadonet: \o
takadonet sundar: how's your project going > 11:50
?
sundar why does this week's challenge explicitly ask people to commit directly? is the idea to examine the patch before giving the commit bit? j
takadonet: which project?
takadonet sundar: any of them? :)
moritz_ sundar: the pugs repo has always encouraged people to commit directly 11:54
colomon sundar: I think the goal (as much as anything) is to get new people up and running with making changes to the spectests.
moritz_ it has worked pretty fine so far
sundar takadonet: :) have recently been hibernating since I'm shifting places.. been especially quiet on the Perl 6 side, been days since I joined the channel even.
moritz_ and in my experience people ask for review before committing anyway, if they are not sure 11:55
snarkyboojum moritz_: what is the saying - forgiveness rather than permission?
moritz_ right
colomon and version control makes it easy enough to undo
sundar moritz_: oh ok.. but in this case, if there are multiple people taking up the challenge, and miss to check commit logs..
moritz_ sundar: if they change the same file, they'll get a merge error from svn 11:56
sundar: and if the 'svn up' to the newest version, they *see* that something has changed
sundar moritz_: Ok.. guess I've become too used to catering to the lowest denominator. :) 11:58
snarkyboojum sundar: don't let me slow you down :P 11:59
12:04 envi^home joined 12:05 Bzek left 12:08 bluescreen joined, bluescreen is now known as Guest25967 12:13 am0c left 12:19 ruoso joined
moritz_ in ruby, you can do 4.times BLOCK 12:24
somehow I always felt it is wrong to let numbers do control flow
is there any formalized version of this complaint? 12:25
masak in Python, you can do '-'.join(list) :)
moritz_ it feels wrong, but I have a hard time putting it into a solid argument 12:26
masak Separation of Concerns, perhaps?
moritz_ that was my first thought too 12:27
masak things should Do One Thing, and Do It Well.
12:28 am0c joined 12:37 rgrau_ joined 12:44 SmokeMachine joined 12:45 gabiruh left 12:47 fridim left 12:48 TiMBuS left 12:52 molaf left
snarkyboojum moritz_: isn't it that you expect BLOCK, the subject, to be first e.g. BLOCK 4 times c.f. 4 times BLOCK? 12:56
moritz_ snarkyboojum: it's not about linguistics (or syntax) 12:57
snarkyboojum: it's just that I don't feel repetition of a block is an appropriate method for class Int
masak right. Int doing control flow is the weird bit. 12:58
12:58 ruoso left
masak unless, I guess, it's a Church numeral in some deeper sense. then I guess it's quite natural. :) 12:58
moritz_ it feels a bit like "my number '4' knows how to wash my car... 4 times" 12:59
masak well, it knows how to &wash-my-car, at least. 13:00
snarkyboojum or take masak's example - '-'.join(list) - it feels more natural to say "list joined with -" c.f. "not - joined over list" - list being the subject again
masak strictly speaking, 4.say is also a bit suspect.
moritz_ aye
you might have noticed that I don't use the method form of .say very often in my examples 13:01
pmurias 4.say very suspicious to me 13:04
phenny pmurias: 10 May 22:13Z <diakopter> tell pmurias utf32? surprised you ran into that it might be a bug in my UTF32String.cs
masak it's an interesting question whether the convenience gained by having .say 'outweighs' the breach in SoC.
13:04 scottmilt joined
snarkyboojum for the same reason no? 4 isn't the subject 13:04
masak right.
4 really has nothing to do with $*OUT
and yet it can print to it.
snarkyboojum but it's say that's printing...
moritz_ actually I only use the method form of say when I say .say (ie operate on $_) 13:05
masak snarkyboojum: and it's a method on Int (well, Any, really).
moritz_ or with an explicit IO object
Mu
snarkyboojum true, but say is the verb
moritz_ rakudo: say (1|2).say
p6eval rakudo 9f1395: OUTPUT«any(1, 2)␤1␤» 13:06
snarkyboojum rakudo: say say ''
moritz_ must be Mu for that to work
p6eval rakudo 9f1395: OUTPUT«␤1␤»
masak ah.
pmurias weren't all the convenience methods supposed to go to a special class
?
masak snarkyboojum: sure, but subroutines are 'global' verbs, whereas methods are verbs limited to certain classes of objects.
moritz_ pmurias: right, too Cool 13:07
snarkyboojum are global verbs limited to a global context? :)
moritz_ pmurias: but not all of them...
pmurias which ones stayed in Mu?
moritz_ pmurias: for example the List convenience methods stay in Any, as per TimToady
and print/say stay in Mu
pmurias can't we remove the .say/.print? 13:08
snarkyboojum there's a difference between 4.say and 4.times blah
pmurias 4.say is worse
moritz_ would move them to Cool
pmurias perl6: $*OUT.say("hi")
p6eval pugs, rakudo 9f1395: OUTPUT«hi␤» 13:09
..elf 30614: OUTPUT«␤»
moritz_ snarkyboojum: boths violate SoC
snarkyboojum SoC?
moritz_ Separation of Concerns
masak en.wikipedia.org/wiki/Separation_of_concerns
snarkyboojum oh right
yay acronyms :)
moritz_ or Summer of Code, for that matter
masak was just about to say that :P
pmurias moritz_: because Mu.say/Mu.print colide with IO.say/IO.print
mathw or System on a chip
masak mathw! \o/ 13:10
mathw hi masak
snarkyboojum yeah, yay acronyms
mathw I thought I'd take a break from fuming at press coverage of the election results
masak mathw: when are we going to sit down and do a lot of cool hacking on Form.pm?
pmurias moritz_: and don't offer any real benefits to make up for that
mathw and talk to clever people instead
masak: hmm. After my concerts are done.
masak mathw: deal.
when is that?
moritz_ pmurias: the only reasons in convenience, since the sub form doesn't default to $_ anymore
mathw last one's on the 21st
pmurias is say $_ that bad? 13:11
moritz_ yes :-)
masak there should be a convenient way to say 'run this sub on $_'...
moritz_ say _
masak not convenient enough :)
mathw ,say
moritz_ ugh 13:12
masak yes, well...
that's not really a sub, is it? :P
mathw say!
pmurias do you really want to introduce a special form to save 2 characters?
moritz_ 3
masak mathw: now we're talking :)
say! for @values;
moritz_ :-)
don't discount the extra space
because say$_ is ugly 13:13
pmurias yes
masak std: say$_
p6eval std 30614: OUTPUT«===SORRY!===␤Two terms in a row at /tmp/E5VDwpGzyl line 1:␤------> say⏏$_␤ expecting any of:␤ POST␤ argument list␤ bracketed infix␤ infix or meta-infix␤ postfix␤ postfix_prefix_meta_operator␤ statement modifier
..loop␤Other potential difficulti…
moritz_ ... and is disallowed :-)
13:13 ruoso joined
pmurias moritz_: re .say being convenient it also breaks when $_ is an IO object 13:13
moritz_ right
masak that's the corner case.
snarkyboojum std: std * 13:14
p6eval std 30614: OUTPUT«===SORRY!===␤Undeclared routine:␤ 'std' used at line 1␤Check failed␤FAILED 00:01 110m␤»
snarkyboojum std: say *
p6eval std 30614: OUTPUT«ok 00:01 110m␤»
pmurias masak: Perl 6 is not supposed to have corner cases
masak d'oh!
moritz_ pmurias: nope; convience is rated higher than lack of corner cases
masak I mean, that's the place where the waterbed bulbs up and hits you on the chin... :)
moritz_ pmurias: example: smart matching
13:15 viklund left
pmurias why can we have the zero argument say then? 13:16
moritz_ we can't
snarkyboojum worked in alpha
moritz_ alpha: say 13:17
pmurias moritz_: why not?
snarkyboojum alpha: say
p6eval alpha 30e0ed: OUTPUT«say requires an argument at line 10, near ""␤in Main (file src/gen_setting.pm, line 2593)␤»
snarkyboojum oh :|
masak that's for hysterical raisins.
too easy for people to write 'say for @values'.
snarkyboojum I'm sure I had "say" printing newlines for me at one stage :)
moritz_ pmurias: because sometimes our priorities are twisted?
alpha: say() 13:18
p6eval alpha 30e0ed: OUTPUT«say requires an argument at line 10, near ""␤in Main (file src/gen_setting.pm, line 2610)␤»
moritz_ rakudo: say
p6eval rakudo 9f1395: OUTPUT«␤»
moritz_ "works"
snarkyboojum oh, maybe it was master
:S
moritz_ some of us are too young to have properly witnessed 'alpha' times... :-) 13:19
snarkyboojum :)
masak can sometimes feel he could have use for bare 'say'
snarkyboojum or we watched from a great distance
moritz_ masak: me too 13:20
masak use Bare::Say;
I guess.
moritz_ masak: which is why I want to write a module at some point that disable p5 warnings that interfer with "normal" Perl 6 code
pmurias TimToady: can we remove .say/.print from Any as it collides with .say/.print on IO, violates seperation of concern and all it saves is a few chars
masak moritz_: I applaud that idea.
moritz_ masak: and also allows empty < > 13:21
std: <>
p6eval std 30614: OUTPUT«===SORRY!===␤Unsupported use of <>; in Perl 6 please use lines() to read input,␤ or ('') to represent the null string,␤ or () to represent Nil at /tmp/0nYna1EstC line 1:␤------> <⏏>␤Parse failed␤FAILED 00:01 109m␤»
moritz_ std: < >
p6eval std 30614: OUTPUT«ok 00:01 110m␤»
masak moritz_: and allows the use of a lot of otherwise banned variable names.
13:21 PZt joined
moritz_ masak: example? 13:22
masak pmurias: the only objection I have then is that 'say $_ for @values' fails to hide $_ in a way that Perl 5 often succeeds in doing. '.say for @values' hides it, but at the cost of all the disadvantages you mentioned.
13:23 christine left
masak moritz_: I'll have a look. I know that STD.pm6 disallows a bunch. 13:23
pmurias masak: why is hiding $_ considered a good thing?
moritz_ it explicitly carps about $\ $, $" etc.
13:23 sundar left
moritz_ which can be annoying in string interpolations 13:23
pmurias: if you want to mention a variable, you use a named variable 13:24
pmurias: if you use $_, you don't want to write it explicitly
masak pmurias: I don't know if it's universally considered a good thing. but it's one of the things I personally like about $_.
moritz_ it's just two different ways of doing the same thing
and providing no easy way to print $_ without mentioning $_ effictively destroys one of these ways
masak in that sense, .say compensates for bare 'say' no longer defaulting to $_. 13:25
13:25 Bzek joined
masak but it does it only on a whitelisting basis, which is actually quite sad. 13:25
Perl 5 has loads of subs defaulting to $_.
moritz_ and some which unexpectedly don't 13:26
13:26 pmurias left, pmurias joined
moritz_ some are also plain weird 13:27
for example split defaults to $_ on the second argument
13:27 christine joined
masak moritz_: $^I, or $^ followed by most capital letters. 13:28
moritz_ by all, actually 13:29
13:29 am0c left
masak aye. 13:29
tedv default p5 split doing a split on characters always confused me 13:34
moritz_ tedv: huh? default split splits on whitespace 13:35
tedv maybe I'm going crazy, one moment
moritz_ $ echo 'a b cd' | perl -nE 'say join "|", split' 13:36
a|b|cd
split is the same as split ' ', $_
tedv oh I'm confusing it with split //
moritz_ aye 13:37
tedv so I guess that's a meta confusion
maybe I've been infected with cargo cult coding after seeing so many instances of "split ' '" in my coworkers code
moritz_ :-) 13:38
PerlJam I always thought the most confusing thing about split for most people was understanding that the first this is always a regex except when it's just ' '
snarkyboojum I guess the pronoun "it" should be implicit in most cases, unless the context isn't known?
PerlJam s/this/thing/ 13:39
masak snarkyboojum: aye, should :)
tedv isn't the " " split token also just shorthand for a special regexp 13:40
and a bit of bonus code to shave off start and ending null strings?
moritz_ afaict it's really special
and starting null strings too
tedv just for the bonus start-and-end code though, right? Or is it super optimized in some way?
I thought scalar(split " ", "") == 0 13:41
masak the u4x page for split should say "It's highly probably that you want 'comb', not 'split'." :)
PerlJam masak++
moritz_ tedv: split in scalar context does something entirely different too
it splits into @_
pmurias masak: "Consider using comb instead"
moritz_ hooray for special cases!
tedv oh perl... why do you hate me so!
hmm I've never used split in scalar context then, or I would have remembered that 13:42
pmurias moritz_: they save characters don't they? ;)
PerlJam tedv: @foo = split "x*y", $string; # it tends to surprise people that "x*y" is a regex because it looks so much like a string too :)
moritz_ pmurias: loads
PerlJam Perl warns about implicit splitting into @_ (if you've got warnings on)
moritz_ pmurias: great for golfing 13:43
tedv well "xy" is also a regexp right?
or do you have to explicitly qualify that as /xy/
13:43 am0c joined
masak pmurias: well, that makes it sound like comb is just a better split. that's not quite true. 13:43
PerlJam tedv: if it's the first arg to split it is
tedv yeah
moritz_ but notice that split / / and split ' ' are different
masak pmurias: sometimes you really do want split.
tedv yeah I do know that
moritz_ $ perldoc -f split | wc -l 13:51
125
13:51 scottmilt left, clintongormley joined
moritz_ that is 5 display pages 13:52
13:54 jotr_^away is now known as jotr_, Bzek left 13:56 plobsing joined 13:57 Guest66250 left
masak .oO( correlation between popular functions and cornerspecialcasecruft ) 13:58
13:59 wasy left, XaeroOne joined
XaeroOne is it now possible to use for my $var @arr {...} in perl6? 14:01
masak XaeroOne: yes, but it's no longer written like that.
XaeroOne: since $var belongs more to the block, it's written `for @arr -> $var { ... }`
XaeroOne use -> i know
masak std: for my $var @arr { ... } 14:02
p6eval std 30614: OUTPUT«Use of uninitialized value $FATALS in numeric gt (>) at STD.pm line 100780.␤===SORRY!===␤Missing block at /tmp/wUDyqIrv8m line 1:␤------> for my $var ⏏@arr { ... }␤ expecting any of:␤ bracketed infix␤ infix or meta-infix␤ trait␤Parse
..failed␤F…
14:02 Lorn left
snarkyboojum std: foreach my $var (@arr) { } 14:02
p6eval std 30614: OUTPUT«===SORRY!===␤Unsupported use of 'foreach'; in Perl 6 please use 'for' at /tmp/a7QxxKxMtF line 1:␤------> foreach⏏ my $var (@arr) { }␤Parse failed␤FAILED 00:01 109m␤»
snarkyboojum :)
XaeroOne but why? is is easier that way
moritz_ XaeroOne: no, you're just used to the old way
masak XaeroOne: the $var is now part of the block signature.
XaeroOne: which has new advntages and simplifications.
moritz_ also for my $var @list is essentially two terms in a row 14:03
which is forbidden in most areas of the language
XaeroOne ok, I dunno perl a lot but the python style "for a in b" is easy to read
masak it's not forbidden in special forms, of which 'for' is one. but yeah.
snarkyboojum std: for @array -> my $item {...}
p6eval std 30614: OUTPUT«===SORRY!===␤Variable @array is not predeclared at /tmp/pFvCqpgwlY line 1:␤------> for @array⏏ -> my $item {...}␤In parameter declaration, typename 'my' must be predeclared (or marked as declarative with :: prefix) at /tmp/pFvCqpgwlY line
..1:␤---…
snarkyboojum std: for @array -> $item {...} 14:04
p6eval std 30614: OUTPUT«===SORRY!===␤Variable @array is not predeclared at /tmp/Kin9CO9P8d line 1:␤------> for @array⏏ -> $item {...}␤Check failed␤FAILED 00:01 111m␤»
masak snarkyboojum: read the error messages.
XaeroOne so then what will happen to all the cpan modules?
masak XaeroOne: they will continue to run under Perl 5.
snarkyboojum masak: no kidding :)
moritz_ there's actually an effort to use perl 5 modules from Perl 6 14:05
XaeroOne perl6 without cpan, are you kidding?
masak XaeroOne: hopefully there will be ways to use Perl 5 from Perl 6.
XaeroOne something like the python 2to3 script?
moritz_ nope, not conversion
masak XaeroOne: no, more like parallel runtimes.
moritz_ linking the perl5 interpreter into Perl 6
and then cross-talking between the two 14:06
hilarity ensured
XaeroOne omg more complications
moritz_ oh, you can also re-write the good modules in Perl 6, if you like that better
masak XaeroOne: sorry, you thought this was an easy mission? :P
XaeroOne how long before p6 is production ready? rought estimate?
masak XaeroOne: we don't do estimates. :)
moritz_ depends on your definition of "production"
XaeroOne please?
masak XaeroOne: we're working as fast as we can. 14:07
PerlJam XaeroOne: What do you want to use it for?
XaeroOne i am just about learning perl5
moritz_ for some values of "production", it's usable today
for others, not
XaeroOne was wondering if it would be better to learn perl6 itself?
masak XaeroOne: keep learning Perl 5. you won't regret it. but learn Perl 6 too if you want to see what the future holds.
PerlJam XaeroOne: Learn as much as you can :)
masak XaeroOne: also, try Rakudo. it might be more done than you think.
XaeroOne: did you know that there is one release of Rakudo Perl 6 each month? 14:08
XaeroOne rakudo is like a perl distribution right?
does it need parrot?
moritz_ a perl 6 compiler
yes
PerlJam XaeroOne: Rakudo is a Perl 6 compiler that targets parrot
XaeroOne oh so I need both rakudo and parrot vm? 14:09
and parrot vm can do python too?
moritz_ yes; but rakudo can install and compile parrot for you
masak XaeroOne: if you download it from github.com/rakudo/rakudo/downloads and follow the instructions, it will get Parrot for you.
moritz_ or even rakudo.org/how-to-get-rakudo
PerlJam XaeroOne: There is a python compiler called pynie that targets parrot, yes
14:10 uniejo left
moritz_ but it's not shippped with parrot; you need to get it separately 14:10
tedv how optimized is parrot these days?
XaeroOne so where does that leave perl vs python err.. "discussions"?
PerlJam tedv: some, but not enough :)
XaeroOne: what do you mean?
XaeroOne :P ok not funny 14:11
moritz_ XaeroOne: probably at the same state as the "hammer vs. screw driver" discussions
tedv Yeah
colomon sorear++'s lexical persistence patch just hit my e-mail...
tedv I think of Python as the language I want all my coworkers to code in
and Perl as the language I want to code in
masak XaeroOne: people in here tend to be inclusive rather than exclusive, so it's hard to get real language flamewars going :)
moritz_ except about C++ :-) 14:12
masak well, there are exceptions to everything.
tedv you mean java!
moritz_ there'a slways somebody williing to speak up against C++ or java :-)
XaeroOne i'm reading the perl5 to perl6 article and it looks very good
love it
moritz_ thanks
PerlJam The only language that really grates on my brain is COBOL.
masak PerlJam: been reading too little bf and INTERCAL lately? 14:13
snarkyboojum PerlJam: about about Brainf*ck :)
XaeroOne keep up the good work and thanks for the help
tedv The only real beef I have with Java is that it thinks people will be safer programmers if they have to type more, which just isn't true.
XaeroOne gotta run
masak XaeroOne: \o
tedv So you end up with wordy code that's just as buggy as in any other language, except even harder to read.
PerlJam masak: no, those are "toy" languages, so they're okay. :)
masak INTERCAL is very serious! 14:14
tedv P6 needs to implement the Brainf*ck grammar in a package
moritz_ grammar? brainfuck has grammar?
tedv well its executions are well defined, right?
moritz_ that's news to me
tedv it's just that the grammar involves heavy use of punctuation
masak PerlJam: INTERCAL even pioneered threading by removing the restriction of 'only one COME FROM per label' :)
moritz_ :-)
arnsholt moritz_: It's not a very complicated grammar (might even be regular, I think) =) 14:15
masak probably regular.
arnsholt Essentially m/[$ops]*/
masak well, and loops.
moritz_ it might be that [ and ] need to be matched
14:15 dalek left
arnsholt Right. Possibly context free, then 14:15
masak :) 14:16
moritz_ :-)
masak wishes he knew those terms by heart
and the automata they correspond to.
14:16 dalek joined
moritz_ masak: just attend a lecture "formal languages and automata" or so 14:16
masak: it helped me a lot
masak thanks for the tip.
moritz_ (only about 1/4 of it is actually relevant to any of the discussions here, but it's still a high ratio for a university course) 14:17
14:17 XaeroOne left
PerlJam The class is called "Theory of Computation" around here 14:17
14:18 bubaflub joined
PerlJam moritz_: But, those who don't understand history are doomed to repeat it or something, so even that 3/4 that isn't directly relevant is still useful. :) 14:19
arnsholt masak: The extremely short explanation: context-free means that there is some kind of structure that has to match up like parens "left-part whatever right-part" 14:20
Corresponds to push-down automata
moritz_ or the memory-model: it needs a stack of linear size
arnsholt Regular is anything that can be matched by a regular expression (d'uh =). Essentially, you can only specify how a single element can be repeated 14:21
No counting and corresponding that to some other element. Corresponds to finite state automata
moritz_ memory model: constant memory
arnsholt (deterministic and non-deterministic FSAs are equivalent. Not so with push-down automata) 14:22
bubaflub moritz_: i noticed your blog post about fixing up a test and i'd like to try my hand at it
moritz_ bubaflub: great
PerlJam bubaflub++
moritz++
moritz_ bubaflub: do you have a commit bit already?
bubaflub moritz_: to the parrot repo, not to anything rakudo related
masak arnsholt: thanks. all this sounds familiar, but I'm not sure I'd be able to repeat it offhand.
moritz_ bubaflub: then you need one for the pugs repo (the tests live in there)
bubaflub: please tell (or /msg) me your email address
tedv Things I Like About Perl 6: Using ?? !! instead of ? :
masak thought: what's the closest approximation to an 'abstract class' in Perl 6 OO? 14:23
arnsholt masak: The important thing (IMO) is to know that there's a difference. And for bonus points, being able to see when you have a context-free problem
masak is it "just don't instantiate it, silly!", or something more elaborate?
moritz_ bubaflub: invitation sent; welcome 14:24
bubaflub moritz_: thanks
masak arnsholt: how do you know when you have a context-free problem?
arnsholt Just knowing there are things that can't be matched by regexes gives you a bit of spider senses to know what to ask for when your regexes just refuse to work
PerlJam arnsholt: Even CS PhDs get confused on that sometimes
moritz_ masak: anything which requires arbitrary nesting
masak arnsholt: guess what you've been saying is part of this: en.wikipedia.org/wiki/Chomsky_hierarchy
arnsholt masak: The key bit is the "parenthesis structure". You have a head element and a tail element, and inside those you have something with the same structure 14:25
moritz_ masak: parenthesis, xml tags, stuff like that
masak ah, ok.
I think I can recognize those.
moritz_ another example is a string + its reverse
it basically nests arbitrary characters
tedv What's the difference between Cool-num and Num? 14:26
moritz_ Cool-num.pm contains methods that are in class Cool, but deal with numbers
arnsholt Context-sensitive is where you have overlapping, but not nested parenthetical structure, like ( [ ) ], or a**n b**n c**n
moritz_ or xml tags of arbitrary length
(you can't parse those with context free grammars unless you tokenize first) 14:27
tedv what is the "Cool" class supposed to encapsulate?
moritz_ the notion of certain wide class of built-ins
arnsholt Fun fact: Requiring names to be predeclared, like in C, C++, Java, whatever, is actually context-sensitive
moritz_ that coerce to the proper type
memory model: linear, arbitrary access 14:28
arnsholt A parser usually cheats by maintaining a bit of extra state to do the checking
masak sorear++ # RT #75030
arnsholt But yeah, this is all essentially the Chomsky hierarchy 14:29
moritz_ now you can do fun things, like describe regular languages with a certain class of predicate logic
or proof that co-LBA == LBA
moritz_ forgot that proof pretty quickly 14:30
arnsholt *shudder* I'm taking a class in modal logic this semester
The prof is really keen on simulating Turing machines with logic and so on. Very theoretical
moritz_ only remembers "inductive counting" or such a similar buzzword 14:31
anyway, was a fun class and gave me a good grade
masak interesting list: en.wikipedia.org/wiki/Special:WhatL...ere/Perl_6 14:32
14:35 JimmyZ joined, snarkyboojum left 14:36 circuitbreaker joined
masak the wp article 'Coroutine' claims that coroutines are native to Perl 6. I'm not sure I agree with that. 14:36
unless you count the gather/take mechanism as implementing coroutines.
moritz_ then please add a [citation required]
masak does so 14:37
14:37 snarkyboojum joined
snarkyboojum masak: examples of what breaks in tardis/yapsi integration -> github.com/masak/tardis/blob/yapsi-.../t/ticks.t 14:37
masak snarkyboojum: excellent; thank you. 14:38
bubaflub moritz_: perl6 built, tests downloaded, and now i'm reading the synopsis for S05 - i'll probably have some questions in a bit
snarkyboojum masak: welcome - buzz me with any ideas as to what I'm doing wrong :)
moritz_ bubaflub: sure, shoot when you have them 14:39
14:41 JimmyZ left 14:42 JimmyZ joined
masak snarkyboojum: do you use the Makefile in that branch? because I can't, it seems; it doesn't find Yapsi. 14:43
snarkyboojum masak: I do
masak unmodified? when I change it a bit, it works. 14:44
14:44 pmurias left
masak maybe I should ask: how does it find the Yapsi module on your box? :) 14:44
snarkyboojum but I use yapsi in ~/.perl6/lib if that makes any sense
moritz_ bubaflub: if you know the NQP or PGE grammars, they are a subset of the Perl 6 grammars
masak snarkyboojum: ah -- I suspected that.
bubaflub moritz_: only a little bit
masak snarkyboojum: that's probably quite a nice solution. require Yapsi to be installed.
snarkyboojum masak: I "install" yapsi when I need a new version
masak *nod*
let's leave it that way for now. 14:45
moritz_ it fits SoC :-)
snarkyboojum masak: ok
bubaflub moritz_: i'm still reading the Synopsis looking for where the .parse and .parsefile methods are specified
masak moritz_: it does indeed. hardcoding paths is not fun.
snarkyboojum++
snarkyboojum :)
moritz_ bubaflub: last paragraph of perlcabal.org/syn/S05.html#Grammars talks about .parse
bubaflub: .parsefile is the same, but takes a filename to read from... seems to be specced by cultural knowledge rather than synopsis text 14:46
bubaflub moritz_: okey dokey
moritz_ which is bad, and should be changed
but I don't want to make spec changes part of challenges to newcomers 14:47
too scary :-)
masak snarkyboojum: both for the 'install' idea and for the nice test file.
snarkyboojum masak++ # for appropriating test file ideas :)
masak I'm getting a runtime panic from Yapsi when I run that. somewhere around test 5 in t/ticks.t
no idea why.
yet. 14:48
snarkyboojum masak: because it doesn't like var initialisation in a block
masak hm, but it used to have no problem with that, I think.
snarkyboojum locate-variable doesn't work in that case
masak ah, ok.
it's that part that blows up. that makes sense.
snarkyboojum yep
masak you've even mentioned it before.
snarkyboojum yeah 14:49
masak except for the part where my time this week is severely rationed, I think that's an easy fix.
snarkyboojum I put that in as an example of a failing test case
masak especially now that we have tests.
snarkyboojum cool :)
masak I'm also increasingly itching for functions. that would be cool to start hacking on.
snarkyboojum communicating via tests.. I like :) 14:50
masak: agreed :)
masak should write a ROADMAP for Yapsi
snarkyboojum that'd be v. cool 14:51
pmichaud good morning, #perl6 14:53
phenny pmichaud: 10 May 23:49Z <sorear> tell pmichaud What would you think of me implementing the mixin subset of role functionality in NQP-rx? This would allow slangs in Rakudo, bringing our grammar closer to STD while fixing operator overload scoping and enabling lexical macros
pmichaud phenny: tell sorear I'm not eager to try to get roles working in nqp-rx... nqp-rx is supposed to remain simple. 14:55
phenny pmichaud: I'll pass that on when sorear is around.
bubaflub moritz_: i'm getting a strange error + backtrace, one sec i'll get a gist of it 14:56
14:56 ash__ joined
bubaflub moritz_: gist.github.com/397407 14:57
14:57 plobsing left
bubaflub or perhaps that's just the result of trying to improperly set an integer 14:57
moritz_ boggles at the backtrace 14:58
it's from the module loader 14:59
oh
masak pmichaud: rt.perl.org/rt3/Ticket/Display.html?id=75030 15:00
pmichaud: it would be really, really good if this patch made it into Rakudo.
pmichaud masak: looking
15:00 alester joined
pugssvn r30615 | moritz++ | [t/spec] a fudge which hides a weird error 15:01
moritz_ bubaflub: it's related to the 'grammar Integer' definition late in the file
pmichaud masak: the patch is too big for me to do a quick review --- I'll have to review it more thoroughly a bit later
moritz_ bubaflub: I've just committed somethiing to fudge it out, it should be a less confusing error now... hopefully
pmichaud I don't like that it changes the parameters to !UNIT_START, though. 15:02
15:02 am0c left
masak pmichaud: I understand. just letting you know that people on the sidelines are cheering this patch on. 15:02
oh, and I can't vouch for the actual changes it does, because I haven't looked at it.
and might not understand everything even if I had.
pmichaud Also, since I've been working on fixing closures over the weekend, I'm a bit concerned this patch won't work anyway. 15:03
pugssvn r30616 | moritz++ | [t/spec] fix previous commit
moritz_ bubaflub: and another patch to fix the previous one... please 'svn up' in the t/spec dir
bubaflub: if you run 'make t/spec/S05-grammar/parse_and_parsefile.t' it actually passes some of the tests 15:04
pmichaud actually, there are quite a few nits with that particular patch. :-( 15:05
moritz_ sorry for the inconvenience :/
pmichaud: did you have any success with closures?
ash__ Can you use "return" in a pointy block? 15:06
pmichaud moritz_: depends on how one defines "success" :)
moritz_ ash__: that will return from the surrounding routine
bubaflub moritz_: np.
pmichaud moritz_: I know where the problems are and how to fix them, unfortunately Parrot's current opcodes are fundamentally wrong.
ash__ ah, that explains it
moritz_ ash__: leave() is meant for leaving blocks 15:07
PerlJam ash__: IIRC, you can "leave" a pointy block
ash__ rakudo: my $a = 123; my $b = -> { return -> { return $a }; }; say $b()(); # that was a bit confusing, but i see why it happened now
p6eval rakudo 9f1395: OUTPUT«No exception handler and no message␤current instr.: '&return' pc 17919 (src/builtins/Junction.pir:414)␤»
bubaflub moritz_: ok, now i see the problem. the parse either matches the entire line or it matches nothing
the test is setup to match substrings
moritz_ bubaflub: correct
bubaflub should i change the expected values of the test or should i rewrite the tests so we have examples that don't fial 15:08
*fail
moritz_ pmichaud: which opcodes? the newclosure, capturelex etc.?
pmichaud moritz_: yes.
it's also an issue that parrot only provides a notion of static outerness but not dynamic outerness
moritz_ bubaflub: that's up to you, as long as in the end there are some tests for matching grammars, and some for non-matching
ash__ pmichaud: did alpha have to cheat or something then? (didn't it have closures working properly?) 15:09
bubaflub moritz_: ok. i'll fix the existing ones and add more tests
pmichaud ash__: alpha just never tested the cases that would fail, I suspect.
moritz_ uhm
alpha passed the man-or-boy test
pmichaud sure, it passed that.
moritz_ as well as some other closure tests that master fails 15:10
pmichaud that doesn't mean it'll pass the case I've come up with.
15:10 gfldex_ is now known as gfldex
ash__ pmichaud: is that test in the t/spec now? or viewable online? 15:10
pmichaud ash__: I'm writing it up as an example to share with the parrot folks
i.e., it's an example of a place where parrot cannot support a needed semantic without some really undesirable workarounds 15:11
masak pmichaud: master has definitely regressed in some way when it comes to closure cloning.
pmichaud masak: yes, I know
the basic problem with master is that we no longer clone values on assignment
and alpha was relying on the "assignment makes a copy" semantic for subs
masak ah.
pmichaud nowadays, assignment in master simply associates a value with a container 15:12
masak AFAIU, it's the entry into the surrounding block that makes a copy. at least on some theoretical plane of explanation.
[Coke] I am bemused at the first and last sections of the topic.
pmichaud masak: yes, but it really wants to be a copy of the lexical pad, not the subroutine itself.
masak right. 15:13
pmichaud and parrot doesn't give us a way to get a lexical pad before a subroutine has been invoked
moritz_ which I found out painfully when trying to set $/ in yet-to-be-called subroutine
for s///
15:14 molaf joined
pmichaud masak: RT #75030 many of the basics are correct there, but it's got too many nits for me to accept the patch as-is. 15:15
masak pmichaud: sounds like a partway win, anyhow.
pmichaud: looking forward to the remaining nits being resolved.
pmichaud I don't like (the way) that it suppresses output on statements and blocks 15:17
or that the ast ends up being different depending on the setting of $*AUTOPRINT 15:18
ash__ for proper closure support, when you capture a closure, how much of the world will it freeze? for instance: my $a = 123; my $b = -> { -> { $a, eval "$a" }; }; my $a = 124; say $b()(); should that print
15:18 rv2733 joined
ash__ should that print 123124 or 124124 or 123123? 15:18
pmichaud well, there's a redeclaration of $a there 15:19
moritz_ perl6: my $a = 123; my $b = -> { -> { $a, eval "$a" }; }; my $a = 124; say $b()();
p6eval elf 30616: OUTPUT«AST handler circumfix:pblock partially unimplemented at ./elf_h line 3549␤»
..pugs: OUTPUT«124124␤»
..rakudo 9f1395: OUTPUT«Redeclaration of symbol $a at line 11, near " = 124; sa"␤current instr.: 'perl6;HLL;Grammar;panic' pc 501 (ext/nqp-rx/src/stage0/HLL-s0.pir:327)␤»
pmichaud rakudo++
moritz_ alpha: my $a = 123; my $b = -> { -> { $a, eval "$a" }; }; my $a = 124; say $b()(); 15:20
p6eval alpha 30e0ed: OUTPUT«Redeclaration of variable $a␤»
pmichaud alpha++
ash__ oops, i guess the second my needs to go
pmichaud :-)
ash__ pugs: my $a = 123; my $b = -> { -> { $a, eval "$a" }; }; $a = 124; say $b()();
p6eval pugs: OUTPUT«124124␤»
pmichaud pugs is right there. 15:21
moritz_ it's pretty much what I expected too
the variable is captured, not the value in the variable
pmichaud rakudo: my $a = 123; my $b = -> { -> { $a, eval "$a" }; }; $a = 124; say $b()();
p6eval rakudo 9f1395: OUTPUT«124124␤»
pmichaud rakudo is correct also.
ash__ I wasn't sure if it some how was supposed to freeze $a when it made the pointy block $b into a closure or not 15:22
pmichaud it doesn't freeze the value, no. 15:23
it freezes the binding of the name to the container
ash__ got ya, how much freezing of the bindings should happens though? does it freeze the world when it makes a new closure? or does it freeze the current lexpad? or the lexpads its aware it uses? 15:26
TimToady phenny: tell pmurias no, we will not remove .say from Any; you seem to have lost track of the idea that the main point of superclasses is to *lose* the separation of concerns imposed by the subclasses. Language design is more about *balance* of concerns.
phenny TimToady: I'll pass that on when pmurias is around.
15:26 \\shade\\ left, jotr_ is now known as jotr
bubaflub moritz_: i've got a patch for the spec file, i'd like to have you take a look at it before i commit 15:28
moritz_: it's pretty basic and some of the tests seem a bit repetitive, but it gets the job done
moritz_ bubaflub: sure, just paste the output of 'svn diff' somewhere 15:29
bubaflub moritz_: i'll reuse the gist, one sec
moritz_: gist.github.com/397407
masak #rs tonight? 15:30
moritz_ bubaflub: looks fine... one possible improvement is to use ok( !Foo.parse('abc123xyz'), ...) instead of is ( Foo.parse('abc123xyz'), '', ...) 15:31
the match object that is returned is False in boolean context, so you can use that property rather than relying on the string representation of the failed match 15:32
but it's also OK as it is right now
pmichaud aha! Parrot's capture_lex isn't using the static outer marker after all! 15:35
*whew*
okay, that makes fixing closures much easier.
TimToady \o\ /o/ 15:36
pmichaud (not easy, just easier)
TimToady \o /o
15:36 moritz_ sets mode: +o TimToady
moritz_ o, expressive dancing 15:37
TimToady o o <-- arms tired
"ascii comic strips"
ash__ now you just need to make a youtube video of you singing to a song... 15:38
TimToady <o? !o! ...o> 15:39
15:39 JimmyZ left
TimToady hard to draw a running head 15:39
ash__ !o! makes me think if giving someone thumbs up for some reason 15:40
15:41 JimmyZ joined
moritz_ actually it looks more like thumbs down to me 15:41
[Coke] o O % .
bubaflub moritz_: does the perl6 test library have not_ok? 15:42
moritz_ lemme check
I think it's spelled nok()
pmichaud afk for a bit
moritz_ yes, nok() exists
bubaflub moritz_: yep
moritz_: cool. i'll change those to nok() and submit the patch
moritz_ bubaflub++ 15:43
jnthn o/ folks 15:44
moritz_ \o
JimmyZ \o/ 15:45
pugssvn r30617 | bubaflub++ | [t/spec] bring parse_and_parsefile.t up to date 15:46
15:46 JimmyZ left
bubaflub moritz_: sweet. that wasn't too scary. is there another spec i should start hacking on? 15:47
moritz_ bubaflub++ 15:48
bubaflub: I'll take a look for low-hanging fruits... 15:49
snarkyboojum !o! looks like someone chasing me with two baseball bats
moritz_ rakudo: multi sub infix:<foo>($a, $b) {$a + $b}; my $x foo= 6; say $x
p6eval rakudo 9f1395: OUTPUT«Null PMC access in invoke()␤current instr.: '!assign_metaop' pc 17668 (src/builtins/Junction.pir:291)␤»
moritz_ bubaflub: that example should live, and have 6 in $x 15:50
jnthn rakudo: our multi sub infix:<foo>($a, $b) {$a + $b}; my $x foo= 6; say $x
p6eval rakudo 9f1395: OUTPUT«No applicable candidates found to dispatch to for 'infix:<foo>'. Available candidates are:␤:(Any $a, Any $b)␤␤current instr.: '!assign_metaop' pc 17668 (src/builtins/Junction.pir:291)␤»
moritz_ bubaflub: you could add that as a TODO'ed or skipped test in t/spec/S06-operator-overloading/subs.t
jnthn: I know where the problem is, needs probably just one or two lines of fix 15:51
jnthn: at least with your version :-)
both could use tests
jnthn moritz_: The first issue is a bit tricky 15:52
moritz_ aye; it's the second I know how to fix
and maybe I'll post that as another challenge 15:53
15:53 Lorn joined
moritz_ bubaflub: here's an idea... 15:53
jnthn needs to finish up a presentation and unglacialify some Excel export thingy today before he can look at Perl 6 bits
moritz_ bubaflub: in Perl 6 you can create Pair objects with various syntaxes
15:53 snarkyboojum_ joined, snarkyboojum left, snarkyboojum_ is now known as snarkyboojum
moritz_ bubaflub: for example my $x = 'foo'; :$a is another way to write a => 'foo' 15:54
bubaflub: this should also work with variables with twigils, ie :$^a, :$*a, :$!a etc
bubaflub: currenlty there are no sysstematic tests for that 15:55
a good place to add them would be S02-literals/pairs.t
pmichaud afk for lunch
bubaflub moritz_: okey dokey. i'll add the tests to S06-operator-overloading/sub.t and then check out Synopsis 2 about the pairs 15:56
moritz_ cool
masak bubaflub++
TimToady moritz_: s/my $x/my $a/ 15:57
masak so, #rs in three hours, yes?
moritz_ masak: yes
masak \o/
moritz_ TimToady: context?
TimToady 3 minutes ago
moritz_ oh yes 15:58
thanks
jnthn masak: Yes
masak \o/
jnthn masak: That feels early, but only because my sleep times are a tad off at the moment.
dalek kudo: ed24098 | moritz++ | t/spectest.data:
enable test file for Grammar.parse, bubaflub++
masak jnthn: din sömn är kass! :)
15:58 jonrafkind joined
jnthn masak: Min flygg var kass. 16:00
takadonet someone already did the challenge?!?!!
masak jnthn: 'mitt flyg'. yes, I read as much on Twitter.
takadonet: amazing, isn't it? 16:01
jnthn Huh, I have to learn spelling AND gender?
;-)
moritz_ takadonet: yes
takadonet masak: Indeed, Was not planning to do it since I want others to get involved
masak gender is easy. a flyg is obviously a t-word. :P unless you're Dansih, then it's probably the other way.
takadonet moritz_: Added your post to perl6.cz/wiki/Perl_6_and_Parrot_links#2010 :) 16:02
masak others really seem to get involved, too.
arnsholt masak: Is fly not neuter in Danish?
masak arnsholt: I don't know, and I wouldn't know where to check. but generally, it feels like n-words and t-words are often reversed in Swedish vs Danish. 16:03
16:04 iblechbot left
masak nom & 16:04
16:05 [mark] left 16:06 Bzek joined, snarkyboojum left
bubaflub moritz_: gist.github.com/397483 for the first todo test you mentioned 16:10
moritz_ bubaflub: it's better to omit the eval, and put a #?rakudo skip 'reason' before it 16:12
bubaflub moritz_: ok, i'll edit it up and update the gist
moritz_ so the test just reads is $x, 6, 'foo= works for custom operators'; 16:13
16:14 cdarroch joined, cdarroch left, cdarroch joined
bubaflub moritz_: ok, check out the gist again 16:15
moritz_ looks perfect 16:16
16:16 justatheory joined
bubaflub moritz_: cool. should i add another todo block for jnthn's example? 16:19
moritz_ bubaflub: yes (but please use a different operator name this time)
bubaflub moritz_: roger that
moritz_ so that the tests don't accientally interfere 16:20
bubaflub moritz_: ok, check out the gist one more time. is this what we want? also, what should be the skip reason? 16:22
moritz_ skip reason "dies" or "not yet implemented" 16:23
bubaflub: it would be better to put each test in a block of its own
so that one can run even if the other fails
bubaflub moritz_: okey dokey, editing 16:24
moritz_ bubaflub: I'm about to decommute, feel free to commit without explicit consent... I'll review it later on 16:25
bubaflub: and thanks for your patches!
16:25 k23z__ joined
bubaflub moritz_: okey dokey. np. i'll get those other todo tests as well soon. 16:25
pugssvn r30618 | bubaflub++ | [t/spec] add skipped tests for custom operators 16:29
dalek meta: r264 | diakopter++ | trunk/Sprixel/src/ (2 files):
[perlesque] back out a change
16:34
ash__ are there any tests in nqp-rx for lexical variables acting properly in closures? if not, i'll look for perl6 ones 16:55
16:59 envi^home left
sorear pmichaud++ prompt review 16:59
phenny sorear: 14:55Z <pmichaud> tell sorear I'm not eager to try to get roles working in nqp-rx... nqp-rx is supposed to remain simple.
17:02 PacoLinux left 17:03 PacoLinux joined 17:12 ash___ joined 17:14 ash__ left
sorear to reply to an RT reply, I just reply to the mail, right? 17:20
moritz_ right
17:25 dakkar left
sorear done. 17:29
moritz_ hates the mail delays that RT + mailing lists impose 17:30
17:38 baest joined 17:40 ruoso left 17:42 Tene joined, Tene left, Tene joined 17:44 patspam joined 17:58 IllvilJa left, IllvilJa joined 18:00 rv2733 left 18:01 cognominal left 18:04 IllvilJa left 18:06 cognominal joined
moritz_ I have some nice lasagna in the oven 18:10
cognominal that's better than spaghetti in your code :)
moritz_ there's no contradiction between the two :/ 18:11
jnthn If only writing good code just came from having a lasagna in the oven. 18:12
moritz_ speaking of good code
raakudo fails some tests on new parrot
because for anonymous parameters and lexicals it emits .lex '$'
and parrot now complains about two lexicals of the same name
rakudo: my ($, $) 18:13
p6eval rakudo ed2409: ( no output )
moritz_ given an IMCC error on newest parrot
*gives
18:14 Bzek left
jnthn D'oh 18:15
Should be fixable without too much pain.
moritz_ eats tasty lasagna 18:19
masak hm, haven't seen this one before: github.com/gymbrall/ruby_perl6grammar 18:25
18:26 iblechbot joined
ash___ masak: interesting 18:27
masak meanwhile on Twitter, someone says "Perl 6 is Vietnam for Perl". someone else (not me) answers: "Vietnam? Perhaps the Can Gio Mangrove Forest." :)
ash___ i have been working what other languages could do that would allow them to have something like grammars in perl6, most languages don't really have an easy way of making anything grammar like 18:28
s/working/wondering/
masak I've also been toying with reimplementing something like GGE or nqp-rx in Ruby (or Java, or C...)
moritz_ what's wrong with 'just' emitting a class? 18:29
ash___ masak: ooo, pick clojure?
masak :)
that would be interesting. Perl 6 regexes in clojure. 18:30
moritz_ masak: btw I quoted you duriing the talk yesterday
jnthn #rs in ~30mins.
masak moritz_: cool. what did I/you say?
moritz_ masak: in one my examples, I accidentally type 'class' instead of 'grammar' (inheriting from another grammar)...
masak: and somebody from the audience asked why it still worked 18:31
and I said that a grammar is just a class with a funny meta class :-)
masak hah :)
jnthn The meta class is so hilarious that it only adds a default parent of Grammar.
moritz_ plus a bit of explaining, and proper attribution :-)
masak moritz_++ 18:32
moritz_ jnthn: yes, I figured; which is my 'class Foo is Bar' works fine if Bar is a grammar
even in Foo is meant to be a class
jnthn Aye :-)
18:32 ruoso joined
lisppaste3 ruoso pasted "Some ideas for the "Object has an owner thread" threading model" at paste.lisp.org/display/99095 18:34
ruoso TimToady, ^
in fact... anyone interested in the threading model problem, please take a look at the above notes... 18:36
18:37 ash___ left 18:40 ShaneC joined
dalek ok: 1868ad6 | moritz++ | src/operators.pod:
[ops] start talking about comparison operators
18:40
18:40 ShaneC left 18:48 Patterner left 18:50 circuitbreaker left 18:51 cotto_w0rk joined, cotto_work left 19:00 Psyche^ joined, Psyche^ is now known as Patterner
jnthn #rs time 19:00
19:12 smash_ joined
smash_ hello everyone 19:12
moritz_ hi
masak hi 19:14
19:15 ethel joined 19:20 cognominal left 19:24 cognominal joined 19:27 rv2733 joined, jaldhar_ left
dalek ok: fb682c4 | masak++ | src/subtypes.pod:
[subtypes.pod] added poker hand example
19:27
19:29 jaldhar_ joined 19:32 Casan joined
Casan 'perl6: say cheers!;' 19:32
moritz_ perl6: say 'cheers!'
p6eval elf 30618, pugs, rakudo ed2409: OUTPUT«cheers!␤» 19:33
Casan merci
moritz_ de rian 19:36
erm
de rien
Casan nice.
I've been off the channel for a while @other_work. but still reading every blog post there is. 19:37
19:40 kaare_ joined 19:42 kaare_ left
moritz_ nice :-) 19:43
19:43 jaldhar_ left
Casan thought of any real world use cases for classify yet? 19:44
moritz_ lots of good comments on that blog :-) 19:45
10, in fact
Casan ohh good, lemme just get uptodate on that too
takadonet moritz_: classify will be a useful method
moritz_ a very real-life one contained a link to a page which a list of authors, grouped by author... 19:46
and each part of the list had a heading with the first letter of the authors in that list
Casan and judged by the comments, people are using perl6 in their daily projects already. nice. 19:51
moritz_ I can't really read that from the comments 19:52
19:53 takadonet left 19:56 meppl left
Casan the comment by Sam on Set::Relation gave me the impression, but maybe its just wishful reading on my part. 19:56
ahh he was referring to the perl5 counterpart 19:57
moritz_ yes
Casan I was wondering if anyone have given thoughts on plack and rakudo? 19:59
moritz_ not really... what does it take to implement a Plack interface? 20:00
reading from STDIN? signals? sockets?
Casan good question. I'm reading on plackperl.org now 20:01
20:02 Su-Shee left, Arroz_ is now known as saaki
moritz_ seems like it needs both a server side adaption and a client 20:05
20:06 ash__ joined
moritz_ en.wikipedia.org/wiki/Black_Perl wow, didn't know about that 20:08
diakopter imho that's misconstrued/misconstruable 20:09
TimToady funny thing is, I'm not allowed to just go in and say "I wrote it". In a sense everything on wikipedia has to be hearsay. :) 20:12
moritz_ TimToady: did you? :-) 20:13
diakopter finds the link for that irclog line
TimToady I've told any number of people already, but it's the April Fool's joke that lives on and on... 20:14
[Coke] ... i wonder if we can get a list of everything we want verified in wikipedia and get an interview at yapc or oscon to just say "yes, uh-huh, yes, yup" 20:26
moritz_ just patched up the wiki page 20:27
with a link to the IRC logs
Tene [Coke]: Just make sure to publish it in dead-tree format, to satisfy wikipedia's fetish with wood and ink.
pmichaud spinclad: what do you want to know about closures?
20:28 Casan left, gpw left, ruoso left 20:29 gpw joined 20:32 Gruber is now known as Grrrr
colomon moritz_: bet that wiki patch is undone within the week. 20:33
diakopter yeah. it's not like he directly/explicitly affirmed it.
just somewhat ambiguously implied. 20:34
[Coke] here, let me try: 20:35
Larry, did you write the Black Perl poem?
(and thank you, btw, for your patient with the internets.) 20:36
20:36 patrickas joined
patrickas hello 20:37
TimToady
.oO("Tell us plainly, are you the Christ?" "I already told you, but you didn't listen.")
patrickas: sorry, that wasn't to you. :) 20:38
masak patrickas: hi! \o/
patrickas is flabergasted
PerlJam TimToady: Now there's some hubris! Implying that you're the Christ ... ;-) 20:39
masak patrickas: welcome to #perl6 :)
spinclad pmichaud: oh, let's see. 1) one way to handle lexicals (dating back to Algol 60) is with displays, and parrot's newclosure/find_lex seem somewhat off the mark for implementing that (more)
TimToady PerlJam: I was just too lazy to pick a better metaphor 20:40
diakopter lol.
patrickas now I have got to go read the irc log! I forgot what I wanted to ask anyway!
spinclad 2) i want to look under the hood at what parrot does there, and can you point me where to start looking (more)
patrickas maska thanks :) yes I wanted to ask you about proto 20:41
i mean masak
masak patrickas: how may I sir you, serve? 20:42
patrickas still shaken by TimToady 's revelation
masak er I mean
20:42 SmokeMachine left
masak :) 20:42
patrickas I wanted to use it to install some modules
masak patrickas: by they way, nice job on the logotypes!
patrickas: oh no... :)
patrickas well it was about time i tried using what have been working on all week :-P 20:43
masak fills up with trepidation :)
diakopter spinclad: 3) ?
patrickas but if I understand correctly what happened is that proto assumes it was used to install rakudo in ~/.perl6/parrot_install/bin/perl6 20:44
where as I had already installed rakudo and just wanted to install the modules
masak that should be possible.
just modify the config file. 20:45
patrickas so I need to edit the configuration file
yes
the point is, since proto is not mentioned at all in rakudo.org/how-to-get-rakudo 20:46
it seemed like a strange default... 20:47
PerlJam patrickas: why would proto be mentioned there?
patrickas I don't know why it would :-) 20:49
masak patrickas: the idea is that people who find proto first can just install a module, and Rakudo/Parrot would come tumbling in with it.
or something like that.
patrickas yea that's what confused me .. the assumption that people will find proto before rakudo 20:50
a bit like people who find cpan before perl
actually it confused me so much 20:51
that I did type "./proto install rakudo" like the page says while in my head i was typing "install proto into rakudo" or something
then I realized none of what I was doing made sense because I had rakudo already installed 20:52
PerlJam patrickas: so, you think proto's docs should change to reflect an already-installed-rakudo scenario and then, just in case, mention that you can also install rakudo via proto?
patrickas so i came here to tell you that the readme page confused this noob
EXACTLY
masak sounds like a good idea.
spinclad yes, 3), if my slow brain will get me there, if you could take time to talk through what you currently plan, what changes, and will it give us full proper-level sharing among related closures.
masak patrickas: would you be willing to make such a change? I'd be delighted. 20:53
patrickas since people who search for how to install rakudo will almost always land on rakudo.org/how-to-get-rakudo and later learn about proto after they have rakud already installed
masak indeed. 20:54
patrickas ok i'll do that.
masak \o/
colomon I tried to get proto to work with an already installed Rakudo a few days ago and failed miserably. 20:55
so I'd say (changes to readme)++ 20:56
patrickas Unfortunately this doesn't seem like one of those tasks I can write a perl script to automate it for me :-)
20:56 boigaz joined
masak a year ago, when I wrote proto, the problem was that rakudo could be built anywhere, and there was no install target. 20:56
colomon :)
patrickas ha! I knew there was a method to your madness ! 20:57
masak the easiest thing was just to install it locally.
patrickas :-)
masak nowadays, there's a default location for rakudo, so proto should probably have that as a default in proto too.
well, it was important for me to have something that worked 'out of the box'.
20:58 stephenlb joined
masak I didn't want people saying 'proto doesn't work' just because they had installed a module and they didn't have Rakudo. 20:58
patrickas heheh now you got people saying proto doesn't work cause they already had rakudo ... damned if you do ... 20:59
pmichaud spinclad: sorry, was afk for a bit
masak patrickas: yeah :) well, conditions change. 21:00
pmichaud spinclad: essentially, every Parrot Sub with lexicals has a LexInfo object associated with it
spinclad pmichaud: np, took me a while
pmichaud the LexInfo object identifies the names and register mappings for the lexicals declared in the sub 21:01
21:01 orafu left, orafu joined
pmichaud when a sub is invoked, a new context object is created that contains slots for the registers used by the sub 21:01
and if the sub has a LexInfo object, then a LexPad hash is created that maps lexical names to register slots 21:02
spinclad (map from names to accessors) just for this lexical level?
pmichaud yes, only for the lexicals defined in the sub
21:02 SmokeMachine joined
pmichaud the context is initialized with a pointer to the context of the outer scope 21:02
(called the "outer_ctx")
spinclad so you have a chain of them 21:03
pmichaud correct
and a lexical lookup involves following the chain of outer contexts until the lexical is found
spinclad (a classical display keeps the chain in an array, cloned and extended by an entry with each new closure) 21:04
diakopter (note: sprixel does the same thing, except there's more than slot to outer_ctx, one for each outer level (since that's known at compile time))
spinclad (so a lexical lookup is env[level][regno]) 21:05
diakopter oh, yes, that's analogous to how sprixel does it. sorry to butt in. 21:06
masak Yapsi too. and I'm sorry too. :)
pmichaud well, Parrot provides a way to look up the outer chain by level, but by default it just keeps the chain around 21:07
spinclad so, you walk two lists, a list of hashes (LexInfo s) and a list of contexts
pmichaud no
just a list of contexts
we don't ever walk the LexInfos 21:08
jnthn There's on LexPad per Hash
gah
per Context
pmichaud there's one LexPad per context
the LexInfos are simply used when creating the LexPad
spinclad oh, the context points to its LexInfo? that works too...
pmichaud no, the context points to its LexPad
LexInfos are basically schemas, they don't hold any values
there's one LexInfo per sub, one LexPad per sub invocation 21:09
spinclad sorry, where do you look up the name to see if its in this level?
pmichaud LexPad
the LexPad isa Hash
spinclad ok, that gets copied when creating the LexPad, gotcha 21:10
pmichaud anyway, what capture_lex does is to tell a sub "the next time you're invoked, use the current context as your outer_ctx"
patrickas masak: in the document the first commend mentioned in "./proto configure" is that obsolete too ? 21:11
pmichaud so, what normally happens is that an outer sub starts by calling capture_lex on all of its inner nested blocks, so that if any of them are invoked, they will use the current invocation of the outer sub as the outer context. 21:12
spinclad 'use _this_ context (passed now)' or 'find the current sub's current context then'? 21:13
pmichaud the current sub's context
the "current context" -- i.e., the one that we're currently in when capture_lex is called
masak patrickas: in which document? the README? 21:14
hm, it might be.
pmichaud It *used* to be that Parrot would perform checks at this point to verify that the :outer() flag on the inner block matched the sub of the current context. But those checks got removed, thankfully. 21:15
spinclad so does it squirrel the current context away now, or leave a note to get it from the 'current sub' later, on invocation? 21:16
(and is 'current sub' the static object, or the current invocation?) 21:17
pmichaud it sets the outer_ctx pointer in the sub object 21:18
rephrase
it sets the outer_ctx pointer in the sub object of the inner sub
*inner block
when that inner block is executed, it creates a new context, and sets the outer_ctx of the context to the outer_ctx of the sub
it's much easier if we give the subs names 21:19
so, let's call the outer sub A and the inner sub B
when A is invoked, it gets a new context
A then calls capture_lex on B, which sets the outer_ctx pointer of B to the current context (i.e., the one that is running A)
when B gets invoked, it gets a new context. That new context gets its outer_ctx pointer set to the same value as outer_ctx on B 21:20
if A exits before B is invokved, its context continues to live because B retains a pointer to it 21:21
spinclad when A is invoked, _the new closure_ gets a new context
pmichaud ? 21:22
I don't follow that.
I haven't covered cloning yet, no. 21:24
what needs to change in PCT is that whenever a PAST::Block is used as an rvalue, we need to have the option of cloning the returned sub
so, at the point where the Parrot sub gets used as an rvalue, we clone it first and then do capture_lex on the cloned sub 21:26
diakopter when would that option be used and when wouldn't it be
spinclad (i'm wondering if we should distinguish the static sub &A (with its LexInfo etc) and the closure !A (with its context) )
pmichaud spinclad: in that sense, "closure" and "context" seem synonymous with me. 21:27
spinclad ok
pmichaud but yes, we can speak of &A as the static sub, and !A as being a specific invocation of &A
diakopter: I generally don't want to clone a sub when it's going to be invoked immediately 21:28
spinclad and you can have multiple !A's active simultaneously
pmichaud so, we wouldn't clone the sub when it's in void context (because the clone will simply be discarded) or when it's going to be immediately executed 21:29
spinclad so one !A calls capture_lex on &B, which sets up a new !B with an outer_ctx pointer to !A 21:30
pmichaud no 21:31
contexts aren't created until a sub is invoked. (Arguably this is a parrot misdesign.)
so we don't get a new !B until &B is invoked
!A calls capture_lex on &B, which sets the outer_ctx property of &B to !A
diakopter perlesque's model is a tad different; a class exists for each block, and a new instance of that class is "new'd up" (as they say) upon declaration/appearance, taking the current context as its argument. there's no such thing as "cloning", then.
pmichaud then when &B is invoked, it creates a !B that has its outer_ctx initalized to the same value as &B's outer_ctx (i.e., !A) 21:32
so that !B has !A as its outer context.
so, here's an example 21:33
sub A($a) { -> { say $a } }
the outer sub is &A, the pointer block is &B
spinclad then... two !A's can return &B's, except they are the same, because they aren't !B's yet... 21:34
pmichaud spinclad: yes, that's PCT's current issue. Here's how it gets fixed...
spinclad ok
pmichaud when we invoke &A, that creates a !A that has a $a slot in its LexPad with the current value of $a
the inner block is being used as an rvalue (it's being returned), so we first clone &B and then perform capture_lex on the cloned &B. This cloned &B gets returned to &A's caller 21:35
if &A gets invoked a second time, we get a new !A with a new $a. But this doesn't affect the cloned &B, which still has the first !A as its outer_ctx 21:36
so when the cloned &B is invoked, it still sees the original !A as its outer context 21:37
spinclad good, !A is bound into the !B at the right time (creation, not invocation) 21:38
(creation of !B)
if i understand you 21:39
pmichaud close
!A is bound into the cloned &B
and the !B is created from the cloned &B
so one can think of cloning &B as "creating a closure that capture's the current outer context" 21:40
and invoking &B then simply creates a !B context that has !A as its outer context
note that we really can't create a context for &B at the time it's cloned, because contexts are per-invocation 21:41
21:41 wknight8111 joined
[Coke] w/in 6 21:41
masak hugs [Coke], good irssi user :)
pmichaud in particular, if I have my $x = A(4); it's perfectly valid for me to call $x() multiple times -- each call will need its own context
diakopter [Coke]: Esc, 6 doesn't work? it's what I use.
[Coke] diakopter++ you just saved me a ton of typing. 21:42
jnthn Oh wow, I've been using Alt + 6 for years.
pmichaud in my irssi client, Alt+6 works just fine
jnthn TMTOWTCW.
diakopter didn't know about Alt+6; seems a little more efficient than Esc,6 21:43
spinclad right. let's call #B the clone, now pointing to !A, and invocations of #B will be !B's.
pmichaud yes. 21:44
and another invocation of &A will result in a new &B clone
Tene Oh, people do that because they don't know about the hotkey? I always thought people did that out of preference.
pmichaud and that &B clone will have the new invocation of &A
diakopter hotkey*s*
spinclad this sounds good. each #B knows !A, and each !B knows its params and locals.
21:45 masak left
pmichaud correct. 21:45
anyway, PCT can almost handle all of this already
diakopter curious: does this require a parrot change to make work?
Tene [Coke]: run /bind with no args to get a list of current bindings. 21:46
pmichaud diakopter: Until this morning I was worried that it did need a change, because I was remembering the old capture_lex semantics
but apparently when I "fixed" lexicals in 2008, I turned off the extra outer-scope checking that would cause all sorts of problems
so it's a win :-)
diakopter ftW 21:47
spinclad let me give a deferred \o/ , and a present happy.
diakopter pmichaud: did you see perlesque passes (a strongly-typed edition of) man_or_boy.t (and speedily)(, even up to x=24)? 21:48
21:49 SmokeMachine left
spinclad oh! where is #B storing !A then? ??in the outer-scope pointer? isn't that part of the static &B?? 21:50
or is that already dynamic since 2008? 21:51
(/me still confused)
(dynamic and per-instance)... 21:52
(per-clone)...
21:53 jotr is now known as jotr^afk
pmichaud #B is a clone of &B 21:53
so it has its own outer_ctx pointer
diakopter: no, I didn't see that. congrats!
spinclad ok, outer_ctx is a field of #B, not of &B, good. 21:54
pmichaud well, it's a field of &B also, it's just that we end up setting it on both :-) 21:55
we set it on &B at the beginning of &A, and then we set it on #B at the point where &B is being used as an rvalue
21:55 bubaflub left
pmichaud (i.e., we clone &B and capture_lex it) 21:56
spinclad ok, happy again then. no more questions, your honor. thank you for the explanation! 21:58
diakopter bailiff, you may escort the witness back to his cell 21:59
Tene pmichaud: so what work remains to be done, specifically?
pmichaud the code in PAST::Compiler.pir (line 985) has to be refactored to allow the possibility of cloning a sub before it's capture_lex'd 22:00
but this gets tricky because the register that holds the sub is currently a Parrot .const, and you can't clone in that case
i.e., we'd need a new register
so, a fair bit of register management in that code needs a bit of a refactor 22:01
nothing too difficult for someone already familiar with the code :-) 22:02
but after that's fixed, then nqp-rx has to be reworked to take advantage of it
(so that we can avoid a parrot deprecation, too)
spinclad (i don't quite see the need to set !A in &B at A's start, could you not set it directly in #B when it's created (at rvalue time)?) but one thing at a time 22:03
pmichaud you could, but we have the case of
sub A($a) { say $a; our sub B() { say $a; }; say 'done with A'; }; A(4); B();
where B isn't used/returned as an rvalue
alas, I have to leave "right now" for family dinner. I'll be back in 2 hrs 22:04
spinclad aye. i think i could find an rvalue there too, but later. dinner here too. 22:05
22:09 iblechbot left 22:10 \\shade\\ joined 22:12 Guest25967 left
spinclad or else that it's fundamentally incoherent... A(4); A(5); B(); there isn't a sensible channel from the sub B value inside A to the B() in the outer scope. i would complain back to the spec, here. 22:13
afk & # for real now! 22:14
diakopter std: our sub blue() { our sub blue() } } 22:16
p6eval std 30618: OUTPUT«===SORRY!===␤Illegal redeclaration of routine 'GLOBAL::<&blue>' (from line 1) at /tmp/aK5Ob9q3r1 line 1:␤------> our sub blue() { our sub blue⏏() } }␤Missing block at /tmp/aK5Ob9q3r1 line 1:␤------> our sub blue() { our sub blue()
..⏏[3…
diakopter rakudo: our sub blue() { our sub blue() } }
p6eval rakudo ed2409: OUTPUT«Malformed our at line 11, near "sub blue()"␤current instr.: 'perl6;HLL;Grammar;panic' pc 501 (ext/nqp-rx/src/stage0/HLL-s0.pir:327)␤»
diakopter rakudo: our sub blue() { our sub blue() { } }
p6eval rakudo ed2409: ( no output )
diakopter std: our sub blue() { our sub blue() { } } 22:17
p6eval std 30618: OUTPUT«===SORRY!===␤Illegal redeclaration of routine 'GLOBAL::<&blue>' (from line 1) at /tmp/Zdp5HETcNl line 1:␤------> our sub blue() { our sub blue⏏() { } }␤Check failed␤FAILED 00:01 111m␤»
22:17 hatseflats left, pmichaud left, pugssvn left, hugme left, PerlJam left, boigaz left, dalek left, Juerd left, dukeleto left 22:18 \\shade\\ left
ash__ so... in pmichaud's example above, calling &A twice would result in an error the second call? 22:19
22:19 \\shade\\ joined
diakopter rakudo: sub A($a) { say $a; our sub B() { say $a; }; say 'done with A'; }; A(4); B(); 22:20
p6eval rakudo ed2409: OUTPUT«Symbol '$a' not predeclared in B␤current instr.: 'perl6;PCT;HLLCompiler;panic' pc 152 (compilers/pct/src/PCT/HLLCompiler.pir:108)␤»
ash__ alpha: sub A($a) { say $a; our sub B() { say $a; }; say 'done with A'; }; A(4); B(); 22:21
p6eval alpha 30e0ed: OUTPUT«4␤done with A␤4␤»
diakopter alpha: sub A($a) { say $a; our sub B() { say $a; }; say 'done with A'; }; B();
p6eval alpha 30e0ed: OUTPUT«Null PMC access in type()␤in Main (file <unknown>, line <unknown>)␤»
ash__ alpha: our &B; sub A($a) { say $a; &B = sub () { say $a; }; say 'done with A'; }; A(4); B(); 22:22
p6eval alpha 30e0ed: OUTPUT«4␤done with A␤4␤»
22:25 patrickas left
ash__ so... is it a safe assumption that the only time you have to create a closure is when you use a function as an rvalue? 22:26
22:27 \\shade\\ left
diakopter ash__: or declaring a named sub in a routine that has its own context enclosed by another function 22:31
ash__ are there any others maybe more edge cases? 22:33
diakopter pugs: sub a($d) { sub b($e) { say $e }; return sub($e) { b($e + $e) } }; my $g = a(4); $g(5);
p6eval pugs: OUTPUT«10␤»
diakopter oops 22:34
pugs: sub a($d) { sub b($e) { say $d + $e }; return sub($e) { b($e + $e) } }; my $g = a(4); $g(5);
p6eval pugs: OUTPUT«10␤»
diakopter that's incorrect
22:35 KyleHa joined
diakopter rakudo: sub a($d) { sub b($e) { say $d + $e }; return sub($e) { b($e + $e) } }; my $g = a(4); $g(5); 22:35
p6eval rakudo ed2409: OUTPUT«Unable to parse blockoid, couldn't find final '}' at line 11␤current instr.: 'perl6;Regex;Cursor;FAILGOAL' pc 1696 (ext/nqp-rx/src/stage0/Regex-s0.pir:932)␤»
ash__ alpha: sub a($d) { sub b($e) { say $d + $e }; return sub ($e) { b($e + $e) } }; my $g = a(4); $g(5); 22:36
KyleHa Problem with pugs svn right now?
diakopter that's... I don't know.
p6eval alpha 30e0ed: OUTPUT«14␤»
ash__ your missing a space
rakudo: sub a($d) { sub b($e) { say $d + $e }; return sub ($e) { b($e + $e) } }; my $g = a(4); $g(5);
p6eval rakudo ed2409: OUTPUT«14␤»
diakopter that's correct
pugsbug there
ash__ you had a sub( which it was confused by
diakopter ah
KyleHa: yeah it looks like feather got kilt
KyleHa Eta on return? 22:37
diakopter no idea... no way to contact Juerd except irc
and he uses irc through feather.
KyleHa Heh. Ok, thanks! 22:38
22:38 molaf left, ash__ left, KyleHa left 22:42 clintongormley left 22:44 bakedb__ left
lisppaste3 BrowserUk annotated #99095 "POE does not implement a scheduler!" at paste.lisp.org/display/99095#1 22:48
22:57 smash_ left, Psyche^ joined 22:58 k23z__ left 23:00 ethel left 23:01 Patterner left, Psyche^ is now known as Patterner 23:11 circuitbreaker joined
diakopter perlesque: sub a(int $d --> Callable[:(int --> int)]) { sub b(int $e --> int) { say($d + $e); return 1 }; return sub (int $e --> int) { b($e + $e); return 1 } }; my $g = a(4); $g(5); 23:12
p6eval perlesque: OUTPUT«14␤»
diakopter perlesquel: .
p6eval perlesquel: OUTPUT«14␤real 0.05␤user 0.05␤sys 0.00␤»
23:15 ruoso joined
spinclad rakudo: for ^4 -> $a { our sub blue() { $a; }; }; say blue; 23:17
p6eval rakudo ed2409: OUTPUT«Symbol '$a' not predeclared in blue␤current instr.: 'perl6;PCT;HLLCompiler;panic' pc 152 (compilers/pct/src/PCT/HLLCompiler.pir:108)␤»
spinclad rakudo: sub A($a) { our sub B() { $a; }; }; for ^4 { A($_); }; say B; 23:18
p6eval rakudo ed2409: OUTPUT«Symbol '$a' not predeclared in B␤current instr.: 'perl6;PCT;HLLCompiler;panic' pc 152 (compilers/pct/src/PCT/HLLCompiler.pir:108)␤»
spinclad phenny: tell ash__ i can argue that whenever you use a function you use it as a rvalue, so create a closure. 23:20
phenny spinclad: I'll pass that on when ash__ is around.
spinclad phenny: tell ash__ (even if thrown away in sink context) ... but pmichaud seemed to have a different point of view on #rs. 23:26
phenny spinclad: I'll pass that on when ash__ is around.
TimToady BTW, ALT+6 works on firefox tabs too, at least on my machine 23:54
well, you have to have at least 6 tabs for that particular one... 23:55
jnthn Hmm...doesn't on mine. That's too bad. 23:56
jnthn would kinda like that.
sorear jnthn: Eventually, once we have metaclass compatibility, we're going to need a bit more magic - you need to rebuild LTM automata at class compose time 23:57
diakopter jnthn: Ctrl-6 23:59