Perl 6 - the future is here, just unevenly distributed

IRC log for #perl6, 2015-05-07

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:01 Akagi201 joined #perl6
00:19 jack_rabbit_ joined #perl6
00:26 skids joined #perl6
00:28 raiph joined #perl6
00:40 laouji joined #perl6
00:43 laouji joined #perl6
00:43 pdcawley joined #perl6
01:05 Celelibi joined #perl6
01:14 labster m: "|".IO.perl.EVAL
01:14 camelia rakudo-moar af823c: OUTPUT«Method 'IO' not found for invocant of class 'Any'␤  in block <unit> at EVAL_0:1␤  in any <unit-outer> at EVAL_0:1␤  in block <unit> at /tmp/zFcIhD9qTq:1␤␤»
01:14 labster m: "foo|bar".IO.perl.EVAL
01:14 camelia rakudo-moar af823c: OUTPUT«5===SORRY!5=== Error while compiling EVAL_0␤Two terms in a row␤at EVAL_0:1␤------> 3q|foo|7⏏5bar|.IO(:SPEC(IO::Spec::Unix),:CWD</home␤    expecting any of:␤        infix␤        infix stopper␤        statement end␤        statemen…»
01:16 labster m: "foo".IO.perl.EVAL.say
01:16 camelia rakudo-moar af823c: OUTPUT«"/home/camelia/foo".IO␤»
01:17 Akagi201 joined #perl6
01:17 colomon joined #perl6
01:21 chenryn joined #perl6
01:24 aborazmeh joined #perl6
01:24 aborazmeh joined #perl6
01:30 yeahnoob joined #perl6
01:32 lembark joined #perl6
01:46 BenGoldberg joined #perl6
01:47 chenryn joined #perl6
01:51 aborazmeh joined #perl6
01:51 aborazmeh joined #perl6
01:56 vendethiel joined #perl6
02:12 konsolebox joined #perl6
02:14 konsolebox joined #perl6
02:15 noganex_ joined #perl6
02:15 jack_rabbit_ joined #perl6
02:17 kurahaupo joined #perl6
02:18 jack_rabbit joined #perl6
02:20 dayangkun joined #perl6
02:25 rmgk_ joined #perl6
02:30 lembark joined #perl6
02:49 lembark joined #perl6
02:59 Sqirrel joined #perl6
03:00 cognominal joined #perl6
03:18 laouji_ joined #perl6
03:28 mr-foobar joined #perl6
03:50 lembark joined #perl6
04:01 aindilis joined #perl6
04:08 jack_rabbit joined #perl6
04:19 chenryn joined #perl6
04:28 kaare_ joined #perl6
04:29 jack_rabbit joined #perl6
04:35 dalek rakudo-star-daily: cc8774d | coke++ | log/ (2 files):
04:35 dalek rakudo-star-daily: today (automated commit)
04:35 dalek rakudo-star-daily: review: https://github.com/coke/rakudo-star-daily/commit/cc8774d550
04:35 hobbs joined #perl6
04:44 lembark joined #perl6
04:49 diana_olhovik_ joined #perl6
05:27 lembark joined #perl6
05:31 aborazmeh joined #perl6
05:31 aborazmeh joined #perl6
06:01 domidumont joined #perl6
06:02 laouji joined #perl6
06:06 domidumont joined #perl6
06:15 diana_olhovik joined #perl6
06:26 mr-foobar joined #perl6
06:51 RabidGravy joined #perl6
06:53 laouji joined #perl6
07:03 quester joined #perl6
07:08 zakharyas joined #perl6
07:11 bjz joined #perl6
07:11 Alina-malina joined #perl6
07:14 [Sno] joined #perl6
07:21 bjz joined #perl6
07:21 Ven joined #perl6
07:25 mr-foobar joined #perl6
07:29 Ven \o, #perl6!
07:34 abraxxa joined #perl6
07:36 larion joined #perl6
07:36 bjz joined #perl6
07:37 darutoko joined #perl6
07:37 rindolf joined #perl6
07:44 gtodd joined #perl6
07:45 lizmat joined #perl6
07:45 lizmat good *, #perl6!
07:45 lizmat http://openjdk.java.net/projects/panama/   # wonder if this could be of interest to rakudo on jvm users
07:54 kst` joined #perl6
07:55 lizmat joined #perl6
07:56 lizmat m: my $a will begin { $_ = 42 }; say $a
07:56 camelia rakudo-moar af823c: OUTPUT«5===SORRY!5=== Error while compiling /tmp/j_k4AQLrsz␤Cannot assign to an immutable value␤at /tmp/j_k4AQLrsz:1␤»
07:57 gtodd1 joined #perl6
07:59 bjz joined #perl6
08:02 dalek rakudo/nom: a34d024 | lizmat++ | / (2 files):
08:02 dalek rakudo/nom: Make my $a will begin { $_ = 42 } work
08:02 dalek rakudo/nom: review: https://github.com/rakudo/rakudo/commit/a34d024092
08:02 xfix joined #perl6
08:04 labster m: 3.path # I should be deprecated
08:04 camelia rakudo-moar af823c: ( no output )
08:08 lizmat m: 3.IO.perl.say
08:08 camelia rakudo-moar af823c: OUTPUT«q|3|.IO(:SPEC(IO::Spec::Unix),:CWD</home/camelia>)␤»
08:08 virtualsue joined #perl6
08:09 lizmat .oO( need some inspiration to get back to the newio branch )
08:10 lizmat but meanwhile, commute to Oslo &
08:14 telex joined #perl6
08:25 fhelmberger joined #perl6
08:27 gtodd joined #perl6
08:30 dakkar joined #perl6
08:32 btyler timotimo: fun to see you mention ZK -- I wrote the run animation for some of the walker bots years and years ago :)
08:34 Isp-sec joined #perl6
08:36 |Tux| joined #perl6
08:37 larion joined #perl6
08:49 domidumont joined #perl6
08:49 pecastro joined #perl6
08:53 brrt joined #perl6
08:54 espadrine_ joined #perl6
09:03 itz damm missing jnthn tutorial in .no .. I hope it's re-appearing over the summer at YAPC::EU or somewhere else?
09:04 nwc10 oh g.noes
09:07 FROGGS joined #perl6
09:07 brrt jnthn giving tutorials again
09:07 brrt how come i didn't know
09:08 itz it does look like perl6.101 rather than jit.301 :)
09:13 FROGGS [Coke] / bartolin: do you already have a way to know what test files in roast we do *not* run?
09:13 brrt fair enough :-)
09:13 FROGGS [Coke] / bartolin: I found it quite surprising that we did not run S05-capture/alias.t until yesterday
09:17 dalek perl6-examples: bff64aa | paultcochrane++ | categories/rosalind/trie-grondilu.pl:
09:17 dalek perl6-examples: [rosalind] simplify command line data input
09:17 dalek perl6-examples: review: https://github.com/perl6/perl6-examples/commit/bff64aae00
09:17 dalek perl6-examples: 5f3c6ac | paultcochrane++ | categories/rosalind/trie-grondilu.pl:
09:17 dalek perl6-examples: [rosalind] Add usage information
09:17 dalek perl6-examples: review: https://github.com/perl6/perl6-examples/commit/5f3c6ac101
09:17 dalek perl6-examples: d08200a | paultcochrane++ | lib/Pod/Htmlify.pm6:
09:17 dalek perl6-examples: Sort menu tabs
09:17 dalek perl6-examples: review: https://github.com/perl6/perl6-examples/commit/d08200aa2e
09:17 dalek perl6-examples: 1fbd9ec | paultcochrane++ | categories/rosalind/trie-grondilu.pl:
09:17 dalek perl6-examples: [rosalind] add problem description to trie example
09:17 dalek perl6-examples: review: https://github.com/perl6/perl6-examples/commit/1fbd9ecd11
09:17 dalek perl6-examples: 29b25be | paultcochrane++ | / (4 files):
09:17 dalek perl6-examples: Merge branch 'master' of github.com:perl6/perl6-examples
09:17 dalek perl6-examples: review: https://github.com/perl6/perl6-examples/commit/29b25be00c
09:18 andreoss joined #perl6
09:18 dalek perl6-examples: 9702a33 | paultcochrane++ | lib/Pod/Htmlify.pm6:
09:18 dalek perl6-examples: Loop over categories table sorted by key
09:18 dalek perl6-examples: review: https://github.com/perl6/perl6-examples/commit/9702a339e2
09:24 _mg_ joined #perl6
09:26 FROGGS std: class Foo { has $.x is rw }; class Bar is Foo { }; my Foo $u .= new(:5x); say $u.x; $u = Bar.new(Foo{:12x});
09:26 camelia std 28329a7: OUTPUT«ok 00:00 143m␤»
09:28 FROGGS std: class Foo { has $.x is rw }; class Bar is Foo { }; my Foo $u .= new(:5x); say $u.x; $u = Bar.new(Foo::x => 12);
09:28 camelia std 28329a7: OUTPUT«5===SORRY!5===␤Preceding context expects a term, but found infix => instead at /tmp/lZ7s0c3QBi line 1:␤------> 3new(:5x); say $u.x; $u = Bar.new(Foo::x 7⏏5=> 12);␤Parse failed␤FAILED 00:00 140m␤»
09:29 FROGGS I think I'd prefer this to set the parent's attribute
09:29 FROGGS Foo{ ... } just looks weird IMO
09:29 FROGGS TimToady: what do you think?
09:31 quester left #perl6
09:31 FROGGS or is Foo::x already a sub call?
09:32 FROGGS m: class Foo { }; say (Foo{:12x})
09:32 camelia rakudo-moar a34d02: OUTPUT«(Any)␤»
09:32 FROGGS m: class Foo { }; say (Foo{:12x}).WHAT
09:32 camelia rakudo-moar a34d02: OUTPUT«(Any)␤»
09:32 FROGGS hmmm
09:33 rba_ joined #perl6
09:33 FROGGS and one would have to repeat the Foo:: for every attr in my proposed version
09:34 RabidGravy I think there needs to be something on the run time application of roles in the http://docs.perl6.org/language/objects#Roles - will do that later
09:35 domidumont joined #perl6
09:40 RabidGravy right, off out to strike my blow for democracy now.  catch y'all later.
09:40 virtualsue joined #perl6
09:40 itz "vote early, vote often"
09:41 DrForr Chicago FTW.
09:46 TimToady joined #perl6
09:48 Zoffix joined #perl6
09:51 brrt oh, yeah, good luck british people
09:56 rba_ joined #perl6
09:56 brrt try not to make any irrevocable geopolitical mess
09:57 itz we've out sourced that to the EU ;)
09:57 dalek rakudo/nom: 89c43cc | FROGGS++ | t/spectest.data:
09:57 dalek rakudo/nom: run test S12-class/parent_attributes.t
09:57 dalek rakudo/nom: review: https://github.com/rakudo/rakudo/commit/89c43ccb31
09:58 dalek roast: 80cd397 | FROGGS++ | S12-class/parent_attributes.t:
09:58 dalek roast: RT #125129 skip test for initializing parent attrs
09:58 dalek roast: review: https://github.com/perl6/roast/commit/80cd397515
09:58 synbot6 Link:  https://rt.perl.org/rt3/Public/Bug/Display.html?id=125129
09:58 Ven joined #perl6
10:03 bjz joined #perl6
10:21 grondilu joined #perl6
10:26 RabidGravy joined #perl6
10:26 FROGGS joined #perl6
10:28 ssqq joined #perl6
10:32 grondilu joined #perl6
10:33 grondilu Hello.  What is this 'will' thing and where is it documented? (it's no easy to grep it in the spec)
10:34 * grondilu grepped C<will> and found something in S14
10:35 FROGGS [Coke] / bartolin: nvm, I've got a one-liner that does what I need
10:35 RabidGravy grondilu, http://design.perl6.org/S14.html#Traits
10:39 RabidGravy the actually implemented traits may or may not be documented elsewhere
10:44 bjz joined #perl6
10:53 cygx joined #perl6
10:53 cygx o/
10:54 grondilu m: say (^100)[*-10 .. *-1];
10:54 camelia rakudo-moar 89c43c: OUTPUT«90 91 92 93 94 95 96 97 98 99␤»
10:54 cygx Is https://github.com/cygx/p6-tinycc/commit/bb9fbea852d468b5a7c2365e9b9baf6413a607b1 the correct way to declare callback parameter in NativeCall?
10:55 uncleyear joined #perl6
10:55 grondilu m: my @primes = 2, grep *.is-prime, (3, 5 ... 999_997); say @primes[*-10..*-1]; # wondering if this is supposed to be fast
10:55 cygx (the native trait gets applied in EXPORT to a .clone of that sub)
10:55 uncleyear joined #perl6
10:55 camelia rakudo-moar 89c43c: OUTPUT«(timeout)»
11:02 chenryn joined #perl6
11:02 timotimo grondilu, try a simple range instead?
11:05 FROGGS cygx: there needs to be whitespace between the param name and the signature
11:05 FROGGS cygx: dunno if that's all
11:14 cygx FROGGS: Rakudo helpfully told me I should use :() for signatures
11:14 cygx FROGGS: but I only got it to parse by omitting the name
11:14 cygx so what should it read?
11:14 cygx sub tcc_set_error_func(Pointer, Pointer, &cb (Pointer, Str))
11:28 FROGGS yes, that should work
11:36 cygx sadly, it does not for me :(
11:36 cygx if anyone else wants to look into it, here's a test case: https://gist.github.com/cygx/2f4aecee744fccefcab9
11:37 cygx I used a recent version of TCC from http://repo.or.cz/w/tinycc.git
11:40 _mg_ joined #perl6
11:44 rbaumer joined #perl6
11:45 konsolebox joined #perl6
11:46 dalek roast: 66f2576 | FROGGS++ | S02-literals/pod.t:
11:46 dalek roast: fudge test because of a bug and lang spec reasons
11:46 dalek roast: review: https://github.com/perl6/roast/commit/66f2576f3c
11:48 andreoss joined #perl6
11:49 raiph joined #perl6
11:50 FROGGS joined #perl6
11:51 andreoss m: my $x = 1; let $x = EVAL 'die'; say $x
11:51 camelia rakudo-moar 89c43c: OUTPUT«Died␤  in block <unit> at EVAL_0:1␤  in any <unit-outer> at EVAL_0:1␤  in block <unit> at /tmp/KTX74XZIEP:1␤␤»
11:54 nwc10 a
11:56 rba_ joined #perl6
11:59 dalek roast: fd322e4 | FROGGS++ | S02-magicals/block.t:
11:59 dalek roast: skip &?BLOCK test on rakudo, RT 125131
11:59 dalek roast: review: https://github.com/perl6/roast/commit/fd322e4da5
12:06 rba_ joined #perl6
12:06 [Sno] joined #perl6
12:06 sue_ joined #perl6
12:10 FROGGS joined #perl6
12:10 dalek roast: dcbfdc7 | FROGGS++ | S02-magicals/subname.t:
12:10 dalek roast: bring subroutine name tests in shape
12:10 dalek roast: review: https://github.com/perl6/roast/commit/dcbfdc701c
12:14 rba_ joined #perl6
12:20 nwc10 domm++ # giving a talk that keeps FROGGS hacking :-)
12:22 FROGGS *g*
12:29 dalek roast: ae9c765 | FROGGS++ | S04-statements/when.t:
12:29 dalek roast: skip tests for NYI'd exception type RT #125132
12:29 dalek roast: review: https://github.com/perl6/roast/commit/ae9c765e2e
12:29 synbot6 Link:  https://rt.perl.org/rt3/Public/Bug/Display.html?id=125132
12:36 aborazmeh joined #perl6
12:36 aborazmeh joined #perl6
12:41 mr-foobar joined #perl6
12:48 dalek roast: c719c99 | FROGGS++ | S05-modifier/repetition-exhaustive.t:
12:48 dalek roast: fudge test about too greedy captures RT 125133
12:48 dalek roast: review: https://github.com/perl6/roast/commit/c719c99e68
12:48 RabidGravy joined #perl6
12:50 cygx left #perl6
12:53 brrt joined #perl6
12:56 cschwenz joined #perl6
12:59 muraiki joined #perl6
13:00 bbkr joined #perl6
13:01 cognominal joined #perl6
13:11 Akagi201 joined #perl6
13:14 [Sno] joined #perl6
13:17 rba_ joined #perl6
13:28 rajmund joined #perl6
13:31 larion joined #perl6
13:31 dalek doc: c092762 | paultcochrane++ | lib/Type/List.pod:
13:31 dalek doc: Update classify() example output
13:31 dalek doc: review: https://github.com/perl6/doc/commit/c092762ada
13:31 dalek doc: 6b192ff | paultcochrane++ | lib/ (3 files):
13:31 dalek doc: Merge branch 'master' of github.com:perl6/doc
13:31 dalek doc: review: https://github.com/perl6/doc/commit/6b192ff2fc
13:37 skids joined #perl6
13:40 cognominal joined #perl6
13:47 rba_ joined #perl6
13:48 Akagi201_ joined #perl6
13:51 mattp_ joined #perl6
14:12 Sqirrel joined #perl6
14:16 aborazmeh joined #perl6
14:16 aborazmeh joined #perl6
14:23 rba_ joined #perl6
14:28 lolisa joined #perl6
14:33 Ven joined #perl6
14:47 jnthn evening, #pelr6
14:47 jnthn *perl :)
14:47 RabidGravy erp
14:48 dalek perl6-examples: 8a8cb90 | paultcochrane++ | categories/euler/prob151-shlomif.p6:
14:48 dalek perl6-examples: [euler] add docs for solution to problem 151
14:48 dalek perl6-examples: review: https://github.com/perl6/perl6-examples/commit/8a8cb9084b
14:48 dalek perl6-examples: 90ef9b2 | paultcochrane++ | categories/euler/prob151-shlomif.p6:
14:48 dalek perl6-examples: Correct expected result
14:48 hoelzro morning #perl6
14:48 [ptc] oh dear, there I go killing dalek again...
14:49 dalek joined #perl6
14:49 moritz [ptc]++ # only a killed dalek is a good dalek
14:50 [ptc] heh :-)
14:55 bs4h joined #perl6
14:58 araujo joined #perl6
15:00 nwc10 this dalek seems to have more lives than a cat
15:00 nwc10 impossible to exterminate it
15:01 bs4h left #perl6
15:01 nwc10 FROGGS is live again
15:01 nwc10 (That's why he has pinged out)
15:02 Ven I've seen pypy.js linked here, but it's actually more impressive than it first looked!
15:02 Ven "An rpython JIT backend that emits asmjs at runtime: ./deps/pypy/rpython/jit/backend/asmjs/."
15:06 raiph joined #perl6
15:14 vendethiel joined #perl6
15:21 gfldex joined #perl6
15:26 masak afternoon, #perl6
15:27 nwc10 heresy! :-)
15:31 nwc10 although it would explain why I'm feeling a bit tired.
15:37 chenryn joined #perl6
15:38 timotimo evening
15:38 nwc10 "herersier" :-)
15:38 rba_ joined #perl6
15:39 TimToady .tell FROGGS it seems to me that Foo::x doesn't scale well to multiple attributes, but I agree Foo{} is weird, so maybe we can think of something better
15:39 yoleaux TimToady: I'll pass your message to FROGGS.
15:43 tinyblak joined #perl6
15:43 rindolf joined #perl6
15:46 chenryn joined #perl6
15:53 jnthn TimToady: Bah, I was gonna implement Foo{...} in the near future; it's been one of those "easy enough" things that I never quite got to... :)
15:53 vendethiel joined #perl6
15:53 japhb What is FROGGS speaking about this session?
15:53 timotimo what does the "glob" function in perl5 do? search for files by shell expression?
15:53 japhb jnthn: Can we get yoleaux in #moarvm, or is there a reason not to?
15:54 japhb timotimo: Yeah, basically
15:54 jnthn japhb: I don't mind yoleaux being there, though most people on the channel are also on #perl6 :)
15:54 japhb (There are some details about *which* shell expansion, but yeah)
15:54 jnthn japhb: and so can use the bot there
15:54 jnthn japhb: And the bot doesn't namespace .tell's by channel anyways :)
15:55 japhb jnthn: Yeah, I just figured to .ask questions or .tell things in the right channel, but if it doesn't namespace, I guess that doesn't matter much.
15:55 chenryn joined #perl6
15:55 japhb Speaking of yoleaux uses ...
15:55 itz such as the standard Unix shell /bin/csh would do
15:55 itz :D
15:56 itz . o O ( standard in 1984?)
15:56 japhb .ask FROGGS Besides the "C++ in progress" bit, what else has changed?  I assume OpaquePointer -> Pointer .....  And what was the rant about?
15:56 yoleaux japhb: I'll pass your message to FROGGS.
15:56 geekosaur back in the day, it would try to use csh's glob operator because that would do output in a way useful to avoid special characters
15:56 geekosaur (like space and newline)
15:57 timotimo what do we recommend people to use in perl6?
15:57 japhb itz: Well, there's some bits about bsd_glob IIRC, so not exactly what a shell user might naively assume
15:58 itz timotimo: I assumed "dir"
15:59 itz http://examples.perl6.org/categories/cookbook/09directories/09-06-filenames-matching-pattern.html
16:00 japhb Cellular dead spots, I shake my fist at theee
16:00 tony-o m: .basename.say for '.'.IO.dir
16:00 camelia rakudo-moar 89c43c: OUTPUT«.bash_history␤p6eval-token␤std␤.ssh␤star␤perl5␤.perl6␤.rcc␤p1␤nqp-js␤.bashrc␤evalbot.log␤star-2014.09␤rakudo-star-2015.03.tar.gz␤ugexe-was-here␤rakudo-star-2015.02␤rakudo2␤.viminfo␤rakudo-inst-2␤.cpanm␤mbox␤.perlbr…»
16:02 timotimo thanks itz
16:03 * japhb wonders what .rcc is for
16:04 spider-mario joined #perl6
16:07 tony-o m: .basename.say for '.'.IO.dir: test => /^'.'/
16:07 camelia rakudo-moar 89c43c: OUTPUT«.bash_history␤.ssh␤.perl6␤.rcc␤.bashrc␤..␤.viminfo␤.cpanm␤.perlbrew␤.npm␤.lesshst␤.␤.local␤»
16:08 AndChat|228864 joined #perl6
16:08 ugexe is there a best practice for when to use a rule vs token? or should i only base that on the need of back tracking and code formatting via spaces?
16:08 timotimo i think so
16:10 jnthn They have identical backtracking semantics
16:10 jnthn They only differ by sigspace
16:11 timotimo er, right
16:12 itz is there a simple mapping rosetta of glob -> dir and similar
16:12 itz ?
16:13 timotimo is there more to glob than * and ? ?
16:14 itz maybe an error should suggest dir rather than just undefined for glob?
16:15 timotimo well, once we get it, using something that's not defined will also look through the ecosystem for modules that provide it
16:17 itz so I typo something basic and wait for lots of network access :)
16:17 geekosaur traditional glob was * ? [cset] (no ability to invert, simple ranges). modern shells typically add cset inversion (! instead of ^)
16:17 geekosaur and often have many more glob operators
16:17 timotimo no, no, that's all in the data you update from the 'nets with "panda update"
16:18 timotimo that'll surely scale very well
16:18 kaare_ joined #perl6
16:18 geekosaur but the minimal set that glob would be expected to support is ? * and [cset]/[!cset]
16:19 timotimo ah, i forgot about that part
16:19 cognominal joined #perl6
16:19 liztormato joined #perl6
16:20 dalek perl6-examples: 228f7a6 | paultcochrane++ | t/categories/wsg/beginner-2008.t:
16:20 dalek perl6-examples: Compare sorted output lists in event006
16:20 dalek perl6-examples:
16:20 dalek perl6-examples: This allows us to better compare the output data, rather than simply the
16:20 dalek perl6-examples: ordering of the output data which doesn't matter in this case.
16:20 dalek perl6-examples: review: https://github.com/perl6/perl6-examples/commit/228f7a6fdc
16:21 * liztormato waves from Oslo
16:21 itz timotimo: is that in the main panda now .. I remember reading about this in p6weekly
16:21 timotimo no, it's not
16:22 timotimo but panda already requires a "provides" section for all modules
16:22 itz which branch?
16:22 timotimo it's not implemented at all :)
16:22 itz ah ok
16:22 timotimo er, actually i was wrong
16:22 timotimo that feature is about having a "use" statement for something that's not installed
16:24 itz I meant the data structure serialisation
16:24 eternaleye joined #perl6
16:24 itz ah its in MoarVM not panda yet?
16:24 timotimo oh!
16:24 telex joined #perl6
16:24 timotimo i'm confused :)
16:24 liztormato left #perl6
16:25 timotimo we currently have the same data that'd go into the serialized blob ... it's just in a json file instead
16:26 itz I was interested in stealing it to use elsewhere :)
16:30 kaare_ joined #perl6
16:31 eternaleye joined #perl6
16:32 timotimo it's in the "jsoff" branch, but it doesn't work completely yet
16:34 dalek perl6-roast-data: 4ee886b | coke++ | / (9 files):
16:34 dalek perl6-roast-data: today (automated commit)
16:34 dalek perl6-roast-data: review: https://github.com/coke/perl6-roast-data/commit/4ee886b709
16:35 itz timotimo: ty
16:35 timotimo as in: expect explosions
16:37 vendethiel joined #perl6
16:38 [Coke] FROGGS / bartolin - tools/update-passing-test-data.pl
16:48 pmichaud good morning, #perl6
16:48 TimToady good morning, pmichaud  :)
16:48 TimToady long time no see!
16:49 PerlJam pmichaud: greetings!
16:50 TimToady (we just dropped pm off at the airport a few minutes ago :)
16:50 pmichaud TimToady: yes, long time no see.  Like, perhaps 30 minutes.
16:51 * [Coke] wonders what conference he's missing right now
16:51 jnthn o/ pmichaud
16:51 TimToady you missed Collision
16:52 jnthn and you'll soon miss OSDC.no
16:53 [Coke] *sigh*
16:53 pmichaud I made it to Collision, and expect to be at OSDC.no in about 24 hrs
16:53 diana_olhovik_ joined #perl6
16:54 jnthn pmichaud: When you land?
16:54 * jnthn at 13:30 or so
16:54 jnthn But my flight is only 55 mins ;)
16:54 Akagi201 joined #perl6
16:56 pmichaud jnthn: I land at 09:50
16:57 jnthn OK, way before me. :)
17:00 pmichaud jnthn: you arrive 13:30 fri?
17:00 jnthn pmichaud: Yes, tomorrow
17:00 jnthn 13:30 today already came and went ;)
17:00 jnthn (locally)
17:00 pmichaud ah, yes.
17:10 _mg_ joined #perl6
17:14 tadzik I'll be there at 13:50 or so
17:20 jnthn tadzik: oh, didn't even know you're coming :)
17:20 andreoss is implementing <=> enough for max to work on objects of my own class?
17:20 vendethiel joined #perl6
17:22 hoelzro andreoss: I think it would probably be cmp you'd have to implement
17:22 * hoelzro checks impl of max
17:22 hoelzro yes, max uses cmp
17:23 tadzik jnthn: that's what sh... yeah, passively though, not giving a talk or anything :)
17:24 andreoss it seems to throw results at random, even with cmp defined
17:24 jnthn :P
17:24 tony-o andreoss: how old is your build
17:24 timotimo https://github.com/beefsack/git-mirror - this could be interesting
17:25 tony-o beefsack
17:25 PerlJam andreoss: and did you implement cmp correctly?  ;)
17:25 jnthn tadzik: I'm sure you'll make enough noise anyway :P
17:25 tadzik hehe
17:26 tadzik I guess that says a lot about me, not sure if it's good or bad... :P
17:26 pmichaud boarding soon... back again later
17:26 timotimo tadzik: we should get back into game dev again :P
17:28 jnthn pmichaud: Safe flight! :)
17:28 timotimo aye, safe flight!
17:29 andreoss PerlJam: https://paste.debian.net/172705/
17:29 andreoss may be not
17:29 andreoss tony-o: This is perl6 version 2015.04-168-g1763049 built
17:34 [Coke] Writing a class to get the comparator seems very java.
17:35 larion joined #perl6
17:37 tadzik timotimo: oh yes :)
17:40 espadrine joined #perl6
17:42 TimToady jnthn, FROGGS: the advantage of the Foo{} notation is twofold; it naturally looks like a hash of values, and it bundles them together as a single unit that can be passed to parent objects without having to examine each attribute at every BUILD level
17:43 TimToady and as a special form, we can force it to check that the types are known, and allow it to pass a bundle to an uninstantiable role parent, as well as to a class parent
17:44 TimToady sightseeing &
17:45 espadrine_ joined #perl6
17:45 PerlJam andreoss: What makes you think it "throws results at random"?
17:46 timotimo $*PROGRAM_NAME.IO.dirname ~ '/base_exp.txt' - hooray, concatenating strings with ~ :)
17:48 domidumont joined #perl6
17:50 raydiak m: class C { has Numeric $.a }; multi sub infix:<cmp> (C $a, C $b) { $a.a <=> $b.a }; my $a = C.new: :a(1e2); my $b = C.new: :a(10); say $a max $b;
17:50 camelia rakudo-moar 89c43c: OUTPUT«C.new(a => 10)␤»
17:50 tony-o timotimo: wouldn't it be better as $*SPEC.catdir($*PROGRAM_NAME.IO.dirname, 'base_exp.txt') /
17:51 timotimo tony-o: say that to andreoss :)
17:51 raydiak ^^^ how would anyone make that work as intended? golfed restating of andreoss's problem
17:51 * timotimo goes AFK for a bit
17:51 andreoss PerlJam: in 1 time of 10 it looks random
17:51 andreoss or maybe even 20
17:52 PerlJam perhaps libtommath can't handle so many digits?
17:52 PerlJam (or maybe <=> has trouble with them)
17:52 raydiak I think it's not using the custom cmp at all and is instead doing max on the stringification of the object, as illustrated above
17:53 timotimo libtommath is supposed to handle as many digits as your RAM can hold
17:53 PerlJam or maybe what raydiak said.
17:53 PerlJam :)
17:54 raydiak and the way he's doing it, he's not going to get a bunch of digits, that's why he does log(base) instead of exp**10
17:54 tony-o andreoss: do you have a test file?  it works consistently for me
17:54 colomon I’m not seeing the original (probably just need to backlog more) but there’s a decent change log doesn’t work properly on huge numbers?
17:54 raydiak erm, log(base)*exp instead of base**exp
17:55 colomon ah, found link
17:55 raydiak they're only 6 digits
17:55 raydiak m: say log(1e9)
17:55 camelia rakudo-moar 89c43c: OUTPUT«20.7232658369464␤»
17:56 andreoss tony-o: i just run it in a loop
17:57 raydiak m: class C { has Numeric $.a }; multi sub infix:<cmp> (C $a, C $b) { say "CALLED"; $a.a <=> $b.a }; my $a = C.new: :a(1e2); my $b = C.new: :a(10); say $a max $b;
17:57 camelia rakudo-moar 89c43c: OUTPUT«C.new(a => 10)␤»
17:57 tony-o i put a few lines in the file and did: for i in {0..100}; do perl6 andreoss.pl6; done  and it printed out the max number 100 times
17:57 raydiak ^^ very simple illustration that it's not getting called at all
17:58 andreoss tony-o: you can get the original file from PE, the link is in the pod
17:58 tony-o maybe my test file just sucked
17:58 colomon oh, right!
17:58 colomon it’s not getting called because of scoping
17:59 colomon ie rakudo’s core cannot see your custom cmp
17:59 raydiak ah ha
17:59 raydiak now that we're on the right track...afk :)
17:59 colomon that’s been plaguing me for 5+ years now.  :)
18:00 andreoss colomon: i put warn in my cmp, and it's indeed not called
18:00 andreoss should have done it earlier
18:00 geekosaur shouldn't it support an adverb then? max :by(mycmp)
18:01 colomon geekosaur: I don’t know about that, but for sure you can call it as ($a, $b).max(:by(mycmp))
18:02 colomon Looking at the source, I don’t think you can use :by for infix:<max>
18:03 colomon https://github.com/rakudo/rakudo/blob/nom/src/core/Any.pm#L675
18:04 colomon hardcoded to use infix:<cmp>
18:06 colomon m: class C does Real { has $.a; method Bridge() { $.a } }; my $a = C.new: :a(1e2); my $b = C.new: :a(10); say $a max $b;
18:06 camelia rakudo-moar 89c43c: OUTPUT«100␤»
18:06 colomon of course, that’s basically saying C is a Real number, which may not be desirable in general
18:06 timotimo oh, hold on
18:06 timotimo yeah, you can't get the "cmp" into the scope of the sorting thingie
18:07 timotimo until we have "lift" or something equivalent
18:07 colomon right
18:07 colomon and AFAIK, we don’t have lift yet
18:08 moritz lift was unspecced
18:08 timotimo right
18:08 colomon on the other hand, if you tell p6 your type is a Real, the core will treat it as one, even today.
18:08 raydiak back; good morning #perl6 :)
18:09 raydiak I also saw in S03 "As with all cmp-based operators, this may be modified by an adverb specifying different semantics."...is that implemented? even just for cmp vs leg vs <=> if not for custom routines? if so what does it look like?
18:10 moritz https://gist.github.com/anonymous/48efcb021cc1dd55fdd2 you can emulate lift with CALLER::LEXICAL
18:10 moritz TimToady++
18:11 tony-o ++ for the hitchhiker's ref
18:11 colomon that emulation doesn’t help at all for Rakudo’s core, does it?
18:11 aborazmeh joined #perl6
18:11 aborazmeh joined #perl6
18:12 colomon raydiak: it’s not implemented anyway in Rakudo so far as I know
18:15 moritz colomon: it would, I think, but it'd wreak havoc to static inlining
18:15 moritz as well as static dispatch
18:16 andreoss m: sub my-max($a, $b) { $a }; say [&my-max] 1, 2, 3, 4, 5;
18:16 camelia rakudo-moar 89c43c: OUTPUT«5===SORRY!5=== Error while compiling /tmp/13H49C8Z3I␤Two terms in a row␤at /tmp/13H49C8Z3I:1␤------> 3sub my-max($a, $b) { $a }; say [&my-max]7⏏5 1, 2, 3, 4, 5;␤    expecting any of:␤        infix␤        infix stopper␤        postf…»
18:16 andreoss m: sub my-max($a, $b) { $a }; say [my-max] 1, 2, 3, 4, 5;
18:16 camelia rakudo-moar 89c43c: OUTPUT«5===SORRY!5=== Error while compiling /tmp/BeujDZ22Gr␤Two terms in a row␤at /tmp/BeujDZ22Gr:1␤------> 3sub my-max($a, $b) { $a }; say [my-max]7⏏5 1, 2, 3, 4, 5;␤    expecting any of:␤        infix␤        infix stopper␤        postfi…»
18:18 colomon moritz: I mean, without us spreading CALLER::LEXICAL use liberally throughout the core code, it will not work with the core.
18:18 colomon m: sub my-max($a, $b) { $a }; say [[&my-max]] 1, 2, 3, 4, 5
18:18 camelia rakudo-moar 89c43c: OUTPUT«1␤»
18:18 geekosaur I am not sure that max should use any cmp in scope
18:19 geekosaur explicit declaration with an adverb seems much more sensible
18:19 colomon andreoss: your my-max is not very smart.  ;)
18:19 geekosaur "oops this module I imported started exporting a max function"
18:19 colomon andreoss: what with it’s “the first argument is always the max” approach
18:19 andreoss colomon: how do i turn it into reducer?
18:20 andreoss oh. i see
18:20 colomon andreoss: if my-max is a sub which takes two arguments, [&my-max] works as an infix operator
18:21 andreoss m: sub infix:«my-max»($a, $b) { $a }; say [&my-max] 1, 2, 3, 4, 5;
18:21 camelia rakudo-moar 89c43c: OUTPUT«5===SORRY!5=== Error while compiling /tmp/gHu10Nvm6P␤Two terms in a row␤at /tmp/gHu10Nvm6P:1␤------> 3x:«my-max»($a, $b) { $a }; say [&my-max]7⏏5 1, 2, 3, 4, 5;␤    expecting any of:␤        infix␤        infix stopper␤        pos…»
18:21 colomon then to reduce, you need another set of [ ]
18:21 colomon so [[&my-max]]
18:23 andreoss what if it's infix already?
18:24 colomon then [infix-already] is reduce
18:24 timotimo actually, isn't CALLER::LEXICAL the easiest case you can imagine for static inlining?
18:24 andreoss m: sub infix:«my-max»($a, $b) { $a }; say [my-max] 1, 2, 3, 4, 5;
18:24 camelia rakudo-moar 89c43c: OUTPUT«1␤»
18:24 andreoss oh, & was unnecessary
18:24 andreoss colomon: thanks
18:25 rba_ joined #perl6
18:26 andreoss http://paste.debian.net/172728/
18:31 tony-o http::server::async is so borken now
18:33 vendethiel joined #perl6
18:35 colomon andreoss: you’re welcome
18:35 colomon afk
18:41 panagis joined #perl6
18:43 Akagi201 joined #perl6
18:51 diana_olhovik joined #perl6
19:12 espadrine_ joined #perl6
19:16 _mg_ joined #perl6
19:18 dalek perl6-examples: f53afbe | paultcochrane++ | / (2 files):
19:18 dalek perl6-examples: [wsg] sort input test file list
19:18 dalek perl6-examples: review: https://github.com/perl6/perl6-examples/commit/f53afbe4ee
19:23 FROGGS joined #perl6
19:23 FROGGS .
19:23 yoleaux 15:39Z <TimToady> FROGGS: it seems to me that Foo::x doesn't scale well to multiple attributes, but I agree Foo{} is weird, so maybe we can think of something better
19:23 yoleaux 15:56Z <japhb> FROGGS: Besides the "C++ in progress" bit, what else has changed?  I assume OpaquePointer -> Pointer .....  And what was the rant about?
19:24 Peter_R joined #perl6
19:24 FROGGS japhb: right (Pointer), and the rant was about stupid documentation
19:28 FROGGS japhb: like the documentation for 'prefix' here: http://www.xmlsoft.org/html/libxml-tree.html#xmlNs
19:31 FROGGS japhb: or this: http://www.xmlsoft.org/html/libxml-xpath.html#xmlXPathNodeSetCreate
19:33 FROGGS TimToady: I'd like to get it in line with how we access methods of a "parent" role/class... but it feels ununifiable
19:34 * FROGGS .oO( Dog.Bark::new( :loud ) )
19:55 zakharyas joined #perl6
19:56 domidumont joined #perl6
20:00 bayprogrammer joined #perl6
20:03 vendethiel joined #perl6
20:03 beastd joined #perl6
20:13 moritz amusing fact: pylint reports duplicated code, and sometimes it reports a duplicated piece of code twice (once for each file it's in)
20:15 FROGGS *g*
20:19 pyrimidine joined #perl6
20:19 yoleaux joined #perl6
20:22 mr-foobar joined #perl6
20:25 Isp-sec joined #perl6
20:32 Akagi201 joined #perl6
20:33 spider-mario joined #perl6
21:08 dalek ecosystem: 4f81142 | (Jonathan Stowe)++ | META.list:
21:08 dalek ecosystem: Add Sys::Utmp
21:08 dalek ecosystem: review: https://github.com/perl6/ecosystem/commit/4f811421e6
21:09 RabidGravy there
21:13 RabidGravy apologies in advance if it core dumps on your system :)
21:14 timotimo why did libcrypt disappear?
21:15 RabidGravy because, er, I accidentally deleted the line
21:15 timotimo ah
21:16 timotimo i wonder when we'll see recordings from perl6 related things
21:17 dalek ecosystem: ff8b6c0 | (Jonathan Stowe)++ | META.list:
21:17 dalek ecosystem: Put back Crypt::Libcrypt
21:17 dalek ecosystem: review: https://github.com/perl6/ecosystem/commit/ff8b6c0e43
21:18 RabidGravy going to make a Libshout thing next :)
21:18 rjbs So, I rebuilt my rakudo today to get the awesome new "will lazy"
21:19 rjbs lizmat++ jnthn++
21:19 rjbs ...and now I'm at the next thing that "Moose could do this for me." :)
21:20 masak :)
21:20 rjbs m: class YourFace { has $.x will lazy { 1 } ; has $.z will lazy { $.x + 1 } } ; my $yf = YourFace.new;
21:20 camelia rakudo-moar 89c43c: OUTPUT«5===SORRY!5=== Error while compiling /tmp/vmAvcIVdmn␤Virtual call $.x may not be used on partially constructed objects␤at /tmp/vmAvcIVdmn:1␤------> 3ill lazy { 1 } ; has $.z will lazy { $.x7⏏5 + 1 } } ; my $yf = YourFace.new;␤    expectin…»
21:20 rjbs In Moose, we often have two lazy attributes, where one will, if needed during its default-building, cause the other to become built.
21:20 masak that's obviously wrong.
21:21 FROGGS m: class YourFace { has $.x will lazy { 1 } ; has $.z will lazy { $!x + 1 } } ; my $yf = YourFace.new;
21:21 masak as in, I agree with your expectation that the above program should work.
21:21 camelia rakudo-moar 89c43c: OUTPUT«===SORRY!===␤No such method 'wrap' for invocant of type 'Any'␤»
21:21 jnthn I don't think it cna.
21:21 FROGGS :S
21:21 jnthn *can
21:21 masak jnthn: because of possible circularities?
21:21 rjbs Well, but note this:
21:21 jnthn No, just because it's a block, so how will it ever be able to see self?
21:22 jnthn I think we can (maybe already do?) feed the self in as $_...
21:22 rjbs It's complaining about being called on a partially-constructed object when neither block should have ever been called.
21:22 jnthn That's a compile-time bit of semantic analysis.
21:23 rjbs Anyway:  making it easy to "chain" lazily-defaulted attributes has been a big win in Moose.  I believe the utility would translate.
21:23 masak jnthn: don't the (non-block) thunks in attribute initializer rhs-es already see self?
21:23 rjbs jnthn: Okay, thought it might be.
21:23 lizmat joined #perl6
21:23 jnthn masak: Yes, by a good amount of compiler magic to special case it.
21:23 masak *nod*
21:23 jnthn In which case maybe we do want to do it with an "is lazy" so we can use the real thunk that can see self...
21:23 masak +1
21:24 jnthn I still think that's possible, I was just tied for time so worte up the fasted solution that could possibly work.
21:24 jnthn I didn't expect it to go into CORE.
21:24 jnthn *fastest
21:24 lizmat good *, #perl6!
21:24 lizmat and I never thought it did not belong in core
21:24 jnthn Maybe I'll try the other apporach once I've more time (probably this weekend, though shold finish my tut slides first)
21:25 jnthn lizmat: A solution to the problem may, but "we have something that kinda works, put it in!" is the PHP way :P
21:25 masak I repeatedly suggested it should not go in core.
21:25 lizmat so we remove it: it's not been in a compiler release
21:26 lizmat and rjbs can find another way to do the same thing now
21:26 jnthn Well, leave it for a moment, I'll play around with an alternative.
21:26 jnthn Or some alternatives.
21:26 masak ++jnthn
21:26 jnthn And we can see what we like most.
21:26 jnthn I think the fact the current way doesn't let you chain makes it a no-go.
21:26 jnthn And I don't want more special cases. :)
21:27 yqt joined #perl6
21:27 lizmat jnthn: I haven't backlogged sufficiently yet: doesn't chain ?
21:27 masak rjbs: ooc, what does Moose do in the face of circularly dependent lazies?
21:27 jnthn lizmat: You can't do $.foo or self.foo in there
21:27 jnthn lizmat: and there's no easy way to fix that.
21:27 lizmat ah, ok
21:28 jnthn If you make circularly dependent laziness you'll get the stack overflow you deserve, surely.
21:28 jnthn :)
21:28 lizmat yeah, that's a no go  (and a problem with some of the other "will foo" phasers as well)
21:28 masak jnthn: feels statically catchable, tho'
21:28 jnthn Maybe by some kinda linter
21:29 jnthn We're having a hard enough time getting the compiler fast enough without loading it up with static checks for things that are unlikely.
21:29 timotimo if you happen to write your lazy thunks tail-call-optimizable, you'll just infiniloop
21:29 rjbs masak: circular dependency will result in the usual deep recursion
21:29 masak oh, ok.
21:29 rjbs "Deep recursion of your_attr_builder"
21:30 masak if it's good enough for Moose... :)
21:30 rjbs I've talked about how we'd solve some of those problems, but this is Good Enough.
21:30 rjbs Also, have to consider:
21:30 rjbs has $.x = $.should-be-lazy + 1
21:30 rjbs So now we're calling the lazy block on a partially constructed object.  That can be Bad.
21:31 rjbs I have go to!  There are quesadillas waiting to get et.  BBL. ;)
21:31 Zoffix left #perl6
21:31 jnthn Can anybody give me some good real world examples of moose lazy build stuff?
21:31 jnthn Because having done OOP in a bunch of languages...I've not found it a common enough case that it's something I'd hugely miss.
21:32 jnthn (As a core feature)
21:33 masak jnthn: board game. primary data structure is a list of move events. sometimes we ask for pieces on the board. board is lazily created from events.
21:33 RabidGravy W3C::SOAP uses it heavily
21:33 jnthn masak: But...you'd need to invalidate that on getting more events?
21:34 masak jnthn: let's assume it's an immutable game state object. more events creates new immutable game states.
21:35 masak jnthn: anyway, derived costly-ish attributes based on unchanging primary attributes -- that's what comes to mind.
21:35 jnthn *nod*
21:35 masak also "client may not always ask for this"
21:36 lizmat the example that rjbs originally had was:
21:36 jnthn I guess what feels odd to me is this: I view the method as primary and the state to cache it as secondary.
21:36 lizmat my $fh is lazy { open $file } will leave { .?close }  or something like that
21:37 jnthn If I was trying to factor out something to solve this problem, I'd almost certainly be writing a "is cached-on-instance" style trait.
21:37 lizmat s/my/has/
21:37 jnthn Which creates an attribute, adds it to the class, and wraps the method.
21:38 jnthn Heck, given "is cached" on a method will *always* have the invocant in the argument tuple, it's possible that we should have "is cahed" on methods create a secret attribute to cache the things in.
21:38 jnthn So that the per-instance cache goes away when the object does
21:38 jnthn And then the whole thing is method thingy() is cached { ...lazy init here... }
21:39 jnthn Which I like a whole lot more than trying to dangle it off an attribute.
21:39 jnthn It feels odd to declare the means rather than the purpose, imho.
21:42 lizmat jnthn: but wouldn't you want things cached between objects of the same class ?
21:42 lizmat especially when parallelizing ?
21:43 jnthn lizmat: That's my point: "is cached" on methods *already* must be facotring in the instance, 'cus it's just a normal argument
21:43 jnthn lizmat: So the current behavior memory leaks.
21:43 * lizmat looks at the code again
21:43 jnthn I may be mis-remembering the code :)
21:43 jnthn I do think that per-instance application of "is cached" makes sense though
21:44 brrt joined #perl6
21:44 jnthn If you want otherwise, write a sub... :)
21:44 lizmat well, "is cached" is now a Routine trait, so it works both for subs and methods
21:44 lizmat right?
21:44 jnthn Right, but does it treat methods specially in any way?
21:44 lizmat no, it does't atm
21:45 jnthn OK, so it will be putting self in the arg tuple to cache on, and then preventing objects ever getting freed.
21:45 lizmat gotcha
21:45 lizmat now  ....  waking up, finally  :-)
21:45 jnthn So I'm suggesting that we store the cached things per instance.
21:45 jnthn So that a simple "is cached" method is enough to handle the lazy init problem, and also generalizes.
21:46 brrt this is too interesting a discussion
21:46 brrt yes
21:46 raiph joined #perl6
21:46 brrt wait
21:46 lizmat I must be dense, but I don't see how an cache / instance is helping the lazy init issue
21:47 * brrt doesn't neither
21:47 brrt :-)
21:48 masak 'night, #perl6
21:48 jnthn lizmat: If you have an immutable, lazily initialized attribute, then its semantically equivalent to a method that runs on its first call and caches the value produced
21:48 jnthn *it's
21:49 lizmat gnight masak
21:49 lizmat I see what you mean...
21:49 lizmat except that the cache ever only has one element
21:49 jnthn Additionally, hanging it off the attribute is a bit confusing, since only the $.foo style access triggers, the init, not the $!foo. Which I can see tripping people up.
21:50 lizmat true that, but that is a more general WAT that I think will be  a rite of passage for P6 users
21:50 jnthn lizmat: That's fine, so does he cache on a sub get-thingy is cached { ...gets the thingy once... }
21:50 jnthn *the
21:50 rjbs Can is-cached things be cleared easily enough via some means?
21:50 lizmat rjbs: not at the moment.
21:51 jnthn rjbs: Not yet
21:51 rjbs That will be important.  If "x" is derived at high cost from mutable "y"...
21:51 rjbs ...then when "y" changs, "x" should be cleared but not reocmputed.
21:51 lizmat rjbs: S06:2146
21:51 synbot6 Link: http://design.perl6.org/S06.html#line_2146
21:51 rjbs Thank you, click...
21:52 brrt is cached on object instances seems rather problematic anyway
21:52 rjbs Hm!  I think "no caching at all" may be a deal breaker.
21:53 rjbs Imagine if the attribute was meant to hold a filehandle, and the compiler was running in a "don't bother caching" mode.  It's no good.
21:54 brrt well, spec says we don't have to cache at all
21:54 lizmat rjbs: well, then we have once blocks
21:54 lizmat method fh { once $!fh = open $file; $!fh }
21:54 rjbs brrt: Right.  That's why I'm saying that "is cached" may not be appropriate.
21:55 rjbs lizmat: Yeah, things like that.
21:55 lizmat so maybe "once" blocks are the solution to this issue
21:55 rba_ joined #perl6
21:55 rjbs My whole mindset right now is "what stuff does Moose make trivial that Perl 6 makes annoying."
21:55 rjbs It's fine if that's /intended/, because Moose is built on top of a toolkit, and Perl 6 gives a better toolkit.
21:56 rjbs You could build a better Moose with less work, one imagines.
21:56 lizmat actually, once already caches:
21:56 rjbs but I'd like to get the places where "trivial in Moose, three lines of real code in perl6"  into the light
21:56 lizmat m: sub a { once 42 }; say a; say a
21:56 camelia rakudo-moar 89c43c: OUTPUT«42␤42␤»
21:56 rjbs lizmat: I'm not sure that code demonstrates anything?
21:57 rjbs m: sub a { 42 }; say a; say a
21:57 camelia rakudo-moar 89c43c: OUTPUT«42␤42␤»
21:57 lizmat m: sub a { once { say "once"; 42 }; say a; say a
21:57 camelia rakudo-moar 89c43c: OUTPUT«5===SORRY!5=== Error while compiling /tmp/HuN_L79t3s␤Missing block␤at /tmp/HuN_L79t3s:1␤------> 3 { once { say "once"; 42 }; say a; say a7⏏5<EOL>␤    expecting any of:␤        postfix␤        statement end␤        statement modifier…»
21:57 lizmat m: sub a { once { say "once"; 42 } }; say a; say a
21:57 camelia rakudo-moar 89c43c: OUTPUT«once␤42␤42␤»
21:57 rjbs That's nice!
21:57 jnthn Yes, but note the scope is per closure clone rather than per instnace.
21:58 jnthn I wonder if we could come up with a per-instance variant of "once"...
21:58 jnthn But then, that doesn't solve the invalidation issue either.
21:58 lizmat that could work with a hidden attribute ?
21:58 jnthn lizmat: yeah
21:58 rjbs I want to go and do some less interesting things, I'm afraid.  But let me just tell you what this looks like in Moose:
21:58 jnthn But...again, if invalidation matters...
21:58 lizmat same as "once" works with a hidden state var (just explaining)
21:59 rjbs has x => (is => 'ro', default => sub { $self->y ** 2 }, clearer => 'clear_x');
21:59 rjbs Sometimes written:
21:59 rjbs has x => (is => 'ro', lazy_build => 1); sub build_x ($self) { $self->y ** 2 }
21:59 rjbs with the clear_x implicit
22:00 rjbs This makes it basically trivial to use attributes as invalidate-able caches.
22:01 rjbs Maybe all I want is a trait so I can say:
22:01 rjbs has $.x is lazy-built; method build-x { ... };
22:02 rjbs ...which implies that the reader for x is a lazy-caching reader, and that a clear-x is generated.
22:03 vendethiel joined #perl6
22:03 rjbs Anyway:  I realize that my depth of work in p6 is shallow, so it's easy for me to ask for something that's not what I should want.  I'm very aware of that... but I also want to make sure that I say my peace about what seems to be missing. ;)
22:03 lizmat :-)
22:14 brrt uhm, i've got sanity test failures on g89c43cc
22:14 brrt i'm testing a special branch, so that could be it; but i'm just checking here if that's known
22:15 lizmat if it's: t/01-sanity/54-use-lib.t
22:15 lizmat don't worry
22:15 brrt yeah
22:15 brrt that one
22:15 lizmat will fix that one now
22:15 brrt and nativecall?
22:16 brrt 04-nativecall/02-simple-args.t, seen that one failing too
22:17 brrt thanks :-)
22:18 dalek rakudo/nom: 6b4f9be | lizmat++ | t/01-sanity/54-use-lib.t:
22:18 dalek rakudo/nom: Fix sanity test, brrt++ for spotting
22:18 dalek rakudo/nom: review: https://github.com/rakudo/rakudo/commit/6b4f9beebe
22:18 lizmat the nativecall one is one that is awaiting a fix by either FROGGS or jnthn, I forget
22:18 brrt lizmat++ thanks
22:18 brrt ok, then i'm not worried
22:19 Erendis42d joined #perl6
22:19 Erendis42d ^v^
22:19 andreoss joined #perl6
22:21 brrt ooh, lots of perl6 on osdc.no
22:31 * brrt afk
22:32 timotimo great
22:33 timotimo tony-o: did you look at Pluggable yet with the newest CompUnitRepo stuff? (which is probably what makes things fail?)
22:34 tony-o timotimo: i haven't updated http::server::async or pluggable recently, been working on zef and a test harness with "binary" for perl6
22:35 timotimo mhh, OK
22:35 tony-o i have been having a lot of issues with random errors and successes when using the start { } blocks
22:35 timotimo well, i use HTTP::Server::Async for a thing i'm developing on and off
22:35 tony-o is it working for you?  i don't even get one successful request
22:35 timotimo right, my thing is supposed to use Proc::Async::Alot, which is currently unstable as F*
22:36 tony-o lol
22:36 tony-o i haven't seen any issue with Proc::Async and Overwatch but Overwatch uses it in a pretty basic way
22:36 [Sno] joined #perl6
22:37 timotimo right
22:37 timotimo something's racy
22:37 tony-o H:S:A seems to work as long as there isn't asynchronous requests
22:37 tony-o Racy in HSA or in core?
22:37 timotimo no, in core
22:38 jnthn tony-o: Probably in core; I've fixed a couple of nasty things recently, but have a bunch more to go.
22:40 tony-o i ran into a problem earlier today where END { } block in a module was called prior to the last statement in the main script..
22:40 lizmat did you use start blocks ?
22:40 lizmat or any asynchrony ?
22:41 tony-o no start blocks, i awaited any of the async stuff i did in the END block
22:42 tony-o i'll see if i can come up with a more concise example
22:44 jnthn 'night, #perl6
22:45 tony-o night
22:45 timotimo gnite jnthn
22:45 rba_ joined #perl6
22:46 * lizmat also calls it a day
22:46 lizmat gnight #perl6!
22:47 tony-o night lizmat
22:58 skids joined #perl6
22:59 timotimo oh, i need to leave the internets early today as well
23:08 timotimo none of the json_fast tests caught that both "true" and "false" resulted in Bool::True ...
23:09 tony-o does code in an END block run after the process exits?
23:10 Juerd tony-o: How would it run, if not as part of the process?
23:10 tony-o as part of a sub process that isn't killed when the parent exits
23:11 tony-o i get output after 'prove' thinks the process exited
23:11 tony-o even though bash doesn't think so, so i guess it's a problem with prove
23:14 vendethiel joined #perl6
23:18 rba_ joined #perl6
23:24 telex joined #perl6
23:25 timotimo and JSON::Fast's nom-ws is tha allocation king, at 7102971 BOOTCode objects
23:25 andreoss m: my $x = 123; say $x.reverse
23:25 camelia rakudo-moar 6b4f9b: OUTPUT«123␤»
23:26 andreoss how do i find out from which class method is inherited?
23:29 Erendis42d joined #perl6
23:29 Erendis42d re
23:31 TimToady m: my $x = 123; say $x.can("reverse")[0].signature
23:31 camelia rakudo-moar 6b4f9b: OUTPUT«(Any: *%_)␤»
23:31 TimToady m: my $x = 123; say $x.can("flip")[0].signature
23:31 camelia rakudo-moar 6b4f9b: OUTPUT«(Cool: *%_)␤»
23:31 TimToady that's the one you want
23:32 andreoss .reverse appears undocumented http://doc.perl6.org/type/Any
23:33 andreoss what is it supposed to do?
23:33 TimToady well, it's really a List op, but most of the list ops actually live in Any due to the desire to treat a single element as a degenerate list of one element
23:34 TimToady "sure, I can reverse a list containing one element!"
23:35 TimToady so if you search for 'reverse' on docs, it takes you straight to a page that says you should use 'flip' on strings :)
23:36 TimToady similarly, flip is really a string op, despite living in Cool
23:37 TimToady well, the one that 123 finds, anyway
23:37 TimToady m: my $x = '123'; say $x.can("flip")[0].signature
23:37 camelia rakudo-moar 6b4f9b: OUTPUT«(Str: Any |)␤»
23:37 nebuchadnezzar TimToady: so, one need to check for type instead of $x.can ?
23:38 TimToady the auto-coercsions in general are defined by finding a candidate outside the normal one, which coerces to the normal type and then calls the normal method
23:39 TimToady m: my $x = (123,).list; say $x.can("reverse")[0].signature
23:39 camelia rakudo-moar 6b4f9b: OUTPUT«(List: *%_)␤»
23:39 TimToady the docs could probably be a bit clearer about the distinction
23:40 andreoss i've always forgot to use the search on the doc.perl6 since it's needed JS, and i have it turned off
23:40 TimToady everything has advantages and disadvantages :)
23:42 andreoss is there a plan for some optional warnings for using List methods on non-List objects?
23:42 BenGoldberg joined #perl6
23:42 kurahaupo joined #perl6
23:44 TimToady one could do that with an alternative setting, I suppose, that overloaded the Any class with warning methods
23:46 adu joined #perl6
23:46 TimToady more sightseeing &
23:46 tony-o m: class A { method r(){ "hi".say; }; }; class B is A { method s() { self.WALK(:name<r>)[0].signature.say; }; }; B.new.s;
23:46 camelia rakudo-moar 6b4f9b: OUTPUT«(A: *%_)␤»
23:46 tony-o m: class A { method r(){ "hi".say; }; }; class B is A { method s() { self.WALK(:name<r>).perl.say; }; }; B.new.s;
23:46 camelia rakudo-moar 6b4f9b: OUTPUT«[method r (A $: *%_) { #`(Method|53612824) ... }]<>␤»
23:47 adu TimToady!
23:47 yoleaux 25 Apr 2015 03:45Z <labster> adu: facts are facts
23:47 yoleaux 3 May 2015 19:36Z <raydiak> adu: https://github.com/andydude/p6-c-parser/issues/4
23:47 adu damnit, I need to login more
23:48 * adu has been busy working and saving for a house
23:49 adu raydiak?
23:49 adu raydiak: ping
23:49 tony-o andreoss: this will give you just the 'A' part
23:49 tony-o m: class A { method r(){ "hi".say; }; }; class B is A { method s() { self.WALK(:name<r>)[0].package.say; }; }; B.new.s;
23:49 camelia rakudo-moar 6b4f9b: OUTPUT«(A)␤»
23:50 tony-o m: class A { method r(){ "hi".say; }; }; class B is A { method s() { (self.WALK(:name<r>)[0].package ~~ B).say; }; }; B.new.s;
23:50 camelia rakudo-moar 6b4f9b: OUTPUT«False␤»
23:50 tony-o m: class A { method r(){ "hi".say; }; }; class B is A { method s() { (self.WALK(:name<r>)[0].package ~~ A).say; }; }; B.new.s;
23:50 camelia rakudo-moar 6b4f9b: OUTPUT«True␤»
23:52 rurban joined #perl6
23:54 adu I can't find any documentation about "__extension__"

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

Perl 6 | Reference Documentation | Rakudo