»ö« Welcome to Perl 6! | perl6.org/ | evalbot usage: 'perl6: say 3;' or rakudo:, niecza:, std:, or /msg camelia perl6: ... | irclog: irc.perl6.org | UTF-8 is our friend!
Set by sorear on 25 June 2013.
00:00 Ben_Goldberg left, BenGoldberg joined 00:03 rmgk left 00:04 eternaleye left 00:05 rmgk joined 00:06 eternaleye joined 00:21 vti left 00:26 KCL joined 00:28 aborazmeh left 00:29 KCL_ left 00:36 Ben_Goldberg joined, Alina-malina left 00:39 BenGoldberg left
retupmoca Could I get a couple of people to test the latest Compress::Zlib::Raw and Compress::Zlib? 00:40
I made some changes that should make it work with windows (and maybe 32bit machines), but I want to make sure I didn't break it for anyone else
00:47 konsolebox joined 01:09 denis_boyun_ left 01:13 rurban joined
raydiak retupmoca: compress::zlib::raw seems to have an undeclared dependancy on Inline 01:13
other than that, both install fine on x64 linux here, pass all tests 01:14
01:19 konsolebox left 01:22 konsolebox joined
retupmoca \o/ 01:30
(Inline is in the META.info, I'd guess panda just hasn't updated yet)
raydiak: Thanks :)
raydiak retupmoca: you're welcome :) 01:34
01:36 BenGoldberg_ joined
raydiak .tell FROGGS sent you a PR for Inline::C, s:g/path/IO/ 01:36
yoleaux raydiak: I'll pass your message to FROGGS.
raydiak .tell tadzik sent you a PR for panda, s:g/path/IO/ 01:37
yoleaux raydiak: I'll pass your message to tadzik.
01:39 Ben_Goldberg left 02:07 gfldex left 02:08 Akagi201 joined 02:12 Akagi201 left
raydiak class Foo { has Bar $.bar }; class Bar { has ($.a, $.b) } I wish there was a special syntax for Foo.new(bar => Bar.new: :a(1), :b(2)) without the explicit Bar.new part 02:20
class Foo { has Bar $.bar = !build_bar(...) }; class Bar { has ($.a, $.b) } or a way to pass that "..." into !build_bar from Foo.new? 02:21
(or, well, I guess method !build_bar would have to be my sub build_bar, but that's beside the point) 02:23
also, a way to do these things which also works with properties which are arrays or hashes of such "child objects" 02:26
raydiak keeps hoping someone will say "you've been able to do that for years, here's how you say it..." even though we're in the #perl6 dead time :) 02:27
02:29 BenGoldberg joined 02:30 Akagi201 joined, BenGoldberg_ left 02:36 Ben_Goldberg joined, aborazmeh joined 02:40 BenGoldberg left 02:42 Ben_Goldberg left, aborazmeh left 02:43 BenGoldberg joined
raydiak hm...wonder if you could accomplish something like that by writing an 'is init' trait which calls .new when it sees a Capture 02:49
(attribute trait, not class trait)
well, or either I guess...but enough of the talking to myself in public for now 02:50
02:58 aborazmeh joined
ugexe im trying to assign roles at runtime and am having trouble getting the stringified role names to behave as their role object. Is my syntax off, or can I not assign roles/attributes inside loops? 03:01
m: role R1 { sub a {1} }; role R0 { submethod BUILD( ) { for <R1> -> $role { require ::($role); also does ::($role) } } }; R0.does('a');
camelia rakudo-moar 4a9eba: OUTPUT«===SORRY!=== Error while compiling /tmp/2WLzXJYK4T␤Cannot type check against type variable ($role)␤at /tmp/2WLzXJYK4T:1␤------> ␤»
03:03 eternaleye left 03:04 eternaleye joined 03:16 noganex_ joined 03:17 aborazmeh left 03:19 noganex left 03:22 aborazmeh joined 03:27 aborazmeh left
raydiak m: role R1 { method a {1} }; role R0 { submethod BUILD( ) { for <R1> -> $role { self does ::($role) } } }; say R0.new.a; # this would work 03:30
camelia rakudo-moar 4a9eba: OUTPUT«1␤»
raydiak I don't think you can use also at runtime, nor use does to modify an entire role...but you can use does on each object you construct at runtime 03:32
I suspect modifying the role itself like that at runtime would have to be done via metastuff that I don't know much about tbh 03:33
03:36 Ben_Goldberg joined 03:39 rurban left 03:40 BenGoldberg left
ugexe raydiak++ 03:49
03:54 konsolebox left
hoelzro m: my $m = 'trim'; say 'foo '.$m() 04:07
camelia rakudo-moar 4a9eba: OUTPUT«Cannot find method 'postcircumfix:<( )>'␤ in block <unit> at /tmp/FUqupQIqBy:1␤␤»
hoelzro is that correct? or did something break?
raydiak m: my $m = 'trim'; say 'foo '."$m"() 04:08
camelia rakudo-moar 4a9eba: OUTPUT«foo␤»
raydiak iirc, the "" are supposed to be required
(?)
ah, github.com/perl6/roast/blob/master...n.t#L70-71 04:12
so .$m is for methodrefs, not symbolic method names 04:13
my $attr = 'afk'; self."$attr" = True; 04:18
04:26 aborazmeh joined 04:27 Ben_Goldberg left 04:33 eternaleye left 04:41 eternaleye joined, perturbation joined 04:45 telex left 04:46 telex joined
hoelzro ah, quotes 04:48
thanks raydiak
04:51 perturbation left 05:54 kurahaupo joined 06:03 bjz left, bjz joined 06:04 eternaleye left 06:06 aborazmeh left 06:12 eternaleye joined 06:25 Alina-malina joined
TimToady the parens are also required for the quote form of method call 06:25
m: my $attr = 'afk'; self."$attr" = True; 06:26
camelia rakudo-moar 4a9eba: OUTPUT«===SORRY!===␤'self' used where no object is available␤at /tmp/VLnYbpfAvW:1␤------> my $attr = 'afk'; ⏏self."$attr" = True;␤Quoted method name requires parenthesized arguments. If you meant to concatenate two s…»
TimToady otherwise it's too ambiguous with a P5 concat call 06:27
06:32 kaare_ joined
raydiak ah, forgot all about that; thanks 06:40
self.afk = True & False; 06:42
06:51 anaeem1_ joined 06:56 anaeem1_ left 07:04 eternaleye left 07:10 tinyblak joined 07:13 anaeem1_ joined, isacloud left 07:16 anaeem1_ left 07:19 isacloud joined 07:22 eternaleye joined 07:28 anaeem1_ joined 07:34 darutoko joined 07:39 Spot__ left 07:41 clkao left 07:49 bjz left 07:58 mr-foobar left 08:00 bjz joined 08:04 anaeem1_ left 08:05 anaeem1 joined 08:19 vti joined
raydiak g'night #perl6 08:21
08:21 bjz left, bjz_ joined 08:32 petercommand left 08:33 petercommand joined 08:34 petercommand left, petercommand joined 08:35 Isp-sec joined 08:36 FROGGS[mobile] joined
FROGGS[mobile] hoelzro: not only a argless return is allowed me thinks 08:38
sub foo (---> 42) { 123 } # returns 42 08:40
08:40 petercommand left 08:41 petercommand joined
FROGGS[mobile] sub bar (---> 42) { return 123 } # returns 123 08:41
08:44 petercom1and joined, petercommand left, petercom1and is now known as petercommand
FROGGS[mobile] that was about github.com/perl6/specs/commit/caac...42e9a2be19 08:48
08:55 Mso150 left 08:56 Mso150 joined 08:57 spider-mario joined 08:58 robinsmidsrod left 09:00 robinsmidsrod joined
FROGGS[mobile] m: sub foo (---> 42) { 123 }; say foo 09:00
camelia rakudo-moar 4a9eba: OUTPUT«===SORRY!=== Error while compiling /tmp/eAXja4NufQ␤Malformed parameter␤at /tmp/eAXja4NufQ:1␤------> sub foo (⏏---> 42) { 123 }; say foo␤ expecting any of:␤ statement list␤ prefix or term…»
FROGGS[mobile] did I typo it or is it really NYI? 09:01
that does not feel hard to do actually
m: sub foo returns 42 { 123 }; say foo 09:03
camelia rakudo-moar 4a9eba: OUTPUT«===SORRY!=== Error while compiling /tmp/sTxQ84OqZk␤Missing block␤at /tmp/sTxQ84OqZk:1␤------> sub foo returns ⏏42 { 123 }; say foo␤ expecting any of:␤ statement list␤ prefix or term␤ …»
FROGGS[mobile] m: sub foo () returns 42 { 123 }; say foo 09:04
camelia rakudo-moar 4a9eba: OUTPUT«===SORRY!=== Error while compiling /tmp/lJGgKfltRN␤Missing block␤at /tmp/lJGgKfltRN:1␤------> sub foo () returns ⏏42 { 123 }; say foo␤ expecting any of:␤ statement list␤ prefix or term␤ …»
FROGGS[mobile] I dont get it 09:05
09:09 Roonin joined, anaeem1 left 09:14 atroxaper joined 09:17 Ugator joined, anaeem1_ joined 09:23 salv0 left 09:24 Ugator left 09:28 FROGGS[mobile] left 09:29 anaeem1_ left, anaeem1 joined 09:30 anaeem1 left, anaeem1 joined 09:33 anaeem1 left, FROGGS[mobile] joined, anaeem1_ joined 09:35 rurban joined 09:37 gfldex joined 09:38 mvuets joined 09:39 salv0 joined 09:41 lue left 09:42 Ugator joined 09:46 lue joined 09:49 kurahaupo left 09:50 Ugator left 09:51 kurahaupo joined, Ugator joined 09:56 atroxaper left, atroxaper joined 09:57 mr-foobar joined, Ugator left 10:02 anaeem1_ left, anaeem1_ joined 10:07 anaeem1_ left
masak morning, #perl6 10:13
well. antenoon, really. 10:14
masak discovers japhb_++'s gist.github.com/japhb/92442a22962c5156e102 in the backlog 10:15
japhb_: I like that you're thinking out loud in code. that's exactly what we need. 10:16
10:16 mvuets left
masak japhb_: why `¤=` ? 10:18
10:21 mvuets joined 10:25 sqirrel joined
masak japhb_: using parameter typing to decide the grammatical category of incoming ASTs seems, hm, both right and wrong somehow. 10:26
masak realizes that he should probably think some on the connection between grammatical category and Qtree types 10:27
walk & 10:28
10:31 sunnavy left 10:35 sunnavy joined 10:38 mvuets left 10:40 sunnavy left 10:42 mvuets joined 10:52 Ugator joined 11:01 carlin joined 11:16 clkao joined, pyrimidine left 11:18 anaeem1_ joined
carlin if you qqx a binary in the current directory, qqx doesn't return it's output, is this expected? 11:27
example: gist.github.com/carbin/b39890c910d9bd0fc1ad
FROGGS[mobile] carlin: what about ./test? 11:30
carlin FROGGS[mobile]: ./test works
11:31 sunnavy joined
FROGGS[mobile] can you run test in your shell? 11:31
carlin oh duh 11:32
it's because there's a /usr/bin/test
FROGGS[mobile] :o)
that's what I was thinking
11:35 Ugator left 11:38 kurahaupo left 11:40 Mso150 left 11:45 Spot__ joined, denis_boyun_ joined 11:46 robinsmidsrod left, robinsmidsrod joined 11:47 isacloud left 12:19 ptc_p6 joined 12:26 KCL_ joined 12:29 KCL left 12:30 rindolf joined 12:38 Spot__ left, clkao left 12:48 zakharyas joined, brrt joined
brrt \o 12:49
i see a failing spectest: S02-magicals/DISTRO.rakudo.moar
on fedora 21 because ! $*DISTRO.name eq any($*PERL.DISTROnames) 12:50
because $*PERL.DISTROnames = "macosx", "linux", "freesbd", "mswin32", "openbsd", "netbsd" 12:51
and $*DISTRO.name = 'fedora' 12:52
xiaomiao that is quite amazing :D
12:53 anaeem1_ left
brrt and the same thing seems to happen with $*KERNEL.name, which is unknown 12:56
so it seems somehow that our runtime source of information has changed its API
brrt lunch &
(nb): fedora 21 beta
maybe a fedora bug :-)
12:58 Ugator joined 12:59 hugme left 13:00 hugme joined, ChanServ sets mode: +v hugme, brrt left 13:02 dalek left 13:03 dalek joined, ChanServ sets mode: +v dalek, psch joined, sqirrel left
psch hi #perl6 13:04
13:04 dalek left, Util left, masak left 13:05 anaeem1 joined, denis_boyun_ left, masak joined, masak is now known as Guest56722 13:06 PerlJam left, PerlJam joined 13:09 Util joined 13:13 prime joined, prime left, prime joined 13:16 Guest56722 is now known as masak_grr 13:18 PZt left 13:21 ptc_p6 left 13:23 robinsmidsrod left, atroxaper left
sergot hi o/ 13:23
psch sergot o/ 13:24
13:25 robinsmidsrod joined
masak_grr cześć, sergot 13:33
vendethiel why the grr? 13:34
masak_grr -NickServ(NickServ@services.)- You have 30 seconds to identify to your nickname before it is changed. 13:35
-NickServ(NickServ@services.)- You failed to identify in time for the nickname masak 13:36
this happens every time there's storm on the IRC.
psch masak_grr: you can "set enforce off" to not have that 13:37
but you probably know that, seeing as enforce off is default
you can also "release <nick> [password]" to release the enforcer, which is probably more useful 13:38
all of those are nickserv commands 13:39
although the help on "release" is ambiguous, the example has the order of parameters differently than the text :/
oh, no, it doesn't, i'm just bad at reading right now 13:40
vendethiel yeah, just /ns release (and /ns ghost) are very useful
13:52 clkao_ joined, clkao_ is now known as clkao 13:58 dalek joined, ChanServ sets mode: +v dalek
moritz I've now started dalek in a while true; do dalek; sleep 30; done loop 13:59
dalek kudo/nom: 8a9791d | moritz++ | Configure.pl:
Configure: warning on missing --prefix option

