Perl 6 - the future is here, just unevenly distributed

IRC log for #perl6, 2013-12-08

Perl 6 | Reference Documentation | Rakudo

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

All times shown according to UTC.

Time Nick Message
00:08 xenoterracide joined #perl6
00:19 xinming joined #perl6
00:20 xenoterracide joined #perl6
00:22 BenGoldberg joined #perl6
00:34 SevenWolf joined #perl6
00:38 BenGoldberg joined #perl6
00:38 jeff_s1 joined #perl6
00:40 rurban1 joined #perl6
01:02 jeffreykegler joined #perl6
01:09 Mouq joined #perl6
01:29 kaare__ joined #perl6
01:45 xinming joined #perl6
01:54 xinming joined #perl6
01:54 jnap joined #perl6
02:01 cognominal joined #perl6
02:10 raiph r: say sort *, 1, 2 # known issue?
02:10 camelia rakudo-parrot 56ee1a, rakudo-jvm 56ee1a: OUTPUT«1 2 *␤»
02:11 colomon r: say sort +*, 1, 2
02:11 camelia rakudo-parrot 56ee1a, rakudo-jvm 56ee1a: OUTPUT«1 2␤»
02:12 colomon …. * isn't code, is it?  it's just a whatever
02:12 colomon r: say sort 1, 2, 3
02:12 camelia rakudo-parrot 56ee1a, rakudo-jvm 56ee1a: OUTPUT«1 2 3␤»
02:13 raiph r-p: say *, 1
02:13 camelia rakudo-parrot 56ee1a: OUTPUT«*1␤»
02:14 thou joined #perl6
02:19 rurban1 joined #perl6
02:34 Fatalnix so when I use the JVM and I use target=classfile, --classname isn't there like someone suggested I use- is it no longer or was just an accident?
02:44 FROGGS joined #perl6
02:44 xinming joined #perl6
02:48 lue r: say sort {*, 1 ,2}(3)
02:48 camelia rakudo-parrot 56ee1a, rakudo-jvm 56ee1a: OUTPUT«1 2 *␤»
02:48 lue r: say sort {$^a, 1 ,2}(3)
02:48 camelia rakudo-parrot 56ee1a, rakudo-jvm 56ee1a: OUTPUT«1 2 3␤»
02:50 xinming joined #perl6
02:57 Mouq joined #perl6
03:21 atroxaper joined #perl6
03:26 rurban1 joined #perl6
04:07 jnap joined #perl6
04:21 preflex_ joined #perl6
04:28 rurban1 joined #perl6
04:30 cognominal joined #perl6
04:45 Mouq joined #perl6
04:47 atroxaper joined #perl6
04:49 atroxaper joined #perl6
04:52 Mouq joined #perl6
05:10 xinming joined #perl6
05:18 raiph joined #perl6
05:22 xinming joined #perl6
05:48 rurban1 joined #perl6
05:48 ssutch joined #perl6
06:09 jnap joined #perl6
06:37 darutoko joined #perl6
06:40 Mouq joined #perl6
06:40 xinming joined #perl6
06:47 SamuraiJack_ joined #perl6
07:15 xenoterracide joined #perl6
07:17 moritz good morning
07:27 moritz raydiak++ # p6advent post
07:44 atroxaper joined #perl6
07:53 raydiak good morning, moritz++ # for suggesting I write a p6advent post
07:55 raydiak turned out to be a great idea, and I never would have volunteered to do it without that nudge
07:58 raydiak (trying to convince lurkers who may be reading to join the fun)
08:06 kaare__ joined #perl6
08:11 diakopter raydiak++ # even though I haven't read it :)
08:11 jnap joined #perl6
08:28 raydiak haha, thanks :)
08:28 Mouq joined #perl6
08:30 SamuraiJack_ joined #perl6
08:32 lizmat joined #perl6
08:43 FROGGS jnthn: do you have an idea where I could start looking to solve that? https://gist.github.com/FROGGS/392471225039d60749d7
08:44 denisboyun joined #perl6
08:47 * diakopter wonders what in the world that code does
08:47 FROGGS jnthn: I pass my own %chosen to the ModuleLoader.load_module, and it is correct, I just dumped it for both versions
08:48 FROGGS diakopter: magic and rainbows :o)
08:48 diakopter oooo :)
08:49 FROGGS diakopter: I put my own moduleloader in between, basically to locate modules by auth/name/ver
08:49 diakopter neat
08:50 FROGGS it works, as I get the subs exported from Test.pm and can use them, but I don't get the Test class defined for some <unknown> reason
09:06 lizmat joined #perl6
09:10 atroxaper joined #perl6
09:15 lizmat good *, #perl6 on day 3 of the patch -p1
09:16 FROGGS hi lizmat
09:16 lizmat FROGGS o/
09:31 dmol joined #perl6
09:33 rurban1 joined #perl6
09:33 woolfy joined #perl6
09:39 rurban2 joined #perl6
09:40 FROGGS[mobile] joined #perl6
09:47 dmol joined #perl6
09:50 Piers_ joined #perl6
09:58 kivutar joined #perl6
10:02 dagurval I have a case with gather/take which don't understand. When I take Hashes assigned to variables, it combines them. But does not if I don't assign them before taking.
10:02 dagurval Example: https://gist.github.com/dagurval/9c238e886a57025153cc
10:02 dagurval also, two with the same key "hello"
10:03 dagurval should they not be the same?
10:04 tgt joined #perl6
10:08 dalek rakudo/nom: 01755be | (Elizabeth Mattijsen)++ | src/Perl6/Actions.nqp:
10:08 dalek rakudo/nom: Only need $/ for the first occurrence of attribute
10:08 dalek rakudo/nom: review: https://github.com/rakudo/rakudo/commit/01755be9b9
10:09 dalek roast: 05d6eae | (Elizabeth Mattijsen)++ | integration/role-composition-vs-attribute.t:
10:09 dalek roast: Some more private attribute related tests
10:09 dalek roast: review: https://github.com/perl6/roast/commit/05d6eae941
10:10 lizmat dagurval: isn't that a parcel of pairs you're taking
10:10 lizmat hmmm;.. guess not
10:10 lizmat .oO( need more tea to wake up )
10:13 jnap joined #perl6
10:16 Mouq joined #perl6
10:18 itz oh perl6-m works!
10:18 itz for certain values of works :)
10:22 spider-mario joined #perl6
10:22 Rotwang joined #perl6
10:25 lizmat dagurval: the take %a flattens into a list of pairs
10:26 lizmat being taken
10:26 lizmat I'm not sure whether that is according to spec or not
10:37 lizmat TimToady: looking at Set/Bag/Mix/Quant again, I'm a little bit in two minds about this
10:37 cognominal joined #perl6
10:38 lizmat in the current implementation, Set/SetHash have much more in common with each other
10:38 lizmat than Set/Bag/Mix have with each other
10:40 rurban1 joined #perl6
10:43 FROGGS itz: yes, it does :o)
10:45 lizmat so I really now have the choice of rewriting Set/Bag/Mix to adhere to the spec at the class/role level, and reduce efficiency
10:46 lizmat or disregard the spec in that respect
10:46 lizmat (assuming the QuantHash is just a mystical beast)
10:46 lizmat or change the spec
10:47 moritz QuantSuperposHash? :-)
10:49 ssutch joined #perl6
10:52 denis_boyun joined #perl6
11:04 FROGGS p: use Test; say GLOBAL::
11:04 camelia rakudo-parrot 56ee1a: OUTPUT«("Test" => Test).hash␤»
11:04 FROGGS what is in charge to stash Test there?
11:07 lizmat FROGGS: some code you missed in src/Perl6/ModuleLoader.nqp ?
11:07 FROGGS lizmat: I have no idea
11:09 lizmat merge_globals($target, $source) { ??
11:10 FROGGS possible, though I don't see a difference there when executing the failing code and the working code
11:13 FROGGS I think I need to add more debug output there...
11:14 jnap joined #perl6
11:21 lizmat jnthn: regarding visibility of private attributes of roles doing other roles
11:21 lizmat isn't that just a matter of making get_attribute_for_usage in src/Perl6/Metamodel/AttributeContainer.nqp smarter?
11:30 hummeleB1 joined #perl6
11:44 lizmat TimToady: on a slightly higher level:
11:45 lizmat if we can pun a role into a class
11:45 lizmat why do we have classes and inheritance at all?
11:46 lizmat if we would not have inheritance and classes, wouldn't that make the method cache obsolete
11:46 lizmat as we would know all the possible methods of a role at composition time already ?
11:47 SamuraiJack_ joined #perl6
12:04 Mouq joined #perl6
12:08 cognominal joined #perl6
12:08 lizmat joined #perl6
12:09 lizmat_ joined #perl6
12:10 rurban1 joined #perl6
12:11 FROGGS lizmat++ # it works now! thanks for pushing me in the right direction :o)
12:14 lizmat_ cool!   FROGGS++ for not giving up!
12:14 jnap joined #perl6
12:19 lizmat joined #perl6
12:20 cognominal__ joined #perl6
12:33 sqirrel joined #perl6
12:36 moritz r: role A { has $!x }; class A { method m { $!x } }; say A.new.m
12:36 camelia rakudo-parrot 01755b, rakudo-jvm 01755b: OUTPUT«===SORRY!===␤No such method 'is_composed' for invocant of type 'Perl6::Metamodel::ParametricRoleGroupHOW'␤»
12:36 moritz wut?
12:36 moritz p: role A { has $!x };
12:36 camelia rakudo-parrot 01755b: ( no output )
12:37 moritz p: class A { method m { $!x } }
12:37 camelia rakudo-parrot 01755b: OUTPUT«[31m===[0mSORRY![31m===[0m Error while compiling /tmp/bpVplkKOgWâ�¤Attribute $!x not declared in class Aâ�¤at /tmp/bpVplkKOgW:1â�¤------> [32mclass A { method m { $!x } }[33mâ��[31m<EOL>[0mâ�¤    expecting any of:â�¤        postfixâ�¤        stat…»
12:37 moritz oh
12:37 moritz p: role R { has $!x }; class A does R { method m { $!x } }; say A.new.m
12:37 camelia rakudo-parrot 01755b: OUTPUT«(Any)␤»
12:37 moritz lizmat: we need classes because private attributes in roles aren't private to that role
12:43 beastd joined #perl6
12:43 lizmat moritz: would that also apply to a punned role ?
12:44 lizmat p: role R { has $!x = 42 }; say R.new.x
12:44 camelia rakudo-parrot 01755b: OUTPUT«No such method 'x' for invocant of type 'R'␤  in block  at /tmp/ZLe7Lsyqgk:1␤  in any  at /tmp/ZLe7Lsyqgk:1␤  in any  at gen/parrot/stage2/NQPHLL.nqp:1146␤  in any eval at gen/parrot/stage2/NQPHLL.nqp:1133␤  in any evalfiles at gen/parrot/stage…»
12:56 dalek rakudo/nom: 05c2fef | (Elizabeth Mattijsen)++ | src/core/ (8 files):
12:56 dalek rakudo/nom: Fix most of the nasty nqp::get_attr calls
12:56 dalek rakudo/nom:
12:56 dalek rakudo/nom: Now that classes can see private role attributes
12:56 dalek rakudo/nom: review: https://github.com/rakudo/rakudo/commit/05c2fef413
13:13 xinming_ joined #perl6
13:15 Celelaptop joined #perl6
13:20 woolfy joined #perl6
13:35 lizmat jnthn: looking at implementing :$stop and :$times in ThreadPoolScheduler
13:36 lizmat so if I e.g. want to call "cancel" on $!timer, that would be something like
13:36 lizmat $!timer.'method/cancel/(Ljava/util/TimerTask;)V
13:36 lizmat ?
13:37 kivutar joined #perl6
13:38 xinming joined #perl6
13:39 kaare_ joined #perl6
13:42 rurban1 joined #perl6
13:47 timotimo r: class Foo { has $.a; method bar($asd) { .new(:a($asd)) } }; say Foo.new(:a<hi>).bar(123);
13:47 camelia rakudo-parrot 05c2fe, rakudo-jvm 05c2fe: OUTPUT«Nil␤»
13:47 timotimo raydiak: i think in your method subtract you really wanted self.new instead of .new
13:48 timotimo raydiak: also, it might be nice to mention that »-« will actually do a dimension check for us automatically
13:49 xinming joined #perl6
13:52 Celelaptop joined #perl6
13:52 timotimo otherwise, a very good post, raydiak++ :)
13:52 Mouq joined #perl6
14:00 jnap joined #perl6
14:08 dalek specs: ff201e6 | (Elizabeth Mattijsen)++ | S17-concurrency.pod:
14:08 dalek specs: Fix copy-n-pasto
14:08 dalek specs: review: https://github.com/perl6/specs/commit/ff201e6884
14:19 V_S_C joined #perl6
14:24 V_S_C left #perl6
14:24 xinming joined #perl6
14:28 Pleiades` joined #perl6
14:30 Pleiades` joined #perl6
14:34 colomon joined #perl6
14:38 denisboyun joined #perl6
14:45 rurban1 joined #perl6
14:47 BenGoldberg joined #perl6
14:47 Mouq joined #perl6
14:48 Colby` joined #perl6
14:51 Pleiades` joined #perl6
14:53 lizmat jnthn: in order to be able to implement :$stop on Scheduler.cue, I think we need to have a separate JVM timer object
14:53 lizmat as we can only cancel a timer, not a set of tasks scheduled on that timer
14:54 lizmat I also think we will need to have that if we specify :every, because we probably want to have some way of stopping something like that externally as well, even if there is no explicit :$stop specified
14:55 timotimo especially when the main program ends and you don't really want it to continue
14:55 timotimo or maybe you do
14:55 timotimo we don't in the case of spectests, though
14:55 lizmat exactly
15:08 nwc10 good UGT, #perl6
15:08 FROGGS hi nwc10
15:08 lizmat nwc10!
15:16 denis_boyun_ joined #perl6
15:32 dalek rakudo/nom: a664d48 | (Elizabeth Mattijsen)++ | src/vm/jvm/core/ (2 files):
15:32 dalek rakudo/nom: Implement *Scheduler.cue( :times )
15:32 dalek rakudo/nom: review: https://github.com/rakudo/rakudo/commit/a664d48018
15:33 dalek roast: 5497844 | (Elizabeth Mattijsen)++ | S17-concurrency/scheduler.t:
15:33 dalek roast: Implement tests for $*SCHEDULER.cue( :times )
15:33 dalek roast: review: https://github.com/perl6/roast/commit/5497844371
15:44 rurban1 joined #perl6
15:45 raiph joined #perl6
15:53 lizmat joined #perl6
15:58 rindolf joined #perl6
15:58 Psyche^_ joined #perl6
16:05 jnap joined #perl6
16:10 Rotwang joined #perl6
16:11 rewm joined #perl6
16:22 MikeFair joined #perl6
16:47 * lizmat drops a pin
16:52 lizmat patch -p1 winding down
16:55 jnap joined #perl6
17:02 ajr joined #perl6
17:09 woolfy left #perl6
17:11 lizmat goodbye from the Cité des Sciences, it was fun!
17:37 timotimo joined #perl6
17:40 tgt joined #perl6
17:42 colomon joined #perl6
17:48 rewm joined #perl6
17:54 timotimo nothing much going on today, eh?
17:55 dalek rakudo/nom: 0bf3de5 | (Tobias Leich)++ | src/vm/ (3 files):
17:55 dalek rakudo/nom: named params are optional by default
17:55 dalek rakudo/nom: review: https://github.com/rakudo/rakudo/commit/0bf3de5f2c
17:56 TimToady maybe everyone is working on their advent posts...
17:57 timotimo i'm not =o
17:57 jnap joined #perl6
17:59 FROGGS well, I try hard to have something to write about :/
18:01 jnap joined #perl6
18:07 zakalwe joined #perl6
18:10 kivutar joined #perl6
18:15 sqirrel joined #perl6
18:20 masak evening, #perl6
18:20 FROGGS evening #masak
18:20 masak oh, I'm on for tomorrow's advent post, aren't I? :)
18:21 FROGGS you are :o)
18:21 masak I better get started with it, then.
18:29 masak today's mini-challenge, while I work on the post: someone please implement a subclass of Pair that understands arbitrary .cdaddr calls (through a custom implementation of .^find_method)
18:31 masak I would do it, but I haven't learned how to quickly-and-easily provide a custom metaclass for a class.
18:31 masak if you succeed, you will be favorably mentioned in tomorrow's advent post :)
18:34 lue CD ADDRess? Or is it a Lispy name that I suspected it was and quick searching seems to suggest it is?
18:35 benabik I imagine he meant arbitrary lisp-like /c[ad]+r/ calls.
18:35 Mouq joined #perl6
18:36 masak what benabik said.
18:36 masak lue: it's a way to dig arbitrarily deep down into nested Pair structures.
18:37 masak lue: .car digs into the key, .cdr digs into the value.
18:37 masak lue: longer mixes of 'a' and 'd' letters dig more levels down.
18:37 lue cdaddr is apparently $pair.value.value.key.value  :)
18:37 lue Hmmm....
18:38 benabik I thought it would be .value.key.value.value
18:38 masak no, lue is right.
18:38 lue benabik: start here: http://www.cs.utexas.edu/~moore/acl2/v2-9/CDADDR.html go down to "cdr of cdr", and work your way out :)
18:39 benabik Well, there's a reason I preferred #'first, #'second, etc. when I was using clisp.
18:39 masak because method calls are LTR, whereas Lisp's function calls are (nested from within) RTL.
18:39 TimToady also, make it present list semantics when used as a list
18:39 lue r: class Foo { method FALLBACK(*@a) { say @a.perl } }; Foo.xyzzy(1);
18:39 TimToady unlike a Pair, which won't expand to a list naturally
18:39 camelia rakudo-jvm 0bf3de: OUTPUT«(timeout)»
18:39 camelia ..rakudo-parrot 0bf3de: OUTPUT«No such method 'xyzzy' for invocant of type 'Foo'␤  in block  at /tmp/DBvUaNh1er:1␤  in any  at /tmp/DBvUaNh1er:1␤  in any  at gen/parrot/stage2/NQPHLL.nqp:1146␤  in any eval at gen/parrot/stage2/NQPHLL.nqp:1133␤  in any evalfiles at gen/parrot…»
18:39 masak don't think FALLBACK is implemented.
18:40 masak anyway, the mini-challenge stands. waiting for a hero :)
18:40 benabik Oh, right.  You don't read it left-to-right, you replace the longer sequence with it.
18:40 lue There goes the FALLBACK($meth-name) { idea :)
18:44 lue I suspect The Slides™ would help, even though they're about NQP...
18:45 rewm_ joined #perl6
18:45 benabik_ joined #perl6
18:46 Quom joined #perl6
18:47 * lue wonders which of the SUBBUILDTIMEPLAN methods gives a class its metamodel, or if that's something else entirely...
18:47 lue masak: needless to say, I'm interested :) . (Note that my preferred solution would be to use FALLBACK, assuming it provides the failed method name)
18:49 cxreg2 joined #perl6
18:50 Juerd_ joined #perl6
18:50 yeltzooo9 joined #perl6
18:53 spider-mario joined #perl6
18:54 Rix_ joined #perl6
18:54 benabik_ There does appear to be a .^add_fallback, but I'm failing at calling it and should be doing something else anyway.
18:55 lue Bah! Rakudo's BOOTSTRAP uses a 'metaclass' keyword, but it fails outside it :(
18:55 lue ideally, class Foo metaclass Bar
18:55 benabik src/Perl6/Metamodel/ClassHOW.nqp:66
18:56 benabik lue: That's because it's an NQP keyword, not a P6 keyword.
18:57 masak and NQP is not (quite) a subset of Perl 6.
18:57 lue r: class Foo { method bar() { say "FOOBAR" } }; class Xyzzy is Foo { multi method bar() { print "NOT "; nextsame } }; Xyzzy.bar; # I guess I'll have to a carbon copy of the ClassHOW then, eh?
18:57 camelia rakudo-parrot 0bf3de, rakudo-jvm 0bf3de: OUTPUT«NOT »
18:58 lue .oO(There *really* needs to be a way for a subclass to say "hey superclass, you're great and all, but this method you have? I want to turn it into part of a MMD.")
18:58 benabik I suppose you could derive from ClassHOW and do all the MyHOW.new_type, add_method, etc by hand
18:59 lue masak: it may be NQP, but the metaclass keyword is a surprisingly nice idea. Though it would be better spelled, to keep with the short keywords:
19:00 lue class Foo by BarHOW; (HOW does that class do it? "by" way of BarHOW)
19:00 masak lue: I don't immediately disagree, but I don't know if a strong case can be made for making it such a short keyword.
19:00 masak 'metaclass' might be more Huffmanly.
19:01 lue Fits better with "is" and "does" at least :)
19:01 lue I agree though that "metaclass" is more Huffmany
19:02 * masak .oO( Huffm-y )
19:02 ajr joined #perl6
19:02 lue benabik: I suppose "by hand" is the only real way, unless one of those SUBBUILDTHINGTHINGS submethods can reassign the metamodel used.
19:02 dwarring joined #perl6
19:03 benabik r: class Foo {}; Foo.^add_fallback(-> $, $ { True }, -> $, $name { -> $ {say $name} }); Foo.xyzzy
19:03 camelia rakudo-parrot 0bf3de, rakudo-jvm 0bf3de: OUTPUT«xyzzy␤»
19:03 masak \o/
19:03 masak benabik: you are my new friend :>
19:04 masak what do all those parameters do?
19:04 benabik I _think_ both of the parameters to add_fallback take the object and the method name.
19:05 benabik The first parameter is "should I use this fallback?" and the second must return something to be called.
19:06 benabik Yeah, looks that way.  They're both called with $obj, $name in find_method_fallback
19:06 masak benabik++
19:06 masak so for .cdaddr, the first one could do a regex match on the name.
19:06 masak the second one could do some simple recursion down to the next level.
19:06 benabik I think you can return nqp::null() for the second one.
19:07 lue masak: I'm now working on the .cdaddaddadr method. Hopefully it'll fit as an IRC one-liner :P
19:07 masak it better :)
19:07 benabik (Any and Mu certainly didn't work.)
19:08 lue r: class Foo { has $.a; method Bar() { my $b = self; say $b.a } }; Foo.new(a => 42).Bar;
19:08 camelia rakudo-parrot 0bf3de, rakudo-jvm 0bf3de: OUTPUT«42␤»
19:10 lue r: class LithpPair is Pair { method !cr($terms) { my $a = self; for $terms.comb.reverse { when "d" { $a = $a.value }; when "a" { $a = $a.key } } }; LithpPair.new(:key("A"), :value(B => (C => "D"))).cr("dd").say
19:10 camelia rakudo-jvm 0bf3de: OUTPUT«[31m===[0mSORRY![31m===[0m Error while compiling /tmp/29JFKQcFWgâ�¤Unable to parse expression in block; couldn't find final '}' â�¤at /tmp/29JFKQcFWg:1â�¤------> [32m), :value(B => (C => "D"))).cr("dd").say[33mâ��[31m<EOL>[0mâ�¤    expecting any of:…»
19:10 camelia ..rakudo-parrot 0bf3de: OUTPUT«[31m===[0mSORRY![31m===[0m Error while compiling /tmp/0FdnfAUH70â�¤Unable to parse expression in block; couldn't find final '}' â�¤at /tmp/0FdnfAUH70:1â�¤------> [32m), :value(B => (C => "D"))).cr("dd").say[33mâ��[31m<EOL>[0mâ�¤    expecting any …»
19:10 lue r: class LithpPair is Pair { method cr($terms) { my $a = self; for $terms.comb.reverse { when "d" { $a = $a.value }; when "a" { $a = $a.key } } }; LithpPair.new(:key("A"), :value(B => (C => "D"))).cr("dd").say
19:10 camelia rakudo-parrot 0bf3de: OUTPUT«[31m===[0mSORRY![31m===[0m Error while compiling /tmp/hAYpxqgeFHâ�¤Unable to parse expression in block; couldn't find final '}' â�¤at /tmp/hAYpxqgeFH:1â�¤------> [32m), :value(B => (C => "D"))).cr("dd").say[33mâ��[31m<EOL>[0mâ�¤    expecting any …»
19:10 camelia ..rakudo-jvm 0bf3de: OUTPUT«[31m===[0mSORRY![31m===[0m Error while compiling /tmp/qL8T58mayUâ�¤Unable to parse expression in block; couldn't find final '}' â�¤at /tmp/qL8T58mayU:1â�¤------> [32m), :value(B => (C => "D"))).cr("dd").say[33mâ��[31m<EOL>[0mâ�¤    expecting any of:…»
19:11 masak ...maybe time to do more experimentation offline, or in privmsg...? :)
19:12 benabik [] in regex becoming <[]> is the hardest change for me to remember.
19:12 lue masak: I am privmsging right now :) only final result will be public
19:13 masak benabik: [] was too short for what it did.
19:13 masak p: my %hash = foo => 1, bar => 2; sub x(:$foo) { say "OH HAI" }; x(|%hash)
19:13 camelia rakudo-parrot 0bf3de: OUTPUT«Unexpected named parameter 'bar' passed␤  in sub x at /tmp/tdcmviUlN9:1␤  in block  at /tmp/tdcmviUlN9:1␤  in any  at /tmp/tdcmviUlN9:1␤  in any  at gen/parrot/stage2/NQPHLL.nqp:1146␤  in any eval at gen/parrot/stage2/NQPHLL.nqp:1133␤  in any…»
19:14 benabik Yeah, but [] for a class is nearly at the level of muscle memory now.  :-/
19:15 masak yeah, I can see the problem.
19:17 lue Uh-oh
19:18 lue r: class Foo { method Bar() { say "OK" }}; Foo.^add_fallback(-> $, $ { True }, -> $, $name { -> $ {say $!name; self.Bar} }); Foo.xyzzy
19:18 camelia rakudo-jvm 0bf3de: OUTPUT«[31m===[0mSORRY![31m===[0m Error while compiling /tmp/_LysVf0jWL�Variable $!name used where no 'self' is available�at /tmp/_LysVf0jWL:1�------> [32m{ True }, -> $, $name { -> $ {say $!name[33m�[31m; self.Bar} }); Foo.xyzzy[0m�»
19:18 camelia ..rakudo-parrot 0bf3de: OUTPUT«[31m===[0mSORRY![31m===[0m Error while compiling /tmp/6xzMPiC3Du�Variable $!name used where no 'self' is available�at /tmp/6xzMPiC3Du:1�------> [32m{ True }, -> $, $name { -> $ {say $!name[33m�[31m; self.Bar} }); Foo.xyzzy[0m�»
19:18 lue r: class Foo { method Bar() { say "OK" }}; Foo.^add_fallback(-> $, $ { True }, -> $, $name { -> $ {say $name; self.Bar} }); Foo.xyzzy
19:18 camelia rakudo-jvm 0bf3de: OUTPUT«[31m===[0mSORRY![31m===[0m Error while compiling /tmp/Msgx6z5rg7â�¤'self' used where no object is availableâ�¤at /tmp/Msgx6z5rg7:1â�¤------> [32m True }, -> $, $name { -> $ {say $name; [33mâ��[31mself.Bar} }); Foo.xyzzy[0mâ�¤    expecting any of:â�¤â€¦Â»
19:18 camelia ..rakudo-parrot 0bf3de: OUTPUT«[31m===[0mSORRY![31m===[0m Error while compiling /tmp/ZrCEweLkW4â�¤'self' used where no object is availableâ�¤at /tmp/ZrCEweLkW4:1â�¤------> [32m True }, -> $, $name { -> $ {say $name; [33mâ��[31mself.Bar} }); Foo.xyzzy[0mâ�¤    expecting any of:…»
19:19 lue oh, benabik: the first '$' in each arglist takes the object, right?
19:19 benabik lue: Yes.  You're returning a code object that gets used as a method, so it gets an innocent as first arg.
19:22 lue r: class LithpPair is Pair { method cr($terms) { my $a = self; for $terms.comb.reverse { when "d" { $a = $a.value }; when "a" { $a = $a.key } }; return $a } }; LithpPair.^add_fallback(-> $, $ { True }, -> $SELF, $name { -> $SELF {$SELF.cr(~$0) if $name ~~ /c(a|d)+r/} }); LithpPair.new(:key("A"), :value(B => ((C => "E") => "D"))).cdaddr.say
19:22 camelia rakudo-parrot 0bf3de, rakudo-jvm 0bf3de: OUTPUT«E␤»
19:22 lue masak: ^^^ :D
19:22 benabik r: Pair.^add_fallback(-> $, $name { $name ~~ /^c<[ad]>+r$/ }, -> $, $name { -> $p { $name ~~ /^c(<[ad]>*)(<[ad]>)r$/; my $r = $1 eq 'a' ?? $p.key !! $p.value; if $0 ne '' { $r."c{$0}r"() } else { $r } } }); (1 => 2 => 3 => Nil).caddr.say
19:22 camelia rakudo-parrot 0bf3de, rakudo-jvm 0bf3de: OUTPUT«3␤»
19:22 lue (the cr method is publically available, but whatever.)
19:24 masak lue: nice ;)
19:24 masak p: (sub (:$foo) { say $foo })(|Pair.new(:key<foo>, :value("OH HAI")))
19:24 camelia rakudo-parrot 0bf3de: OUTPUT«OH HAI␤»
19:25 lue benabik: that's nice and all, but *my* fallback method doesn't try to do more than fallback-ing :P
19:25 masak benabik++ # what I wanted
19:26 masak benabik: that will probably make it into the post.
19:27 benabik Hmmmm...
19:27 lue masak: that was a nice distraction from what I was about to do, which ultimately involves another one of your ridiculous puzzles :) . (bet you can't guess which one)
19:27 lue (also, my adverbs post. Probably should do that too ☺)
19:31 benabik Moving the method name parsing out of the returned block is significantly less clear.  (i.e. I got lost trying to write it)
19:34 benabik GTG
19:34 benabik masak: Glad to help.  :-)
19:45 masak lue: I bet I can't guess, no. but I'm gussing t4, which is occupying me these days.
19:46 lue masak: It's *a* t4, that's for sure :)
19:48 masak hehe.
19:50 lue I actually have a post detailing the first leg of ultimately discovering the number of solvable boards, I'm just working on a DLX solver because counting the number of configs for a 3x3 square board manually was stupid and most likely error prone :)
19:50 masak :)
19:51 * lue will probably be writing a DLX solver three times: 1st for perl6-j, 2nd in C, and 3rd in x86_64 assembler. Depending on if the previous iterations aren't fast enough :P
19:52 lue by "have a post", I mean "just need to rasterize the images that go with it", by the way :)
19:54 ajr joined #perl6
19:59 masak tomorrow's post: https://gist.github.com/masak/7863098
19:59 masak I will leave it up for review for now, and come back in a while to Wordpress-ify it and schedule it.
19:59 szabgab joined #perl6
19:59 szabgab rakudo: my $z = 10/0; say $z
19:59 camelia rakudo-jvm 0bf3de: OUTPUT«Divide by zero␤  in block  at gen/jvm/CORE.setting:889␤  in method bless at gen/jvm/CORE.setting:805␤  in method Str at gen/jvm/CORE.setting:9689␤  in block  at /tmp/uDbokTYmbq:1␤  in any eval at gen/jvm/stage2/NQPHLL.nqp:1086␤  in any evalfiles…»
19:59 camelia ..rakudo-parrot 0bf3de: OUTPUT«Divide by zero␤  in method sink at gen/parrot/CORE.setting:12028␤  in method BUILDALL at gen/parrot/CORE.setting:892␤  in method bless at gen/parrot/CORE.setting:812␤  in method new at gen/parrot/CORE.setting:797␤  in method new at gen/parrot/C…»
20:00 szabgab rakudo: my $z = 10/0; $z++
20:00 camelia rakudo-parrot 0bf3de, rakudo-jvm 0bf3de: ( no output )
20:01 szabgab so after the illegal division by 0, I can use $z for ++ but cannot print it?
20:01 szabgab rakudo: my $z = 10/0; $z++; print $z
20:01 camelia rakudo-jvm 0bf3de: OUTPUT«Divide by zero␤  in block  at gen/jvm/CORE.setting:889␤  in method bless at gen/jvm/CORE.setting:805␤  in method Str at gen/jvm/CORE.setting:9689␤  in block  at /tmp/1nZwu1PZwC:1␤  in any eval at gen/jvm/stage2/NQPHLL.nqp:1086␤  in any evalfiles…»
20:01 camelia ..rakudo-parrot 0bf3de: OUTPUT«Divide by zero␤  in method sink at gen/parrot/CORE.setting:12028␤  in method BUILDALL at gen/parrot/CORE.setting:892␤  in method bless at gen/parrot/CORE.setting:812␤  in method new at gen/parrot/CORE.setting:797␤  in method new at gen/parrot/C…»
20:01 lue r: say 10/0
20:01 camelia rakudo-jvm 0bf3de: OUTPUT«Divide by zero␤  in block  at gen/jvm/CORE.setting:889␤  in method bless at gen/jvm/CORE.setting:805␤  in method Str at gen/jvm/CORE.setting:9689␤  in block  at /tmp/wITFBL9ir0:1␤  in any eval at gen/jvm/stage2/NQPHLL.nqp:1086␤  in any evalfiles…»
20:01 camelia ..rakudo-parrot 0bf3de: OUTPUT«Divide by zero␤  in method sink at gen/parrot/CORE.setting:12028␤  in method BUILDALL at gen/parrot/CORE.setting:892␤  in method bless at gen/parrot/CORE.setting:812␤  in method new at gen/parrot/CORE.setting:797␤  in method new at gen/parrot/C…»
20:01 lue r: say 10.0/0.0
20:01 camelia rakudo-parrot 0bf3de: OUTPUT«Divide by zero␤  in method sink at gen/parrot/CORE.setting:12028␤  in method BUILDALL at gen/parrot/CORE.setting:892␤  in method bless at gen/parrot/CORE.setting:812␤  in method new at gen/parrot/CORE.setting:797␤  in method new at gen/parrot/C…»
20:01 camelia ..rakudo-jvm 0bf3de: OUTPUT«Divide by zero␤  in block  at gen/jvm/CORE.setting:889␤  in method bless at gen/jvm/CORE.setting:805␤  in method Str at gen/jvm/CORE.setting:9689␤  in block  at /tmp/rkPZMt0N7B:1␤  in any eval at gen/jvm/stage2/NQPHLL.nqp:1086␤  in any evalfiles…»
20:01 lue r: say 10e0/0e0
20:01 camelia rakudo-jvm 0bf3de: OUTPUT«Divide by zero␤  in block  at /tmp/Ife9XPqHqO:1␤  in any eval at gen/jvm/stage2/NQPHLL.nqp:1086␤  in any evalfiles at gen/jvm/stage2/NQPHLL.nqp:1292␤  in any command_eval at gen/jvm/stage2/NQPHLL.nqp:1196␤  in any command_eval at src/Perl6/Compile…»
20:01 camelia ..rakudo-parrot 0bf3de: OUTPUT«Divide by zero␤  in method gist at gen/parrot/CORE.setting:12020␤  in method gist at gen/parrot/CORE.setting:1014␤  in sub say at gen/parrot/CORE.setting:12920␤  in block  at /tmp/Xd4DRruGm0:1␤  in any  at /tmp/Xd4DRruGm0:1␤  in any  at gen/p…»
20:02 szabgab I am ok with the print throwing an exception, I am surprised the ++ did not do it
20:03 jnap joined #perl6
20:04 masak szabgab: that is indeed a bit surprising.
20:05 masak szabgab: generally, things that "use" a value should trigger the delayed exception.
20:05 szabgab rakudo: my $z = 10/0; $z+1;
20:05 camelia rakudo-parrot 0bf3de, rakudo-jvm 0bf3de: ( no output )
20:05 szabgab but:
20:05 szabgab rakudo: my $z = 10/0; $z+$z;
20:05 camelia rakudo-jvm 0bf3de: OUTPUT«Divide by zero␤  in sub infix:<+> at gen/jvm/CORE.setting:9815␤  in block  at /tmp/arVLBUGIzF:1␤  in any eval at gen/jvm/stage2/NQPHLL.nqp:1086␤  in any evalfiles at gen/jvm/stage2/NQPHLL.nqp:1292␤  in any command_eval at gen/jvm/stage2/NQPHLL.nqp…»
20:05 camelia ..rakudo-parrot 0bf3de: OUTPUT«Divide by zero␤  in method Numeric at gen/parrot/CORE.setting:12018␤  in sub infix:<*> at gen/parrot/CORE.setting:3932␤  in sub infix:<*> at gen/parrot/CORE.setting:3930␤  in sub infix:<+> at gen/parrot/CORE.setting:9843␤  in sub infix:<+> at g…»
20:06 szabgab hi masak!
20:06 lue I'm surprised 10/0 won't output a Nan or Inf like (I thought) it's supposed to.
20:06 lue s/Nan/NaN/
20:07 szabgab masak: so if I understand the actual division by 0 should not throw the exception, but the use of that value should, right?
20:08 japhb say DUMP(10/0)
20:08 japhb p: say DUMP(10/0)
20:08 camelia rakudo-parrot 0bf3de: OUTPUT«<1/0>␤»
20:08 japhb p: say DUMP(10e0/0e0)
20:08 camelia rakudo-parrot 0bf3de: OUTPUT«Failure<1>(␤    :exception(▶X::Numeric::DivideByZero<2>(␤        :using(▶Any),␤        :$!ex(Exception<4>(...))␤    )),␤    :$!handled(Any)␤)␤»
20:08 japhb p: say DUMP(1/0 + 1)
20:08 camelia rakudo-parrot 0bf3de: OUTPUT«<1/0>␤»
20:08 japhb p: say DUMP(1/0 + 2)
20:08 camelia rakudo-parrot 0bf3de: OUTPUT«<1/0>␤»
20:10 lue n: say <1/0>
20:10 camelia niecza v24-108-g17d73e4: OUTPUT«(timeout)[auto-compiling setting]␤»
20:10 japhb left #perl6
20:11 masak szabgab: right.
20:11 masak &
20:13 rewm joined #perl6
20:13 moritz masak++ # blog post
20:14 moritz masak: but maybe you should add that .^add_fallback is non-specced, and rakudo-guts only
20:14 lue masak++ # blog post too
20:15 Khisanth joined #perl6
20:16 obra joined #perl6
20:23 kaare_ joined #perl6
20:24 japhb joined #perl6
20:38 tgt joined #perl6
20:39 tgt joined #perl6
20:47 raiph joined #perl6
20:48 raiph masak: "graduating for their role as hash constituents" s/for/from/?
20:52 ajr_ "say $*CWD" is returning IO::Path<directoryname> rather than just directorynme; is that right?
20:52 raiph i like having something shorter than "interpolating", but "gut"?
20:52 FROGGS ajr_: say does these things since it calls .gist
20:52 raiph r-p: say $*CWD.WHAT
20:52 FROGGS ajr_: try print or say ~$*CWD
20:52 camelia rakudo-parrot 0bf3de: OUTPUT«(IO::Path)␤»
20:53 raiph r-p: say ~$*CWD
20:53 camelia rakudo-parrot 0bf3de: OUTPUT«/home/p6eval␤»
21:01 raiph masak: see above notes, plus what about: $0 ne '' ?? $r."c{$0}r"() !! $r ====> $0 ?? $r."c{$0}r"() !! $r
21:03 raiph anyhoo, ++masak++
21:03 ajr_ say $*CWD.WHAT returns(IO::Path)
21:04 jnap joined #perl6
21:04 ajr_ say ~$*CWD gives /home/guru/perl_6 (the correct answer)
21:04 ajr_ Where is the ~ explained?
21:04 raiph and raydiak++ too; another year of great p6 advent posts
21:05 FROGGS ajr_: ~ is string concat when being an infix, and same like method .Str when being a prefix
21:05 FROGGS ajr_: hold on, I'll grep you a link
21:07 ajr_ Thus say $*CWD.Str also gives /home/guru/perl_6
21:07 FROGGS ajr_: http://perlcabal.org/syn/S03.html#line_661
21:08 ajr_ Thanks, FROGGS
21:08 FROGGS ajr_: correct, $*CWD.Str will do too
21:08 FROGGS that is like:
21:08 FROGGS p: say +"42"
21:08 camelia rakudo-parrot 0bf3de: OUTPUT«42␤»
21:08 FROGGS p: say "42".Int
21:08 camelia rakudo-parrot 0bf3de: OUTPUT«42␤»
21:09 FROGGS ajr_: btw, the symbol of ~ even looks like a string, so it is easy to remember
21:10 ajr_ And $*CWD looks like a variable, which is why I was expecting it to return a value.
21:11 FROGGS ajr_: there is no sigil that indicates that something is an object
21:11 BenGoldberg joined #perl6
21:11 FROGGS and everything is an object btw :o)
21:12 FROGGS but yes, one does not expect that the CWD is more than a string at first
21:12 masak raiph, moritz: changes incorporated -- thank you.
21:12 masak proceeding to schedule in Wordpress.
21:13 ajr_ BTW, I've encountered an odd result when timing short programs; the times are getting LONGER, which is odd.
21:14 ajr_ Usually, repeating tests on Linux produces shorter times. thanks to caching.
21:15 ajr_ Things that look like variables but don't behave the same way violate the principle of Least Surprise, don't they?
21:16 FROGGS ajr_: 42 is an object too
21:16 FROGGS there is no surprise, at least not on my end
21:16 FROGGS p: say 42.^methods
21:16 camelia rakudo-parrot 0bf3de: OUTPUT«Int Num Rat FatRat abs Bridge chr sqrt base expmod is-prime floor ceiling round lsb msb sign conj rand sin asin cos acos tan atan atan2 sec asec cosec acosec cotan acotan sinh asinh cosh acosh tanh atanh sech asech cosech acosech cotanh acotanh unpolar c…»
21:18 ajr_ say 42 returns 42, which is reasonable behaviour for a constant
21:19 FROGGS ohh, I think you have more a problem with "say" that with $*CWD
21:19 FROGGS p: print $*CWD
21:19 camelia rakudo-parrot 0bf3de: OUTPUT«/home/p6eval»
21:20 FROGGS "say" is intended to give you the clue what something is, that is why IO::Path gistifies to its classname + path
21:20 FROGGS you only use "say" when presenting something to a human, probably a developer only
21:22 ajr_ Unlike P5, where they differ only in suffixing \n or not.
21:22 jnthn evening o/
21:22 FROGGS ajr_: correct
21:23 FROGGS hi jnthn, long time no see :o)
21:23 japhb o/
21:23 FROGGS hi japhb
21:23 FROGGS damn, it is getting full when I run out of power :/
21:23 jnthn I don't think I'll be about for so long :)
21:24 jnthn Shifted an hour east, and had an early morning...
21:24 FROGGS get_iter() not implemented in class 'Parcel' <--- jnthn, how do I pass an array from perl6 to nqp at best?
21:24 japhb jnthn: What TZ offset does that leave you with now?  +3?
21:24 jnthn +2 from UTC I guess, given it's not summer time
21:25 jnthn I'm normally +1
21:25 japhb Ah
21:25 jnthn In winter
21:25 masak post scheduled.
21:25 jnthn FROGGS: There's a FLATTENABLE_ARRAY thingy that likely does it
21:25 masak 'night, #perl6
21:25 raiph \o
21:25 FROGGS jnthn: I tried .FLATTENABLE_LIST, and now put this in [ ] also... compiling...
21:26 FROGGS jnthn: okay, that does that... but now loading JSON::Tiny fails with:
21:26 FROGGS Nominal type check failed for parameter '$got'; expected Any but got NQPClassHOW instead
21:26 jnthn Well, you probably need to nqp::findmethod($obj, 'FLA...')($obj) to frustrate the hllize
21:26 FROGGS ahh
21:27 rewm joined #perl6
21:28 FROGGS jnthn: thanks so far... dunno if my battery survives that though :o)
21:29 FROGGS I almost can bootstrap panda in my CompUnitRepo storage
21:31 jnthn Nice :)
21:32 FROGGS jnthn++ # lifesaver!!
21:33 * jnthn has been enjoying the snow and cheap beer :)
21:34 FROGGS :o)
21:34 jnthn There goes the battery... :)
21:39 jnap joined #perl6
21:52 SevenWolf joined #perl6
21:54 jnthn sleep...'night
21:55 Mouq joined #perl6
22:04 timotimo extended minichallenge based on masak's challenge from before:
22:04 timotimo make $my_pair.cddadda = "foo" autovivify a structure of pairs :P
22:04 hoelzro ahoy #perl6
22:04 BenGoldberg joined #perl6
22:07 hoelzro hmm
22:07 hoelzro is there a way I can build perl6, but then patch the grammar?
22:07 PacoAir joined #perl6
22:08 hoelzro so I can build the setting with an unadulterated compiler, but alter the grammar to behave differently when working on my program?
22:08 timotimo look at how jnthns Rakudo::Debugger does it, perhaps?
22:08 hoelzro hmm
22:08 timotimo (though that's in nqp-land)
22:08 hoelzro that's fine
22:08 hoelzro it's for debugging reasons
22:11 lue hoelzro: just so you know, slangs are supposed to let you do that (i.e. modify Perl 6 grammar in spots). Unfortunately, NYI.
22:11 hoelzro right
22:12 hoelzro I'm interested in doing this for debugging this stupid parser error
22:12 timotimo FROGGS++ for pushing the slangs implementation ahead with his p5 work
22:13 dalek rakudo-star-daily: 2a9ff9d | coke++ | log/ (5 files):
22:13 dalek rakudo-star-daily: today (automated commit)
22:13 dalek rakudo-star-daily: review: https://github.com/coke/rakudo-star-daily/commit/2a9ff9d91c
22:13 dalek perl6-roast-data: 3f27335 | coke++ | / (5 files):
22:13 dalek perl6-roast-data: today (automated commit)
22:13 dalek perl6-roast-data: review: https://github.com/coke/perl6-roast-data/commit/3f27335cd2
22:13 lue FROGGS++ indeed. I have to get back to them sometime, I've got some things that need answering (such as: what if you don't want to modify the actions side, just the grammar? What happens? Should we modify actions through inlined blocks, or would a slactions thing be better?)
22:14 lue *Should we still modify
22:15 timotimo masak++ # blog post
22:32 * dwarring busy writing up a Poker Hand post. Will put it up for review in a couple of days...
22:39 jnap joined #perl6
22:48 [Coke] anyone here building rakudo on the moar-support branch?
22:53 lizmat joined #perl6
22:54 lizmat masak: " # means the same as :blackberries(42)", I would say " # means the same as blackberries => $blackberries"
22:58 lizmat masak: maybe also a link to what "cadr-like method calls" are ?
22:58 lizmat masak++ for nice blog post!   Whee!
23:07 lizmat_ joined #perl6
23:19 lizmat gnight #perl6!
23:22 ikrs joined #perl6
23:22 zakharyas joined #perl6
23:22 cognominal joined #perl6
23:27 woolfy1 joined #perl6
23:29 ikrs joined #perl6
23:33 ikrs left #perl6
23:33 ikrs joined #perl6
23:40 jnap joined #perl6
23:40 Mouq joined #perl6
23:54 dalek perl6-roast-data: 6455f27 | coke++ | / (5 files):
23:54 dalek perl6-roast-data: today (automated commit)
23:54 dalek perl6-roast-data: review: https://github.com/coke/perl6-roast-data/commit/6455f270dd
23:54 dalek perl6-roast-data: dd6128c | coke++ | / (2 files):
23:54 dalek perl6-roast-data: Start running rakudo-moar...
23:54 dalek perl6-roast-data:
23:54 dalek perl6-roast-data: ... even though it doesn't build yet.
23:54 dalek perl6-roast-data: review: https://github.com/coke/perl6-roast-data/commit/dd6128cc9b
23:58 woolfy1 left #perl6

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

Perl 6 | Reference Documentation | Rakudo