»ö« 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:08 xenoterracide joined 00:10 rurban1 left 00:14 Rotwang left 00:16 xenoterracide left 00:18 xinming_ left 00:19 xinming joined 00:20 xenoterracide joined 00:22 BenGoldberg joined 00:26 FROGGS left 00:32 xenoterracide left 00:34 SevenWolf joined 00:36 BenGoldberg left 00:38 BenGoldberg joined, jeff_s1 joined 00:40 rurban1 joined 00:51 tgt left 01:00 thou left 01:02 jeffreykegler joined 01:09 Mouq joined 01:12 rurban1 left 01:13 Mouq left 01:29 kaare__ joined, jeffreykegler left 01:35 jnap left 01:40 xinming left 01:45 xinming joined 01:47 kivutar left 01:49 cognominal left 01:53 xinming left 01:54 xinming joined, jnap joined 01:55 lizmat left 02:01 cognominal joined 02:08 kaare__ left
raiph r: say sort *, 1, 2 # known issue? 02:10
camelia rakudo-parrot 56ee1a, rakudo-jvm 56ee1a: OUTPUT«1 2 *␤»
colomon r: say sort +*, 1, 2 02:11
camelia rakudo-parrot 56ee1a, rakudo-jvm 56ee1a: OUTPUT«1 2␤»
colomon …. * isn't code, is it? it's just a whatever 02:12
r: say sort 1, 2, 3
camelia rakudo-parrot 56ee1a, rakudo-jvm 56ee1a: OUTPUT«1 2 3␤»
raiph r-p: say *, 1 02:13
camelia rakudo-parrot 56ee1a: OUTPUT«*1␤»
02:14 thou joined 02:19 rurban1 joined 02:21 thou left 02:24 cognominal left 02:27 rurban1 left
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:34
02:42 xinming left 02:43 FROGGS joined, xinming joined
lue r: say sort {*, 1 ,2}(3) 02:48
camelia rakudo-parrot 56ee1a, rakudo-jvm 56ee1a: OUTPUT«1 2 *␤»
lue r: say sort {$^a, 1 ,2}(3)
camelia rakudo-parrot 56ee1a, rakudo-jvm 56ee1a: OUTPUT«1 2 3␤»
02:49 xinming left 02:50 xinming joined 02:57 Mouq joined 03:01 Mouq left 03:06 ssutch left 03:13 pmurias left 03:21 atroxaper joined 03:26 rurban1 joined 03:30 rurban1 left 03:37 jnap left 04:07 jnap joined 04:12 jnap left 04:20 preflex left 04:21 preflex_ joined, ChanServ sets mode: +v preflex_, preflex_ is now known as preflex 04:28 raiph left, rurban1 joined 04:30 cognominal joined 04:45 Mouq joined 04:46 atroxaper left 04:47 atroxaper joined 04:49 rurban1 left, atroxaper left, atroxaper joined, Mouq left, atroxaper left 04:52 Mouq joined 04:54 MikeFair left 04:56 Mouq left 05:09 BenGoldberg left, xinming left 05:10 xinming joined 05:18 raiph joined 05:21 xinming left 05:22 xinming joined 05:48 rurban1 joined, ssutch joined 06:09 jnap joined 06:13 jnap left 06:30 xinming left 06:37 darutoko joined 06:40 Mouq joined, xinming joined 06:45 Mouq left 06:47 SamuraiJack_ joined 06:59 SamuraiJack_ left 07:15 xenoterracide joined
moritz good morning 07:17
raydiak++ # p6advent post 07:27
07:37 raiph left 07:44 atroxaper joined
raydiak good morning, moritz++ # for suggesting I write a p6advent post 07:53
turned out to be a great idea, and I never would have volunteered to do it without that nudge 07:55
07:56 atroxaper left
raydiak (trying to convince lurkers who may be reading to join the fun) 07:58
08:06 kaare__ joined
diakopter raydiak++ # even though I haven't read it :) 08:11
08:11 jnap joined 08:15 jnap left
raydiak haha, thanks :) 08:28
08:28 Mouq joined 08:30 SamuraiJack_ joined 08:32 lizmat joined, rurban1 left, Mouq left 08:41 lizmat left
FROGGS jnthn: do you have an idea where I could start looking to solve that? gist.github.com/FROGGS/392471225039d60749d7 08:43
08:44 denisboyun joined
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
diakopter: magic and rainbows :o) 08:48
diakopter oooo :)
FROGGS diakopter: I put my own moduleloader in between, basically to locate modules by auth/name/ver 08:49
diakopter neat
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 08:50
08:51 ssutch left 09:00 SevenWolf left 09:06 lizmat joined 09:10 atroxaper joined, SamuraiJack_ left 09:13 cognominal left
lizmat good *, #perl6 on day 3 of the patch -p1 09:15
FROGGS hi lizmat 09:16
lizmat FROGGS o/
09:31 dmol joined 09:33 rurban1 joined, woolfy joined 09:40 rurban2 joined, FROGGS[mobile] joined 09:41 rurban1 left, filly left 09:44 rurban2 left, dmol left 09:47 dmol joined 09:50 Piers_ joined 09:58 kivutar joined
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
Example: gist.github.com/dagurval/9c238e886a57025153cc
also, two with the same key "hello"
should they not be the same? 10:03
10:04 tgt joined
dalek kudo/nom: 01755be | (Elizabeth Mattijsen)++ | src/Perl6/Actions.nqp:
Only need $/ for the first occurrence of attribute
10:08
ast: 05d6eae | (Elizabeth Mattijsen)++ | integration/role-composition-vs-attribute.t:
Some more private attribute related tests
10:09
lizmat dagurval: isn't that a parcel of pairs you're taking 10:10
hmmm;.. guess not
.oO( need more tea to wake up )
10:11
10:13 jnap joined 10:16 Mouq joined 10:17 jnap left
itz oh perl6-m works! 10:18
for certain values of works :)
10:21 Mouq left 10:22 spider-mario joined, Rotwang joined
lizmat dagurval: the take %a flattens into a list of pairs 10:25
being taken 10:26
I'm not sure whether that is according to spec or not
10:30 Piers_ left
lizmat TimToady: looking at Set/Bag/Mix/Quant again, I'm a little bit in two minds about this 10:37
10:37 cognominal joined
lizmat in the current implementation, Set/SetHash have much more in common with each other 10:38
than Set/Bag/Mix have with each other
10:40 rurban1 joined
FROGGS itz: yes, it does :o) 10:43
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:45
or disregard the spec in that respect 10:46
10:46 denisboyun left
lizmat (assuming the QuantHash is just a mystical beast) 10:46
or change the spec
10:47 kaare__ is now known as kaare_
moritz QuantSuperposHash? :-) 10:47
10:49 ssutch joined 10:52 denis_boyun joined 10:53 ssutch left
FROGGS p: use Test; say GLOBAL:: 11:04
camelia rakudo-parrot 56ee1a: OUTPUT«("Test" => Test).hash␤»
FROGGS what is in charge to stash Test there?
lizmat FROGGS: some code you missed in src/Perl6/ModuleLoader.nqp ? 11:07
FROGGS lizmat: I have no idea
lizmat merge_globals($target, $source) { ?? 11:09
FROGGS possible, though I don't see a difference there when executing the failing code and the working code 11:10
I think I need to add more debug output there... 11:13
11:13 rurban1 left 11:14 jnap joined 11:18 jnap left
lizmat jnthn: regarding visibility of private attributes of roles doing other roles 11:21
isn't that just a matter of making get_attribute_for_usage in src/Perl6/Metamodel/AttributeContainer.nqp smarter?
11:30 hummeleB1 joined
lizmat TimToady: on a slightly higher level: 11:44
if we can pun a role into a class 11:45
why do we have classes and inheritance at all?
if we would not have inheritance and classes, wouldn't that make the method cache obsolete 11:46
as we would know all the possible methods of a role at composition time already ?
11:47 SamuraiJack_ joined 12:04 Mouq joined 12:07 cognominal left, lizmat left 12:08 cognominal joined, lizmat joined 12:09 Mouq left, lizmat_ joined, lizmat left 12:10 rurban1 joined
FROGGS lizmat++ # it works now! thanks for pushing me in the right direction :o) 12:11
lizmat_ cool! FROGGS++ for not giving up! 12:14
12:14 jnap joined 12:19 lizmat joined, jnap left 12:20 cognominal__ joined, lizmat_ left, cognominal left 12:24 cognominal__ is now known as cognominal 12:33 sqirrel joined
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'␤»
moritz wut?
p: role A { has $!x };
camelia ( no output )
moritz p: class A { method m { $!x } } 12:37
camelia rakudo-parrot 01755b: OUTPUT«===SORRY!=== Error while compiling /tmp/bpVplkKOgW␤Attribute $!x not declared in class A␤at /tmp/bpVplkKOgW:1␤------> class A { method m { $!x } }⏏<EOL>␤ expecting any of:␤ postfix␤ stat…»
moritz oh
p: role R { has $!x }; class A does R { method m { $!x } }; say A.new.m
camelia rakudo-parrot 01755b: OUTPUT«(Any)␤»
moritz lizmat: we need classes because private attributes in roles aren't private to that role
12:43 rurban1 left, beastd joined
lizmat moritz: would that also apply to a punned role ? 12:43
12:44 kivutar left
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:52 kaare_ left
dalek kudo/nom: 05c2fef | (Elizabeth Mattijsen)++ | src/core/ (8 files):
Fix most of the nasty nqp::get_attr calls

Now that classes can see private role attributes
12:56
13:03 Celelaptop left 13:13 xinming_ joined 13:15 Celelaptop joined, xinming left 13:16 woolfy left 13:20 woolfy joined
lizmat jnthn: looking at implementing :$stop and :$times in ThreadPoolScheduler 13:35
so if I e.g. want to call "cancel" on $!timer, that would be something like 13:36
$!timer.'method/cancel/(Ljava/util/TimerTask;)V
?
13:37 xinming_ left, kivutar joined 13:38 xinming joined 13:39 kaare_ joined 13:42 rurban1 joined
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␤»
timotimo raydiak: i think in your method subtract you really wanted self.new instead of .new
13:47 Celelaptop left, rurban1 left 13:48 xinming left
timotimo raydiak: also, it might be nice to mention that »-« will actually do a dimension check for us automatically 13:48
13:49 xinming joined 13:52 Celelaptop joined
timotimo otherwise, a very good post, raydiak++ :) 13:52
13:53 Mouq joined 13:57 Mouq left 14:00 jnap joined
dalek ecs: ff201e6 | (Elizabeth Mattijsen)++ | S17-concurrency.pod:
Fix copy-n-pasto
14:08
14:19 V_S_C joined 14:22 xinming left 14:24 V_S_C left, xinming joined 14:28 Pleiades` joined 14:29 xenoterracide left 14:30 Pleiades` left 14:31 Pleiades` joined 14:32 colomon left 14:34 colomon joined 14:36 denis_boyun left 14:38 denisboyun joined 14:45 rurban1 joined 14:47 BenGoldberg joined 14:48 Mouq joined, Colby` joined 14:50 Pleiades` left 14:51 Pleiades` joined 14:53 Colby` left
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
as we can only cancel a timer, not a set of tasks scheduled on that timer
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:54
timotimo especially when the main program ends and you don't really want it to continue 14:55
or maybe you do
we don't in the case of spectests, though
lizmat exactly
15:05 jnap left
nwc10 good UGT, #perl6 15:08
FROGGS hi nwc10
lizmat nwc10!
15:12 kaare_ left 15:16 denis_boyun_ joined 15:17 rurban1 left, denisboyun left
dalek kudo/nom: a664d48 | (Elizabeth Mattijsen)++ | src/vm/jvm/core/ (2 files):
Implement *Scheduler.cue( :times )
15:32
ast: 5497844 | (Elizabeth Mattijsen)++ | S17-concurrency/scheduler.t:
Implement tests for $*SCHEDULER.cue( :times )
15:33
15:44 rurban1 joined 15:45 raiph joined 15:46 spider-mario left 15:53 lizmat left, lizmat joined 15:55 Rotwang left 15:58 rindolf joined, Psyche^_ joined 16:02 Psyche^ left 16:05 jnap joined 16:10 Rotwang joined, jnap left 16:11 rewm joined 16:22 MikeFair joined 16:23 sqirrel left 16:45 raiph left 16:47 atroxaper left
lizmat drops a pin 16:47
patch -p1 winding down 16:52
16:55 jnap joined 17:02 ajr joined 17:03 ajr is now known as Guest68262 17:06 Guest68262 is now known as ajr_ 17:09 woolfy left
lizmat goodbye from the Cité des Sciences, it was fun! 17:11
17:11 lizmat left 17:17 tgt left 17:23 cognominal left 17:37 timotimo joined 17:38 rewm left 17:40 colomon left, tgt joined 17:42 jnap left, colomon joined 17:47 kivutar left 17:48 rewm joined
timotimo nothing much going on today, eh? 17:54
dalek kudo/nom: 0bf3de5 | (Tobias Leich)++ | src/vm/ (3 files):
named params are optional by default
17:55
TimToady maybe everyone is working on their advent posts... 17:56
timotimo i'm not =o 17:57
17:57 jnap joined
FROGGS well, I try hard to have something to write about :/ 17:59
17:59 jnap left 18:01 jnap joined 18:06 zakalwe_ left 18:07 zakalwe joined 18:10 kivutar joined 18:12 sjohnson left 18:15 sqirrel joined
masak evening, #perl6 18:20
FROGGS evening #masak
masak oh, I'm on for tomorrow's advent post, aren't I? :)
FROGGS you are :o) 18:21
masak I better get started with it, then.
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:29
I would do it, but I haven't learned how to quickly-and-easily provide a custom metaclass for a class. 18:31
if you succeed, you will be favorably mentioned in tomorrow's advent post :)
18:33 Mouq left
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
masak what benabik said. 18:36
lue: it's a way to dig arbitrarily deep down into nested Pair structures.
lue: .car digs into the key, .cdr digs into the value. 18:37
lue: longer mixes of 'a' and 'd' letters dig more levels down.
lue cdaddr is apparently $pair.value.value.key.value :)
Hmmm....
benabik I thought it would be .value.key.value.value 18:38
masak no, lue is right.
lue benabik: start here: 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.
masak because method calls are LTR, whereas Lisp's function calls are (nested from within) RTL.
TimToady also, make it present list semantics when used as a list
lue r: class Foo { method FALLBACK(*@a) { say @a.perl } }; Foo.xyzzy(1);
TimToady unlike a Pair, which won't expand to a list naturally
camelia rakudo-jvm 0bf3de: OUTPUT«(timeout)»
..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…»
masak don't think FALLBACK is implemented.
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.
lue There goes the FALLBACK($meth-name) { idea :)
18:41 dwarring left 18:44 darutoko left
lue I suspect The Slides™ would help, even though they're about NQP... 18:44
18:45 rindolf left, rewm_ joined, benabik_ joined 18:46 Quom joined
lue wonders which of the SUBBUILDTIMEPLAN methods gives a class its metamodel, or if that's something else entirely... 18:47
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 18:50 Juerd_ joined, yeltzooo9 joined 18:53 spider-mario joined 18:54 Rix_ joined
benabik_ There does appear to be a .^add_fallback, but I'm failing at calling it and should be doing something else anyway. 18:54
18:54 Mouq left, rewm left, benabik left, Juerd left, yeltzooo left, Rix left, cxreg left, Rix_ is now known as Rix, Juerd_ is now known as Juerd, benabik_ is now known as benabik
lue Bah! Rakudo's BOOTSTRAP uses a 'metaclass' keyword, but it fails outside it :( 18:55
ideally, class Foo metaclass Bar
benabik src/Perl6/Metamodel/ClassHOW.nqp:66
lue: That's because it's an NQP keyword, not a P6 keyword. 18:56
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?
camelia rakudo-parrot 0bf3de, rakudo-jvm 0bf3de: OUTPUT«NOT »
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
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: 18:59
class Foo by BarHOW; (HOW does that class do it? "by" way of BarHOW) 19:00
19:00 SamuraiJack_ left
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
'metaclass' might be more Huffmanly.
lue Fits better with "is" and "does" at least :) 19:01
I agree though that "metaclass" is more Huffmany
19:01 ajr_ left
masak .oO( Huffm-y ) 19:02
19:02 ajr joined, ajr left
lue benabik: I suppose "by hand" is the only real way, unless one of those SUBBUILDTHINGTHINGS submethods can reassign the metamodel used. 19:02
19:02 jnap left, dwarring joined
benabik r: class Foo {}; Foo.^add_fallback(-> $, $ { True }, -> $, $name { -> $ {say $name} }); Foo.xyzzy 19:03
camelia rakudo-parrot 0bf3de, rakudo-jvm 0bf3de: OUTPUT«xyzzy␤»
masak \o/
benabik: you are my new friend :>
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.
The first parameter is "should I use this fallback?" and the second must return something to be called. 19:05
Yeah, looks that way. They're both called with $obj, $name in find_method_fallback 19:06
masak benabik++
so for .cdaddr, the first one could do a regex match on the name.
the second one could do some simple recursion down to the next level.
benabik I think you can return nqp::null() for the second one.
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 :)
benabik (Any and Mu certainly didn't work.)
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␤»
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«===SORRY!=== Error while compiling /tmp/29JFKQcFWg␤Unable to parse expression in block; couldn't find final '}' ␤at /tmp/29JFKQcFWg:1␤------> ), :value(B => (C => "D"))).cr("dd").say⏏<EOL>␤ expecting any of:…»
..rakudo-parrot 0bf3de: OUTPUT«===SORRY!=== Error while compiling /tmp/0FdnfAUH70␤Unable to parse expression in block; couldn't find final '}' ␤at /tmp/0FdnfAUH70:1␤------> ), :value(B => (C => "D"))).cr("dd").say⏏<EOL>␤ expecting any …»
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
camelia rakudo-parrot 0bf3de: OUTPUT«===SORRY!=== Error while compiling /tmp/hAYpxqgeFH␤Unable to parse expression in block; couldn't find final '}' ␤at /tmp/hAYpxqgeFH:1␤------> ), :value(B => (C => "D"))).cr("dd").say⏏<EOL>␤ expecting any …»
..rakudo-jvm 0bf3de: OUTPUT«===SORRY!=== Error while compiling /tmp/qL8T58mayU␤Unable to parse expression in block; couldn't find final '}' ␤at /tmp/qL8T58mayU:1␤------> ), :value(B => (C => "D"))).cr("dd").say⏏<EOL>␤ expecting any of:…»
19:11 Quom left
masak ...maybe time to do more experimentation offline, or in privmsg...? :) 19:11
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
masak benabik: [] was too short for what it did. 19:13
p: my %hash = foo => 1, bar => 2; sub x(:$foo) { say "OH HAI" }; x(|%hash)
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…»
benabik Yeah, but [] for a class is nearly at the level of muscle memory now. :-/ 19:14
masak yeah, I can see the problem. 19:15
lue Uh-oh 19:17
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«===SORRY!=== Error while compiling /tmp/_LysVf0jWL␤Variable $!name used where no 'self' is available␤at /tmp/_LysVf0jWL:1␤------> { True }, -> $, $name { -> $ {say $!name⏏; self.Bar} }); Foo.xyzzy␤»
..rakudo-parrot 0bf3de: OUTPUT«===SORRY!=== Error while compiling /tmp/6xzMPiC3Du␤Variable $!name used where no 'self' is available␤at /tmp/6xzMPiC3Du:1␤------> { True }, -> $, $name { -> $ {say $!name⏏; self.Bar} }); Foo.xyzzy␤»
lue r: class Foo { method Bar() { say "OK" }}; Foo.^add_fallback(-> $, $ { True }, -> $, $name { -> $ {say $name; self.Bar} }); Foo.xyzzy
camelia rakudo-jvm 0bf3de: OUTPUT«===SORRY!=== Error while compiling /tmp/Msgx6z5rg7␤'self' used where no object is available␤at /tmp/Msgx6z5rg7:1␤------> True }, -> $, $name { -> $ {say $name; ⏏self.Bar} }); Foo.xyzzy␤ expecting any of:␤…»
..rakudo-parrot 0bf3de: OUTPUT«===SORRY!=== Error while compiling /tmp/ZrCEweLkW4␤'self' used where no object is available␤at /tmp/ZrCEweLkW4:1␤------> True }, -> $, $name { -> $ {say $name; ⏏self.Bar} }); Foo.xyzzy␤ expecting any of:…»
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.
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␤»
lue masak: ^^^ :D
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
camelia rakudo-parrot 0bf3de, rakudo-jvm 0bf3de: OUTPUT«3␤»
lue (the cr method is publically available, but whatever.)
masak lue: nice ;) 19:24
p: (sub (:$foo) { say $foo })(|Pair.new(:key<foo>, :value("OH HAI")))
camelia rakudo-parrot 0bf3de: OUTPUT«OH HAI␤»
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
benabik: that will probably make it into the post. 19:26
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)
(also, my adverbs post. Probably should do that too ☺) 19:28
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:31
GTG 19:34
masak: Glad to help. :-)
19:40 obra left
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 :)
masak hehe. 19:48
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
by "have a post", I mean "just need to rasterize the images that go with it", by the way :) 19:52
19:54 ajr joined, ajr is now known as Guest14556
masak tomorrow's post: gist.github.com/masak/7863098 19:59
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
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…»
..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…»
szabgab rakudo: my $z = 10/0; $z++ 20:00
camelia ( no output )
szabgab so after the illegal division by 0, I can use $z for ++ but cannot print it? 20:01
rakudo: my $z = 10/0; $z++; print $z
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…»
..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…»
lue r: say 10/0
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…»
..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…»
lue r: say 10.0/0.0
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…»
..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…»
lue r: say 10e0/0e0
20:01 Khisanth left
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:02
..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…»
szabgab I am ok with the print throwing an exception, I am surprised the ++ did not do it
20:03 jnap joined 20:04 Guest14556 is now known as ajr_
masak szabgab: that is indeed a bit surprising. 20:04
szabgab: generally, things that "use" a value should trigger the delayed exception. 20:05
szabgab rakudo: my $z = 10/0; $z+1;
camelia ( no output )
szabgab but:
rakudo: my $z = 10/0; $z+$z;
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…»
..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…»
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.
s/Nan/NaN/
20:06 rewm_ left
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:07
20:07 jnap left
japhb say DUMP(10/0) 20:08
p: say DUMP(10/0)
camelia rakudo-parrot 0bf3de: OUTPUT«<1/0>␤»
japhb p: say DUMP(10e0/0e0)
camelia rakudo-parrot 0bf3de: OUTPUT«Failure<1>(␤ :exception(▶X::Numeric::DivideByZero<2>(␤ :using(▶Any),␤ :$!ex(Exception<4>(...))␤ )),␤ :$!handled(Any)␤)␤»
japhb p: say DUMP(1/0 + 1)
camelia rakudo-parrot 0bf3de: OUTPUT«<1/0>␤»
japhb p: say DUMP(1/0 + 2)
camelia rakudo-parrot 0bf3de: OUTPUT«<1/0>␤»
lue n: say <1/0> 20:10
camelia niecza v24-108-g17d73e4: OUTPUT«(timeout)[auto-compiling setting]␤»
20:10 japhb left
masak szabgab: right. 20:11
&
20:13 rewm joined
moritz masak++ # blog post 20:13
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 20:16 obra joined 20:23 kaare_ joined 20:24 sqirrel left, japhb joined 20:30 tgt left 20:32 rewm left 20:35 szabgab left 20:38 tgt joined, tgt left 20:39 tgt joined 20:47 raiph joined
raiph masak: "graduating for their role as hash constituents" s/for/from/? 20:48
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"?
FROGGS ajr_: say does these things since it calls .gist
raiph r-p: say $*CWD.WHAT
FROGGS ajr_: try print or say ~$*CWD
camelia rakudo-parrot 0bf3de: OUTPUT«(IO::Path)␤»
raiph r-p: say ~$*CWD 20:53
camelia rakudo-parrot 0bf3de: OUTPUT«/home/p6eval␤»
raiph masak: see above notes, plus what about: $0 ne '' ?? $r."c{$0}r"() !! $r ====> $0 ?? $r."c{$0}r"() !! $r 21:01
anyhoo, ++masak++ 21:03
21:03 BenGoldberg left
ajr_ say $*CWD.WHAT returns(IO::Path) 21:03
21:04 jnap joined
ajr_ say ~$*CWD gives /home/guru/perl_6 (the correct answer) 21:04
Where is the ~ explained?
raiph and raydiak++ too; another year of great p6 advent posts
FROGGS ajr_: ~ is string concat when being an infix, and same like method .Str when being a prefix 21:05
ajr_: hold on, I'll grep you a link
ajr_ Thus say $*CWD.Str also gives /home/guru/perl_6 21:07
FROGGS ajr_: perlcabal.org/syn/S03.html#line_661
ajr_ Thanks, FROGGS 21:08
FROGGS ajr_: correct, $*CWD.Str will do too
that is like:
p: say +"42"
camelia rakudo-parrot 0bf3de: OUTPUT«42␤»
FROGGS p: say "42".Int
21:08 jnap left
camelia rakudo-parrot 0bf3de: OUTPUT«42␤» 21:08
FROGGS ajr_: btw, the symbol of ~ even looks like a string, so it is easy to remember 21:09
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
FROGGS and everything is an object btw :o) 21:11
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.
proceeding to schedule in Wordpress.
ajr_ BTW, I've encountered an odd result when timing short programs; the times are getting LONGER, which is odd. 21:13
Usually, repeating tests on Linux produces shorter times. thanks to caching. 21:14
Things that look like variables but don't behave the same way violate the principle of Least Surprise, don't they? 21:15
FROGGS ajr_: 42 is an object too 21:16
there is no surprise, at least not on my end
p: say 42.^methods
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:17
ajr_ say 42 returns 42, which is reasonable behaviour for a constant 21:18
FROGGS ohh, I think you have more a problem with "say" that with $*CWD 21:19
p: print $*CWD
camelia rakudo-parrot 0bf3de: OUTPUT«/home/p6eval»
FROGGS "say" is intended to give you the clue what something is, that is why IO::Path gistifies to its classname + path 21:20
you only use "say" when presenting something to a human, probably a developer only 21:21
ajr_ Unlike P5, where they differ only in suffixing \n or not. 21:22
jnthn evening o/
FROGGS ajr_: correct
hi jnthn, long time no see :o) 21:23
japhb o/
FROGGS hi japhb
damn, it is getting full when I run out of power :/
jnthn I don't think I'll be about for so long :)
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?
japhb jnthn: What TZ offset does that leave you with now? +3?
jnthn +2 from UTC I guess, given it's not summer time 21:25
I'm normally +1
japhb Ah
jnthn In winter
masak post scheduled.
jnthn FROGGS: There's a FLATTENABLE_ARRAY thingy that likely does it
masak 'night, #perl6
raiph \o
FROGGS jnthn: I tried .FLATTENABLE_LIST, and now put this in [ ] also... compiling...
jnthn: okay, that does that... but now loading JSON::Tiny fails with: 21:26
Nominal type check failed for parameter '$got'; expected Any but got NQPClassHOW instead
jnthn Well, you probably need to nqp::findmethod($obj, 'FLA...')($obj) to frustrate the hllize
FROGGS ahh
21:27 kaare_ left, rewm joined 21:28 ajr_ left
FROGGS jnthn: thanks so far... dunno if my battery survives that though :o) 21:28
I almost can bootstrap panda in my CompUnitRepo storage 21:29
jnthn Nice :) 21:31
FROGGS jnthn++ # lifesaver!! 21:32
jnthn has been enjoying the snow and cheap beer :) 21:33
FROGGS :o) 21:34
21:34 FROGGS left
jnthn There goes the battery... :) 21:34
21:39 jnap joined 21:43 jnap left 21:52 SevenWolf joined
jnthn sleep...'night 21:54
21:55 Mouq joined 21:56 beastd left 22:02 BenGoldberg left
timotimo extended minichallenge based on masak's challenge from before: 22:04
make $my_pair.cddadda = "foo" autovivify a structure of pairs :P
hoelzro ahoy #perl6
22:04 BenGoldberg joined
hoelzro hmm 22:07
22:07 PacoAir left
hoelzro is there a way I can build perl6, but then patch the grammar? 22:07
22:07 PacoAir joined
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?
hoelzro hmm
timotimo (though that's in nqp-land)
hoelzro that's fine
it's for debugging reasons
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
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
dalek kudo-star-daily: 2a9ff9d | coke++ | log/ (5 files):
today (automated commit)
22:13
rl6-roast-data: 3f27335 | coke++ | / (5 files):
today (automated commit)
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?)
*Should we still modify 22:14
22:14 spider-mario left
timotimo masak++ # blog post 22:15
dwarring busy writing up a Poker Hand post. Will put it up for review in a couple of days... 22:32
22:39 jnap joined 22:40 hummeleB1 left 22:44 jnap left
[Coke] anyone here building rakudo on the moar-support branch? 22:48
22:53 lizmat joined
lizmat masak: " # means the same as :blackberries(42)", I would say " # means the same as blackberries => $blackberries" 22:54
masak: maybe also a link to what "cadr-like method calls" are ? 22:58
masak++ for nice blog post! Whee!
23:07 lizmat_ joined 23:09 Rotwang left 23:10 lizmat left 23:17 lizmat_ is now known as lizmat
lizmat gnight #perl6! 23:19
23:22 ikrs joined, tgt left, zakharyas joined, cognominal joined 23:23 Mouq left 23:26 denis_boyun_ left 23:27 dmol left, woolfy1 joined 23:29 ikrs left, ikrs joined 23:33 ikrs left, ikrs joined 23:40 jnap joined, Mouq joined 23:45 jnap left 23:46 dwarring left 23:54 Mouq left
dalek rl6-roast-data: 6455f27 | coke++ | / (5 files):
today (automated commit)
23:54
rl6-roast-data: dd6128c | coke++ | / (2 files):
Start running rakudo-moar...

  ... even though it doesn't build yet.
23:58 woolfy1 left