requested for star in rakudo/star#40, and added here for consistency
moritz that should make it a bit more resilient
dalek : c49643f | moritz++ | misc/dalek-start.txt:
document loop in dalek start guide
14:00
14:01 isacloud joined
nine m: @foo; warn @foo.elems; 14:02
camelia rakudo-moar 4a9eba: OUTPUT«===SORRY!=== Error while compiling /tmp/K3npUwfo2v␤Variable '@foo' is not declared␤at /tmp/K3npUwfo2v:1␤------> @foo⏏; warn @foo.elems;␤ expecting any of:␤ postfix␤»
nine m: my @foo; warn @foo.elems;
camelia rakudo-moar 4a9eba: OUTPUT«Warning in block <unit> at /tmp/VKbfnGMLVY:1␤␤»
14:03 M_o_C joined
nine Why does this ^^ say "Warning in block" and not "0 in block"? 14:03
m: my @foo = 1; warn @fool.elems;
camelia rakudo-moar 4a9eba: OUTPUT«===SORRY!=== Error while compiling /tmp/rc7NA7jXEZ␤Variable '@fool' is not declared. Did you mean '@foo'?␤at /tmp/rc7NA7jXEZ:1␤------> my @foo = 1; warn @fool.elems⏏;␤ expecting any of:␤ method arg…»
nine m: my @foo = 1; warn @foo.elems;
camelia rakudo-moar 4a9eba: OUTPUT«1 in block <unit> at /tmp/rpDh_Q6hZ5:1␤␤»
moritz m: say (my @foo).elems.perl 14:04
camelia rakudo-moar 4a9eba: OUTPUT«0␤»
moritz nine: probably a semi-predicate issue
nine: that is, a forgotten "defined" 14:05
14:05 spider-mario left
moritz huh, at least not in the setting 14:05
psch m: warn Mu
camelia rakudo-moar 4a9eba: OUTPUT«use of uninitialized value <element> of type Mu in string context in block <unit> at /tmp/OdmJoJfP4m:1␤␤Warning in block <unit> at /tmp/OdmJoJfP4m:1␤␤»
psch m: warn Nil
moritz my $ex := nqp::newexception();
nqp::setmessage($ex, nqp::unbox_s(@msg.join));
camelia rakudo-moar 4a9eba: OUTPUT«Warning in block <unit> at /tmp/ueSHUTinan:1␤␤»
moritz src/core/Exception.pm: nqp::printfh($err, $msg ?? "$msg" !! "Warning"); 14:06
nine m: warn 0
camelia rakudo-moar 4a9eba: OUTPUT«Warning in block <unit> at /tmp/rFzLEVHhv1:1␤␤»
14:06 rurban left 14:07 lumimies joined, M_o_C left
moritz spectests a partial fix 14:08
nine Using $msg.defined instead of $msg in that line fixes the problem for me 14:09
moritz but that will given an empty warning for warn() 14:10
14:11 M_o_C joined 14:12 Spot__ joined 14:13 M_o_C left
nine So ($msg.defined and $msg ne '')? 14:13
14:13 M_o_C joined
moritz I'm trying $msg.chars 14:16
... assuming I manage to work around this segfault
nine m: Str.chars 14:17
camelia rakudo-moar 4a9eba: OUTPUT«use of uninitialized value of type Str in string context in block <unit> at /tmp/zNuDbFg6nG:1␤␤»
nine I'm not sure if you can get by without a defined check
moritz m: say nqp::p6box_s(Str).perl
camelia rakudo-moar 4a9eba: OUTPUT«Cannot unbox a type object␤ in block <unit> at /tmp/v3DMeBK5AY:1␤␤»
moritz nine: my $msg = nqp::p6box_s(nqp::getmessage($ex)) -- how can that ever be not defined?
nine moritz: I was just thinking about warn(Any) for example. Haven't seen much about how warn is actually implemented 14:18
moritz nine: the warning comes from the warn() function, which uses .join on its argument list
14:23 atroxaper joined 14:24 telex left 14:26 telex joined
moritz I've got two failing tests, S02-magicals/{DISTRO,KERNEL}.rakudo.moar 14:27
now cross-checking without my patches if they are related
fails without them too 14:28
psch moritz: irclog.perlgeek.de/perl6/2014-12-04#i_9756165 14:29
tests probably haven't been updated to reflect that
14:30 atroxaper left, Mouq joined
dalek kudo/nom: dfcf9fc | moritz++ | src/core/Exception.pm:
Preserve warning message "0"
14:30
moritz ok, those tests don't seem to make much sense anymore 14:33
m: ($*PERL.DISTROnames 14:34
camelia rakudo-moar 8a9791: OUTPUT«===SORRY!=== Error while compiling /tmp/AiFGQ4lGt0␤Unable to parse expression in parenthesized expression; couldn't find final ')' ␤at /tmp/AiFGQ4lGt0:1␤------> ($*PERL.DISTROnames⏏<EOL>␤ expecting any of:…»
moritz m: say $*PERL.DISTROnames
camelia rakudo-moar 8a9791: OUTPUT«macosx linux freebsd mswin32 openbsd netbsd␤»
moritz m: say $*DISTRO.name
camelia rakudo-moar 8a9791: OUTPUT«opensuse␤»
psch irclog.perlgeek.de/perl6/2014-12-02#i_9749256 also related i'd say
moritz m: say $*KERNEL 14:35
camelia rakudo-moar 8a9791: OUTPUT«unknown␤»
moritz eeks
dalek ast: d6372ca | moritz++ | S02-magicals/DISTRO.t:
$*DISTRO.name now can have a many more values than before

so do not test if it is in a pre-defined list anymore
14:36
hoelzro FROGGS[mobile]: from the way the specs read, I think argless return is the only form of return allowed when using a determinate value as the return 14:38
"An explicit return statement is allowed, but only in argumentless form"
14:39 ssqq joined 14:41 zakharyas left
ssqq perl6/nqp.git /docs/ops.markdown line: 1828, ## the op of start a timer is blank? 14:41
nine moritz: thanks for fixing this :) 14:44
14:50 masak_grr is now known as masak
ssqq all op is *op-name(args ...), beside this op, only have argument, If it has some special use? 14:51
psch ssqq: no, it's an error in the docs i think, considering calls to "nqp::timer" exist in the code base 14:53
i think ops.markdown is at least partially generated? maybe something went wrong there
14:54 atroxaper joined, vti left
ssqq psch: thanks your kind reply, I think so. this op name should is *timer* 14:56
14:57 ssqq left
dalek kudo/rt-123116: 8c242c0 | (Rob Hoelz)++ | src/Perl6/Grammar.nqp:
Parse subsignatures

See SO6/Closure parameters. For example:
   sub limited_grep(Int $count, &block:(Dog)), *@list) { ... }
These currently sort-of parse, but :(Dog) is considered a *trait*, and that doesn't sit right with something in the compiler, so it results in this error:
   Cannot invoke this object (REPR: P6opaque, cs = 0)
15:06
kudo/rt-123116: 1926e14 | (Rob Hoelz)++ | src/Perl6/Actions.nqp:
Don't include subsignature in lexical name

See previous commit for a little more detail. `&block:(Dog)` was getting inserted into the pad as `&block:(Dog)` rather than just
  `&block`
15:07 virtualsue joined
masak ooh, that's one of my tickets! :D 15:11
hoelzro masak: yessir 15:12
I've felt its potent sting
and am doing what I can to squash it =)
my current problem is that &block is being registered in the pad, but now I'm getting complaints about not being able to bind to non-existing object lexical `&block:(Dog)` 15:13
and I'm not sure how the bytecode to check for that full name, rather than the name sans subsignature, is being searched for =/ 15:14
15:14 Ugator left
hoelzro also, it seems a fair amount of code uses sub mysub(&block(Int, Str)) { ... }; is that technically correct? 15:15
at second glance, that looks like it should evaulate block(Int, Str) and use that result to establish a constraint on mysub's first param
15:25 pyrimidine joined
TimToady at one point we required a : because of the ambiguity with sublists of parameters, but we already have a whitespace dep with @foo[3,3] vs @foo [$x,$y,$z], so having one for () is probably not terrible 15:26
15:26 skarn left
hoelzro TimToady: but it requires a whitespace, right? 15:28
or no?
masak I think TimToady was arguing for it making sense to require a whitespace. 15:32
hoelzro ah ha 15:33
I'll have to add that to my patch, then
hoelzro is trying to figure out how the heck bindlex_no '&testcode:(Int)', loc_6_obj is getting generated 15:34
masak adds TimToady's comment to the ticket 15:39
moritz hoelzro: grep the --target=ast output for it? 15:43
hoelzro haha
I've been pouring over the MBC dump and QASTCompilerMAST, and that did not occur to me
moritz++
moritz hoelzro: I hope it helps :-) 15:47
hoelzro it does! 15:48
I think I found it 15:55
jnthn evening, #perl6 16:00
dalek kudo/rt-123116: cfa8c67 | (Rob Hoelz)++ | src/Perl6/Actions.nqp:
Fix %*PARAM_INFO<variable_name> with subsignature

See previous commit's description, and the one before that.
Otherwise, `&block:(Dog)` is installed as `&block`, but binding code is still issued as `&block:(Dog)`
masak jnthn! \o/
hoelzro o/ jnthn
Mouq timotimo: Are you sure this does what you want? github.com/perl6/gtk-simple/commit/457871d1 16:02
16:03 rurban joined
hoelzro am I correct in thinking that &block:(Dog) and &block (Dog) are equivalent, but &block(Dog) evaluates block(Dog) and uses the result for a parameter constraint? 16:05
16:05 M_o_C left
jnthn hoelzro: I think &block (Dog) is probably senseless (though we steal the syntax for nativecall) 16:06
hoelzro jnthn: shouldn't the nativecall usage be &block:(Dog), then?
jnthn hoelzro: In that it would really mean &block.Capture, then try to bind it against (Dog)
hoelzro: Yes, it should.
hoelzro ah, ok 16:07
jnthn But that horse has kinda bolted into module land so...we should perhaps implement and support the proper way, but it'll be a long time until we can rip out the other one...
hoelzro =( 16:08
masak :/
hoelzro well, according to TimToady &block (Dog) is ok
I'm just wondering if &block(Dog) should be
I was thinking of creating a warning for it
masak m: sub foo(@a[1, 2, 3]) {}; say "alive" 16:09
camelia rakudo-moar dfcf9f: OUTPUT«alive␤»
hoelzro something like "did you mean &block:(Dog)?"
masak: I fixed RT#123116 in that branch, btw
synopsebot Link: rt.perl.org/rt3//Public/Bug/Displa...?id=123116
hoelzro only thing left is candidates with multis
(the first 9 tests in t/spec/S06-signature/closure-parameters.t pass)
jnthn Well, &block (Dog) can live in a sense 16:10
It works as long as we never binding native call signatures using the usual signature binder :)
16:11 zakharyas joined
hoelzro ah, ok 16:12
jnthn It's just a bit...inconsistent 16:15
A lot of the hold up is that I never figured out exactly that &block:(Dog) should compile into.
*exactly what
16:16 Ugator joined
moritz why would it be different from any other parameter with a subsignature? 16:17
jnthn moritz: Because :(...) is not a sub-signature.
hoelzro my branch to fix it passes; would anyone mind reviewing? github.com/rakudo/rakudo/compare/rt-123116
jnthn &block:(Dog) is more like Associative &block where .signature ~~ :(Dog) 16:18
Except that doesn't make the thing easily obtainable for introspection
masak "Associative"?
jnthn hoelzro: Fix *what* exactly?
Uh, shit, Callable!
hoelzro jnthn: RT #123116 16:19
synopsebot Link: rt.perl.org/rt3//Public/Bug/Displa...?id=123116
masak jnthn: *grin*
jnthn No, please do NOT put in a commit that makes them behave like subsignatures!
hoelzro ok
jnthn They aren't subsigs. If they were I'd have done a commit like this a copule of years ago. :)
hoelzro I'm very confused as to what :(...) means, I think
masak I'm glad we had this talk.
hoelzro indeed 16:20
jnthn hoelzro: Well, me too. I can think of several ways it could be.
I'd be happy enough if we initially compile it into a where clause
hoelzro I was going based on what I understood from the spec/roast/that RT ticket
jnthn Because that gets us the right semantics afaik
yeah, I'm just trying to find an exact spec ref on this 16:21
hoelzro I was looking at S06-signature/closure-parameters.t
jnthn I've long had it in my head as it meaning "the callable's signature should smartmatch against this one"
hoelzro and S06/Closure Parameters
16:21 virtualsue left
jnthn yes, it's in there 16:22
And it says what I remembered. :) 16:23
"When an argument is passed to a closure parameter that has this kind of signature, the argument must be a Code object with a compatible parameter list and return type." is the money shot.
hoelzro ok, herein lies my confusion: how is this different from subsignatures?
jnthn It doesn't precisely say how that is to be achieved, however.
hoelzro ahhhh
jnthn hoelzro: Because a subsignature is about unpacking
It means "take the passed argument and destructure it" 16:24
hoelzro I was hard pressed to find anything about subsignatures in the specs
oh, so it's a destructuring bind?
jnthn Subsignatures are, yes.
hoelzro is enlightened
ok, so I don't think my patch does that
it doesn't reference the subsignature code in Actions::param_var 16:25
jnthn m: sub foo(@a ($head, *@tail)) { say ::MY.pairs }; foo([1, 2]);
camelia rakudo-moar dfcf9f: OUTPUT«␤»
jnthn aww
m: sub foo(@a ($head, *@tail)) { say :@a, :$head, :@tail }; foo([1, 2]);
camelia rakudo-moar dfcf9f: OUTPUT«Unexpected named parameter 'a' passed␤ in sub say at src/gen/m-CORE.setting:16519␤ in sub foo at /tmp/_qHdkuj03o:1␤ in block <unit> at /tmp/_qHdkuj03o:1␤␤»
jnthn grr
m: sub foo(@a ($head, *@tail)) { say (:@a, :$head, :@tail) }; foo([1, 2]);
camelia rakudo-moar dfcf9f: OUTPUT«"a" => [1, 2] "head" => 1 "tail" => [2]␤»
jnthn hoelzro: No, but 16:26
':(' ~ ')' <subsignature=.signature>
iiuc means that the actions code will treat it as one?
hoelzro I don't *think* it does
but I not not certain
jnthn OK, so...what does it do with it?
hoelzro Actions?
jnthn Yes 16:27
hoelzro Actions, iirc, checks for $<signature>, which isn't present in my case
I also made it check for $<subsignature>, which it uses to generate lexicals with proper names
jnthn Then it drops the :(...) thing on the floor?
hoelzro yes 16:28
jnthn I think you're right by the way; the action method in question isn't the one I first though
OK, hmmm...
hoelzro crazily enough, though, the type checking in S06-signature/closure-parameters.t *passes* right now
jnthn I'm not sure parsing it and then silently ignoring it is entirely wise.
hoelzro oh, I agree; this patch is not complete
jnthn OK. 16:29
hoelzro for the time being, passing -> Str $ { ... } to testcode(&block:(Int)) fails
and I have no idea why
jnthn Is it failing to bind?
Or failing because it calls the closure it gets and *that* blows up?
hoelzro oh, it's *not* failing 16:30
wtf
the test that checks for that failure passes
jnthn Right, but
my sub testit (&testcode:(Int)) {testcode(12)}
It's the testcode(12) that blows up, I think
hoelzro oooooooh
jnthn Not the signature.
hoelzro that's it
derp 16:31
jnthn :)
hoelzro ok, well, then my next task is to add binding stuff, I guess
jnthn Yeah. I'm happy enough for it to be compiled as if a where cluase for now.
hoelzro jnthn: so, other than the fact that my impl isn't complete wrt type checking, is my patch ok?
jnthn We will want a way to introspect it later...
Well, it's not OK in that it calls it a subsignature, which is misleading.
hoelzro ok, I'll change that 16:32
jnthn and I'm really nervous about the substr usage.
hoelzro yes, I'm not too keen on that eitehr
*either
my grammar fu isn't good enough yet, I'm afraid
jnthn Does STD structure the prasing of these the way you are here, ooc?
hoelzro hmm, I hadn't checked
*haven't
jnthn Because it also needs the variable name
OK, let's try and follow that if we can
hoelzro ok
jnthn looking now... 16:33
...no google, not STD *symptons*...
hoelzro jnthn: do you have a recommendation of a better way to handle the stripping of :(...), other than the substr?
o_O
16:33 Ugator left
hoelzro I was thinking of doing $<closure_param>=[':(' ~ ')' <.signature>] 16:33
then it should work, I think, sans substr
jnthn In param_var in STD 16:34
# Is it a longname declaration?
|| <?{ $<sigil>.Str eq '&' }> <?ident> {}
<name=.sublongname>
I *think* that's it
hoelzro ah ha 16:35
should I emulate that, then?
jnthn Yes, it is
Yes, please.
hoelzro ok, will do
alright, my wife is trying to get me out of the house, so I'll look at that when I come back 16:36
thanks for the feedback/clarification jnthn
jnthn hoelzro: Welcome; thanks for working on it. 16:38
Have a nice out-of-house time.
16:41 Mouq left 16:48 Mouq joined 16:52 anaeem1 left 16:53 anaeem1_ joined 16:57 anaeem1_ left
dalek rl6-bench: 3c4b72a | (Geoffrey Broadwell)++ | / (3 files):
Change .path to .IO, .directory to .dirname, and cwd to CWD to catch up with accumulated IO deprecations
16:58
masak smls: how's it going with tomorrow's advent post? 17:00
also, who wants to do Tuesday? 17:01
17:02 brrt joined, Akagi201 left
japhb_ Apropos of nothing, I just want to state that implementing pen-and-paper RPG rules in code that doesn't make you immediately nauseous is a seriously brain-stretching exercise. 17:06
17:07 japhb_ is now known as japhb
japhb drops his tail 17:07
moritz japhb: it's probably a perfect topic for DDD
japhb What's the first D stand for there? 17:08
moritz "domain"
japhb: www.amazon.com/Domain-Driven-Design...0321125215 like this
masak: huh, isn't it sergot++'s turn tomorrow? 17:10
masak oh, indeed.
and we have Tuesday covered.
...who wants to do Wednesday? :) 17:11
japhb: I second moritz++' recommendation.
jnthn I can take a turn at some time soon 17:12
Did anybody do a MoarVM related one yet?
moritz japhb: no
masak ++jnthn
moritz erm, I meant jnthn
17:12 rurban_ joined
jnthn OK, I'll take 10th or 11th 17:14
masak learning from tinkering around with Qtrees: there are things out there that are neither terms, nor expressions, but kind of head off in another direction. yet they are very "structural" and expression-like.
moritz masak: example? 17:15
masak examples: parameter lists, traits.
they sort of occur in "restricted" parts of the language. that's also currently where unquotes have trouble going.
I don't want to call these restricted parts "slangs", because that's not what they are about. 17:16
moritz masak: yes, the term/operator distinction only makes sense where the OPP does its work
masak but they have slangoid characteristics.
17:17 lumimies left
masak it's like... "knowing what language you're parsing" is not just about Perl 6 vs grammars vs third-party-slang -- it's also about statement vs expression vs parameter list vs trait, etc. 17:17
moritz vs. regex vs. quote
which is what TimToady++ has been saying all along :-) 17:18
masak well, regex and quote I'm fine with considering actual slangs, just slangs with centralized backing :)
the same argument is harder to make for traits and param lists.
moritz there are a lot more of such mini slangs 17:19
moritz suddenly wonders if explicit declarations can go into signatures 17:20
m: sub f(sub g() { }) { }
camelia rakudo-moar dfcf9f: OUTPUT«===SORRY!=== Error while compiling /tmp/iKqx4YlpnI␤Invalid typename 'sub' in parameter declaration. Did you mean 'Sub'?␤at /tmp/iKqx4YlpnI:1␤------> sub f(sub⏏ g() { }) { }␤»
moritz good :-) 17:21
masak m: sub f($ where { f }) {}; f(42) 17:22
camelia rakudo-moar dfcf9f: OUTPUT«Too few positionals passed; expected 1 argument but got 0␤ in sub f at /tmp/LX1hgjsfou:1␤ in sub f at /tmp/LX1hgjsfou:1␤ in block <unit> at /tmp/LX1hgjsfou:1␤␤»
masak m: sub f($ where { f(5) }) {}; f(42)
camelia rakudo-moar dfcf9f: OUTPUT«Memory allocation failed; could not allocate 6992360 bytes␤»
masak moar has a big stack. 17:23
jnthn Well, it's more that it allocates chunks at system level and doles them out. 17:25
TimToady I was not advocating &block (Sig) 17:26
I was advocating @array (subarray) vs &block(Sig)
japhb comes back from a short wikiwalk on DDD. Thanks for the reminder, guys.
jnthn TimToady: I'd rather the current spec's colon-based discrimination over a whitespace one... 17:29
TimToady that is, I was advocating a whitespace *dependency* before (), because we already have such a dependency before [] or {} 17:30
17:31 M_o_C joined
TimToady so a signature attached to a callable must *not* have a whitespace 17:31
jnthn ah
So @foo(...) should be an error?
TimToady not unless @foo has a signature we can match :) 17:32
s/not /
jnthn I'd be happy with that, but would think &block(...) wants to be too, and &block:(...) is the right thing
TimToady people keep wanting to write it without the colon 17:33
jnthn Though I guess I could come around to seeing &block(...) as being a kind of pun on array shape declaraiton
TimToady and we don't require : on my @array[3,3]
that's what I'm sayin'
but we do need the : in an rvalue
or it's just a call
jnthn ah
17:34 brrt left
TimToady so yeah, I can argue it both ways, as usual 17:34
jnthn Same :)
jnthn argues that it's dinner time
bbiab
Mouq m: sub foo (&f ($n)) { say $n }(&say but role :: {method Capture { \(42) }})
camelia rakudo-moar dfcf9f: OUTPUT«42␤»
jnthn :D 17:35
Yes, you can control how something destructures like that. It's rather nice. :)
Really dinner. :) &
masak sergot: so, how's tomorrow's post going? :) 17:36
17:37 anaeem1 joined
moritz m: say Version.new('2014.10-65-gdfcf9fc') 17:38
camelia rakudo-moar dfcf9f: OUTPUT«v2014.10.65.gdfcf.9.fc␤»
moritz m: say "still there?"
camelia rakudo-moar dfcf9f: OUTPUT«still there?␤»
japhb Mouq: That's ... just ... huh. Well OK then. :-)
m: sub foo (&f ($n)) { f($n) }(&say but role :: {method Capture { \(42) }}) 17:39
camelia rakudo-moar dfcf9f: OUTPUT«42␤»
moritz I'll try to clean up that mess
japhb ++moritz
moritz Mouq: would you like to write an advent post about doc.perl6.org? 17:40
m: my $x = 42; say $x.VAR.scope 17:41
camelia rakudo-moar dfcf9f: OUTPUT«No such method 'scope' for invocant of type 'Int'␤ in block <unit> at /tmp/a1UOHEw0dJ:1␤␤»
moritz how do I get the Variable object from a variable? 17:42
(and don't tell me I have to write a trait for that...)
17:42 M_o_C left
japhb m: my $x = 42; say $x.VAR.WHAT 17:43
camelia rakudo-moar dfcf9f: OUTPUT«(Scalar)␤»
japhb m: my $x = 42; say $x.VAR.^methods 17:44
camelia rakudo-moar dfcf9f: OUTPUT«<anon> <anon> name of default dynamic WHICH␤»
moritz m: say Variable.^methods
camelia rakudo-moar dfcf9f: OUTPUT«-> (Variable: Any |c) { #`(Submethod+{<anon>}|56931304) ... } <anon> <anon> <anon> <anon> <anon>␤»
moritz m: say Variable.^attributes
camelia rakudo-moar dfcf9f: OUTPUT«str $!name str $!scope Mu $!var Mu $!block Mu $!slash␤»
japhb I love that we all naturally go straight to the metamodel, rather than reading the source. :-) 17:45
moritz oh, I found class Variable by reading the source
and found exactly one place where it's used from Actions.nqp, and that's in the context of traits 17:46
17:46 M_o_C joined
moritz m: multi sub trait_mod:<is>(Variable:D $v, :$scoped_how!) { say $v.scope }; my $x is scoped_how; 17:47
camelia rakudo-moar dfcf9f: OUTPUT«my␤»
moritz m: multi sub trait_mod:<is>(Variable:D $v, :$scoped_how!) { say $v.scope }; class A { has $x is scoped_how };
camelia rakudo-moar dfcf9f: OUTPUT«===SORRY!=== Error while compiling /tmp/8Ai2KwOhBg␤Can't use unknown trait 'is scoped_how' in an attribute declaration.␤at /tmp/8Ai2KwOhBg:1␤------> ␤ expecting any of:␤ rw␤ readonly␤ box_target␤ …»
moritz m: multi sub trait_mod:<is>(Variable:D $v, :$scoped_how!) { say $v.scope }; our $x is scoped_how; 17:49
camelia rakudo-moar dfcf9f: OUTPUT«our␤»
moritz has there been a post about symbol stables/stashes/pseudo stashes yet? 17:54
masak would like to see that 17:58
17:58 tinyblak left
moritz writes a bit doc.perl6.org doc for Stash, and maybe PseudoStash, and see if he can derive a blog post later on 17:59
17:59 vanman joined, vanman left 18:01 perturbation joined
dalek c: cc756f6 | moritz++ | lib/Type/Stash.pod:
Some initial documentation for type Stash
18:08
japhb OK, CQRS experts: How do you model a command that may result in a cascade of changes to object states, such that the system is not consistent until the cascade completes? In other words, how do you separate transaction boundaries from changes made within transactions? 18:09
18:09 M_o_C left
japhb To make this concrete, I'm considering the problem of casting a spell on a character that reduces their intelligence, thus making them unable to cast their most complex spells, which forces a flub of a complex spell currently being cast by the character, which results in damage to every character within the blast radius, which may kill some of them, which affects morale of the survivors, ... 18:14
moritz japhb: does if have to happen at once? there could be some friendly saving spells being cast at the same time 18:15
japhb has a renewed respect for the mental hijinks required to play an RPG
moritz: Oh dear. 18:16
moritz japhb: which reverts some of the damage, and prevents further cascades
japhb hmmm
18:17 Ugator joined, FloLo joined
japhb Yeah, that makes me wonder about the reality of the transaction boundary that I was provisionally considering the end of the cascade from a single causative action 18:17
moritz actually it might be more transparent for the observer if they see the events unfolding like you described, instead of a big BAMM, people dead, morale low 18:18
japhb That's a good point.
Sheesh. Just figuring out the constraints that would help me model a character is twisting my brain in knots.
moritz m: say MY.perl 18:19
camelia rakudo-moar dfcf9f: OUTPUT«MY␤»
moritz m: say MY.^name
camelia rakudo-moar dfcf9f: OUTPUT«MY␤»
moritz m: say CORE.^name 18:20
camelia rakudo-moar dfcf9f: OUTPUT«CORE␤»
18:22 anaeem1 left 18:30 kurahaupo joined 18:33 njmurphy joined 18:36 denis_boyun_ joined
moritz m: say CORE.^mro 18:42
camelia rakudo-moar dfcf9f: OUTPUT«No such method 'mro' for invocant of type 'Perl6::Metamodel::ModuleHOW'␤ in block <unit> at /tmp/FZpgm8_k_k:1␤␤»
dalek c: 5aa7f9a | moritz++ | htmlify.p6:
htmlify: Do not use deprecate methods

  lizmat++ for making the deprecation mesages so awesome
18:45
moritz m: say GLOBAL.keys 18:47
camelia rakudo-moar dfcf9f: OUTPUT«␤»
moritz m: our sub foo { }; say GLOBAL.keys 18:48
camelia rakudo-moar dfcf9f: OUTPUT«␤»
18:50 perturbation left 18:51 rindolf left 18:58 FROGGS joined, prime- joined 18:59 prime left 19:02 konsolebox joined, atroxaper left
FROGGS o/ 19:03
yoleaux 01:36Z <raydiak> FROGGS: sent you a PR for Inline::C, s:g/path/IO/
psch \o FROGGS 19:04
19:06 smls joined
smls masak: Tomorrow? I thought I claimed Tuesday... 19:06
Although tomorrow would be fine too, unless someone thinks it needs major changes: smls.co.nf/advent/data-munging-in-p...vs-perl-5/ 19:08
masak smls: yeah, sorry. Tuesday's it.
19:11 kurahaupo_ joined 19:12 Mso150 joined 19:16 araujo left 19:19 prime- left
smls TimToady, jnthn: An argument in favor of the colon in «&block:(...)», is that a standalone signature in term position «:(...)» has it too... 19:22
so, basically :( ) is the signarure equivalent of Array's [ ] 19:23
jnthn returns 19:35
Managed to catch up on a couple of days worth of backlog over post-dinner beer too :) 19:36
psch \o jnthn
timotimo has workable internet connection again (but still not much time for Activities™) 19:37
yoleaux 5 Dec 2014 14:42Z <b2gills> timotimo: to improve the quality of the embroidery you could try adding a backing material, perhaps using some water soluble fusible web. ( I don't know if the paper backed stuff would work on its own, or if you would have to fuse some fabric to the back )
19:38 Ugator1 joined
timotimo b2gills: i actually put water-solible backing fleece under the cloth, it didn't seem to help sufficiently 19:38
jnthn psch: iirc, P6opaque is the REPR implementation, and there's a P6opaqueInstance or so (maybe s/Instance/Base) that is the appropriate thing to cast to
But maybe you're beyond that point now :)
psch there is P6OpaqueBaseInstance and P6OpaqueDelegateInstance 19:39
but yes, i'm beyond that point now
jnthn Ah, yeah
Cool :)
My beer was empty before I completely caught up :)
psch i'm now at "how do i figure out what type to pass to marshalIn() to get the Object i get from my CallSite into the right shape"
oh wait 19:40
i think i looked at the wrong docs, lemme check
right, i did 19:43
i'm not sure yet if this'll work, though
well, it compiles :P 19:48
(i've been there before :) )
FROGGS that's a start :o)
dalek rl6-roast-data: b8c47eb | coke++ | / (5 files):
today (automated commit)
19:49
psch the wonky bit at the moment is that i wasn't successful in installing a specific MethodHandle in the CallSite
i.e. it down(up?)casts everything to Object
jnthn "wasn't successful"? :)
psch well, i haven't figured out how to implement that
well, to be precise, the method i'm installing in the CallSite has a signature of (Object, Object, Object, Object...) 19:51
because i didn't figure out how to install a method with a more specific signature
[Coke] tries to get jnthn another reproducable os x failure.
jnthn [Coke]: Those are always welcome. The two things I fixed after finding them on OSX so far turned out to only make things so much better... 19:52
hoelzro so it seems that STD uses sublongname for the parsing of the &block:(...), but Rakudo doesn't have sublongname; should I just do <name=.longname> ':(' ~ ')' <.signature>? 19:53
psch right, i should have anticipated the failure mode i'm getting now... the static class doesn't have the static field set at compile time but will only get it at runtime, and so i get a NPE when running into the code that wrote that invokedynamic insn... 19:54
jnthn hoelzro: No, I'd rather add sublongname, I think... 19:55
hoelzro seems reasonable; I'm just not sure what to make sublongname =/
jnthn There's another place that wants it also...
hoelzro if I copied too heavily from STD, I would be introducing a lot of new terms, most of which would probably be redundant 19:56
jnthn In variable
That one would want it in a lookup-y context
So I guess whatever "make" does wants to be non-commital in that regard 19:57
19:57 FROGGS[mobile] left, mvuets left, mvuets1 joined 20:00 mvuets1 left 20:02 anaeem1_ joined, atroxaper joined
psch hrm, overloading only by return type doesn't work in java, but overloading by signature with a different return type works 20:08
but there's no way of knowing which method will be chosen inside my CallSite at runtime during compile time 20:09
which means i have trouble giving the right type to marshalOut, because i don't know it yet
20:09 atroxaper left
psch github.com/peschwa/rakudo/blob/jvm....java#L215 if someone wants to have a look. warning: rambly comments and much debug output :P 20:10
most of the debug output is between lines 55-98 and the rambly comments are around 126-149 20:11
20:12 rurban left 20:16 anaeem1_ left, anaeem1_ joined 20:20 anaeem1_ left 20:21 rurban joined 20:28 Woodi left
dalek p: 1fe679a | (Timo Paulssen)++ | src/vm/moar/profiler/template.html:
display gen2roots in profiler output
20:30
kudo/rt-123116: b2cb4dd | (Rob Hoelz)++ | src/Perl6/Grammar.nqp:
Parse closure parameters

See SO6/Closure parameters. For example:
fe8d0d9 | (Rob Hoelz)++ | src/Perl6/Actions.nqp: Add post constraint for checking closure parameter signatures
A lot of this was lifted out of make_where_block
20:32
20:32 dalek left
timotimo dat cliffhanger 20:33
20:33 dalek joined, ChanServ sets mode: +v dalek
masak "tune in next week for... example!" 20:33
20:36 Roonin left 20:38 darutoko left
masak m: say [1, 2, 3] ~~ [Int, Int, Int] 20:41
camelia rakudo-moar dfcf9f: OUTPUT«False␤»
timotimo m: say [1, 2, 3] ~~ (Int, Int, Int)
camelia rakudo-moar dfcf9f: OUTPUT«False␤»
timotimo m: say (1, 2, 3) ~~ :(Int, Int, Int)
camelia rakudo-moar dfcf9f: OUTPUT«True␤»
20:42 araujo joined
masak m: say (:()).^name 20:42
camelia rakudo-moar dfcf9f: OUTPUT«Signature␤»
masak signatures++
20:43 vti joined
jnthn yeah, I'm happy they're first class thingies :) 20:44
masak oh, wait. so if I use colons in action method names, I have to put in whitespace before the '('? 20:45
did not know that.
jnthn ?
masak m: class Action { method foo:bar($/) {} }; say "alive" 20:46
camelia rakudo-moar dfcf9f: OUTPUT«===SORRY!=== Error while compiling /tmp/KdF9GpR9kO␤Colon pair value '$/' too complex to use in name␤at /tmp/KdF9GpR9kO:1␤------> class Action { method foo:bar($/) {} ⏏}; say "alive"␤ expecting any of:␤ …»
jnthn Oh
I guess, but I always do like foo:sym<bar> or so, so I never ran into it :)
masak aha.
timotimo can you even declare a method with a non-compile-time-constant name-part with foo:bar($blubb)? 20:47
vendethiel plans to abuse signatures
timotimo please do so
jnthn timotimo: No, but $lubb could of course be a constant
m: say constant inople = 'Istanbul' 20:48
camelia rakudo-moar dfcf9f: OUTPUT«Istanbul␤»
20:59 ilogger2 joined, ChanServ sets mode: +v ilogger2 21:04 Mso150 joined
[Coke] do we eventually plan to replace the exec to find our system information on every invocation? 21:09
(looks like OS X is now calling "sw_vers" on each call)
FROGGS we could cache that I suppose... 21:10
[Coke] do we really need it? is it something we could get lazily? 21:11
[Coke] groans at jnthn's pun
jnthn I'd hope we can get it on demand. 21:13
moritz puns on demand!
jnthn (The version info; puns are delivered asynchronously...)
:P
psch irclog.perlgeek.de/perl6/2014-12-03#i_9755719 has some discussion
21:14 Mso150 left, Mso150_f joined
breinbaas remembers the Opel marketing campaign "Constant in Opel" 21:19
21:21 Mso150_f_e joined, Mso150_f left
hoelzro is it currently possible to construct a Sub object from the ground up in Rakudo? 21:24
ex. can I create the parameters, then the signature, then bind that to a code object to create a Sub?
my experiments lead me to say 'no', but I wanted some confirmation from others who know more than I =)
moritz I think "no" is accurate 21:25
hoelzro ok, that's what I thought =( 21:26
is that RT worthy, you think? 21:27
psch i think we need some mechanics of that kind to get assuming to spec
*mechanism
jnthn It's more a design issue. For now, use EVAL. It may fall within the remit of QTree.
Technically, you can probably mimic much of what the compiler does. 21:28
hoelzro I'm guessing you could probably do it with copious sprinklings of nqp::
masak got bitten by a bug where /w/ trumped /d/ 21:29
luckily, reordering tokens solved it.
jnthn masak: Uh, is that really a bug? Or you mean "bug in your grammar"? :) 21:30
masak in my grammar :)
sorry, didn't mean to make you nervous there ;)
jnthn Ah, OK. Was gonna say, was not aware of a bit of spec that wanted LTM to differentiate by char class subsetness :P
masak yeech. no.
jnthn Which is a conceivable feature, but... :P
masak I don't see a big need. 21:31
jnthn Yeah, same.
bartolin m: my :($a, $b)
camelia rakudo-moar dfcf9f: OUTPUT«===SORRY!=== Error while compiling /tmp/GROhOBNoeO␤Malformed my␤at /tmp/GROhOBNoeO:1␤------> my ⏏:($a, $b)␤ expecting any of:␤ scoped declarator␤»
bartolin is that supposed to work? in S02 there is a sentence "Declarators generally make the colon optional: my ($a,$b,$c); # parsed as signature" 21:32
m: my ($a, $b); say "alive"
camelia rakudo-moar dfcf9f: OUTPUT«alive␤»
bartolin std: my :($a, $b) 21:33
camelia std 76ccee1: OUTPUT«===SORRY!===␤Malformed my at /tmp/zQC0IfVv4Y line 1:␤------> my ⏏:($a, $b)␤ expecting any of:␤ name␤ scoped declarator␤Parse failed␤FAILED 00:00 135m␤»
psch m: my $x = ($a, $b); say $x.WHAT
camelia rakudo-moar dfcf9f: OUTPUT«===SORRY!=== Error while compiling /tmp/mF9E0jzRVz␤Variable '$a' is not declared␤at /tmp/mF9E0jzRVz:1␤------> my $x = ($a⏏, $b); say $x.WHAT␤ expecting any of:␤ postfix␤»
psch m: 6; my $x = ($a, $b); say $x.WHAT
camelia rakudo-moar dfcf9f: OUTPUT«(Parcel)␤»
psch m: my $x = :($a, $b); say $x.WHAT
camelia rakudo-moar dfcf9f: OUTPUT«(Signature)␤»
psch eh, my is the declarator 21:34
i don't get it :)
jnthn I can see how that bit of spec is suggestive of the : being optionally allowed there...
bartolin here is the link: perlcabal.org/syn/S02.html#Signature_objects 21:35
psch what does "parsed as a Signature" do for a declaration like "my ($a, $b, $c)"? 21:37
bartolin there is an ticket (RT #122917) about a broken example in the perl6 book. so I wondered whether "my :($a, $b)" was valid some years ago ...
synopsebot Link: rt.perl.org/rt3//Public/Bug/Displa...?id=122917
masak does prefix:<|> on a scalar argument for the first time 21:38
jnthn psch: Well, if you bind do it you get destructuring.
masak "pass this argument unless it's Nil" :)
psch m: 6; %h = <a 1 b 2 c 3>; my ($a, $b, $c) := %h; say $c # expecting 3? 21:39
camelia rakudo-moar dfcf9f: OUTPUT«Too few positionals passed; expected 3 arguments but got 0␤ in block <unit> at /tmp/9xeT5HfYM_:1␤␤»
psch m: 6; %h = <a 1 b 2 c 3>; my ($a, $b, $c) := |%h; say $c # expecting 3?
camelia rakudo-moar dfcf9f: OUTPUT«===SORRY!=== Error while compiling /tmp/mDiWnkxeun␤Variable '&prefix:<|>' is not declared␤at /tmp/mDiWnkxeun:1␤------> %h = <a 1 b 2 c 3>; my ($a, $b, $c) := ⏏|%h; say $c # expecting 3?␤»
psch something like that?
jnthn m: my %h = a => 1, b => 2; my (:$a, :$b) := %h; .say for $a, $b
camelia rakudo-moar dfcf9f: OUTPUT«1␤2␤»
masak .oO( everybody wants lots of colons ) 21:40
psch jnthn: and "factorizing" the colon before the parens should be allowed, but it should also be optional? is that what the spec suggests?
oh nvm, we'd still need them inside 21:41
because nameds
m: my ($a, $b) := [1, 2]; say $b
camelia rakudo-moar dfcf9f: OUTPUT«2␤»
jnthn yeah, it's more saying that maybe we should be able to write a : before the ( for consistency
But tbh...I'm not sure I care for being able to do so. :)
bartolin ok, so one would just use "my ($a, $b)" for now. (until someone cares :) 21:43
thanks for explaining!
21:44 denis_boyun joined
masak 'night, #perl6 21:44
bartolin o/
jnthn 'night, masak
psch g'night, masak
yay, my interop works 21:48
...as long as the method returns a String
which clearly states the remaining problem: i need a way to know at compile time which method was chosen at runtime, so i can get its return type and cast the Object accordingly 21:49
that probably means i need another indy call to look somewhere for the right type..? 21:50
i'm not sure i can insert a CHECKCAST with some type from the stack as argument though :/
also there's primitives to pay attention to, too 21:55
jnthn Maybe the way to do it statically is always to box? 21:56
Mebbe the .filterReturnValue combinator can help also?
psch .filterReturnValue probably helps, yes. i'd need a method that boxes correctly for every possible return type, but i guess i can get that dynamically 21:59
21:59 Mso150_f_e left 22:00 Mso150_f_e joined
psch always boxing could help with the primitives? i'm having the problem that P6Int unboxes to a java.lang.Long, and i'd have to cast those to the corresponding java primitive or fail to dispatch if it's too large 22:01
i don't know how casting of a Long > Integer.MAX_VALUE to int works out in java and if we want to hand-hold there
or rather how much hand-holding we want to do there
because "just overflow it" (in case that's what java does) doesn't seem particularly DWIMmy to me 22:02
s/overflow/truncate/
22:04 telex joined
hoelzro so I got the post constraint bit working; I ended up duplicating a lot of code from make_where_block, though 22:04
so any insights on how to make that cleaner would be appreciated!
22:12 virtualsue joined
jnthn hoelzro: I'm heading sleepwards now, but I've got it on a browser tab to look at in the morning :) 22:19
psch: I'd go with the Java casting semantics for now. 22:20
hoelzro ok, thanks jnthn 22:22
psch jnthn: i'm not sure that helps. if i java-side unbox a Long to a long i can't match a MethodHandle that wants an int
jnthn: if i do the matching indiscriminately i'm losing the distinction between signatures of longs and ints 22:23
22:23 aborazmeh joined
psch which means i'll always match the first one, instead of the closest one... 22:23
hm, i think there was some kind of logic like that in the compile-indy example of ASM, i'll have to reread that
anyway, jnthn++ for the guidance 22:24
22:24 Mso150_f_e left
jnthn Ah...yeah, maybe in the case there are overloadings on things like int size and float size, the best bet is "pick the widest, minimizing information loss", and we leave the caller to disambiguate if that's not the semantics they want. 22:24
psch yeah, that seems sensible 22:25
i mean, the descriptor syntax is still there and won't go away either, there's always that 22:26
jnthn Right.
psch and i'd say having methods that only differ by the byte size of the parameters is bad design anyway :)
22:35 aborazmeh left 22:43 kurahaupo joined 23:06 gfldex joined 23:25 Ugator1 joined 23:26 Ugator1 left 23:27 Ugator1 joined
[Coke] is unable to make any of the osx programs fail outside of the test summary today. 23:28
perl6/book mentions #perl6book, which seems to be filled with bots & Util ; should we remove that reference? 23:29
23:30 Ugator1 left, Ugator1 joined 23:36 Ugator1 left 23:37 BenGoldberg joined 23:39 gfldex left 23:43 atroxaper joined 23:46 aborazmeh joined 23:49 atroxaper left 23:58 kurahaupo left