Perl 6 - the future is here, just unevenly distributed

IRC log for #perl6, 2015-07-06

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:21 Akagi201 joined #perl6
00:27 AlexDani` joined #perl6
00:29 nys joined #perl6
00:47 vendethiel joined #perl6
01:05 aborazmeh joined #perl6
01:05 aborazmeh joined #perl6
01:07 raiph m: say 'ffl'.uc # (also even thornier stuff like 'i'.uc when locale is Turkish) RT #125556
01:07 camelia rakudo-moar 01edd3: OUTPUT«ffl␤»
01:07 synbot6 Link:  https://rt.perl.org/rt3/Publi​c/Bug/Display.html?id=125556
01:11 BenGoldberg joined #perl6
01:32 ssqq joined #perl6
01:39 vendethiel joined #perl6
01:45 ssqq how to compiler foo.pm6 souce code to foo.movam binary file, then could run with moar foo.movam
01:47 dalek rakudo-star-daily: 0e60149 | coke++ | log/ (9 files):
01:47 dalek rakudo-star-daily: today (automated commit)
01:47 dalek rakudo-star-daily: review: https://github.com/coke/rakudo​-star-daily/commit/0e601492d0
01:47 dalek perl6-roast-data: 41c8882 | coke++ | / (9 files):
01:47 dalek perl6-roast-data: today (automated commit)
01:47 dalek perl6-roast-data: review: https://github.com/coke/perl6​-roast-data/commit/41c888261b
01:52 geekosaur joined #perl6
02:04 vendethiel joined #perl6
02:21 noganex joined #perl6
02:26 colomon_ Trying to install DateTime::TimeZone on latest rakudo moar via panda ends with “Aborted (core dumped)”
02:32 tinyblak joined #perl6
02:33 tinyblak joined #perl6
02:33 adu joined #perl6
02:36 petercommand joined #perl6
02:53 Ben_Goldberg joined #perl6
02:59 vendethiel joined #perl6
03:12 bin_005 joined #perl6
03:12 tinyblak_ joined #perl6
03:32 vendethiel joined #perl6
03:45 raiph colomon_: ==> Successfully installed DateTime::TimeZone (perl6 -v --> This is perl6 version 2015.06-177-g01edd37 built on MoarVM version 2015.06-48-g017d184)
04:02 dalek rakudo/nom: a59ab30 | (Nick Logan)++ | src/core/IO/Path.pm:
04:02 dalek rakudo/nom: remove Str.path leftovers in IO::Path.ACCEPTS
04:02 dalek rakudo/nom:
04:02 dalek rakudo/nom: ./perl6 -e 'say $*CWD.ACCEPTS($*CWD)';
04:02 dalek rakudo/nom: Method 'abspath' not found for invocant of class 'Str'
04:02 dalek rakudo/nom:   in block <unit> at -e:1
04:02 dalek rakudo/nom: review: https://github.com/rakudo/rakudo/commit/a59ab30fe0
04:02 dalek rakudo/nom: 365a1a6 | lizmat++ | src/core/IO/Path.pm:
04:02 dalek rakudo/nom: Merge pull request #461 from ugexe/patch-8
04:02 dalek rakudo/nom:
04:02 dalek rakudo/nom: remove Str.path leftovers in IO::Path.ACCEPTS
04:02 dalek rakudo/nom: review: https://github.com/rakudo/rakudo/commit/365a1a6b77
04:07 diana_olhovik_ joined #perl6
04:13 kurahaupo joined #perl6
04:19 atroxaper joined #perl6
04:20 atroxaper joined #perl6
04:24 dalek rakudo/nom: e3d6b7d | lizmat++ | src/Perl6/Grammar.nqp:
04:24 dalek rakudo/nom: Make use of \$ \% \@ \& \\d a worry
04:24 dalek rakudo/nom:
04:24 dalek rakudo/nom: Inspired by discussion started at
04:24 dalek rakudo/nom:   http://irclog.perlgeek.de/p​erl6/2015-07-05#i_10852425
04:24 dalek rakudo/nom: ShimmerFairy++ geekosaur++ BenGoldberg++ timotimo++
04:24 dalek rakudo/nom: review: https://github.com/rakudo/rakudo/commit/e3d6b7da84
04:35 quester joined #perl6
04:39 dalek rakudo/nom: cf65f54 | lizmat++ | src/Perl6/ (2 files):
04:39 dalek rakudo/nom: Introduce "no worries" pragma
04:39 dalek rakudo/nom:
04:39 dalek rakudo/nom: Worries (usually Perl 5 lookalike warnings) will not be emitted
04:39 dalek rakudo/nom: when a "no worries" pragma is used in that lexical scope.
04:39 dalek rakudo/nom:
04:39 dalek rakudo/nom: Inspired by discussion at
04:39 dalek rakudo/nom:   http://irclog.perlgeek.de/p​erl6/2015-07-05#i_10852580
04:39 dalek rakudo/nom:
04:39 dalek rakudo/nom: timotimo++ skids++ ShimmerFairy++ for inspiration
04:39 dalek rakudo/nom: review: https://github.com/rakudo/rakudo/commit/cf65f5463f
04:40 lizmat m: my $a = \3
04:40 yoleaux 5 Jul 2015 22:13Z <skids> lizmat: you're probably already aware of it, but PR#454 will prevent Parameter.perl from emitting "\%" and "\&"
04:40 camelia rakudo-moar 365a1a: ( no output )
04:40 lizmat $ 6 'my $a = \3'
04:40 lizmat Potential difficulties:
04:40 lizmat To refer to a positional match capture, just use $0 (numbering starts at 0).  Parenthesize as \(...) if you intended a capture of a single numeric value.
04:40 lizmat $ 6 'no worries; my $a = \3'
04:40 lizmat (clean)
04:41 lizmat .tell skids tbh, I'm not completely following what's happening in PR454, so am reluctant to merge
04:41 yoleaux lizmat: I'll pass your message to skids.
04:45 * lizmat commented on timotimo's PR 236
04:47 skids lizmat: It's dealing with anonymous parameters like those found in protos.  When you .perl those, what gets emitted cannot be parsed due to unspace, and there are some other obvious issues.
04:47 yoleaux 04:41Z <lizmat> skids: tbh, I'm not completely following what's happening in PR454, so am reluctant to merge
04:47 skids for example:
04:47 skids m: :($? is parcel).perl.say
04:47 camelia rakudo-moar 365a1a: OUTPUT«:(\?)␤»
04:47 skids m: :(\?).perl.say
04:47 camelia rakudo-moar 365a1a: OUTPUT«5===SORRY!5=== Error while compiling /tmp/HSN3sgLb1q␤Unable to parse expression in signature; couldn't find final ')' ␤at /tmp/HSN3sgLb1q:1␤------> 3:(\7⏏5?).perl.say␤    expecting any of:␤        constraint␤»
04:48 skids and
04:48 skids m: :($ is parcel where True).perl.say
04:48 camelia rakudo-moar 365a1a: OUTPUT«:(\ where { ... })␤»
04:49 skids m: :(\ where { ... }).perl.say
04:49 camelia rakudo-moar 365a1a: OUTPUT«5===SORRY!5=== Error while compiling /tmp/X1GmnYnPtV␤Cannot do non-typename cases of type_constraint yet␤at /tmp/X1GmnYnPtV:1␤------> 3:(\ where { ... }7⏏5).perl.say␤»
04:49 lizmat is there a ticket for these problems?
04:50 skids maybe for some of them.  And some are new/my fault in that when I wrote the Parameter.sigil patch I didn't know what to do with 'is parcel' things.
04:52 lizmat with the GLR on its way, I'm not even sure "is parcel" is going to be a thing of the future
04:53 skids You think sigilless parameters will go away?
04:54 lizmat no, the "is parcel" thing
04:55 skids Well, currently "$ is parcel" and "\" are the same thing.
04:58 * lizmat just learned something
04:59 lizmat m: sub a($a is parcel) { ++$a }; my $b = 42; say a $b
04:59 camelia rakudo-moar e3d6b7: OUTPUT«43␤»
04:59 lizmat m: sub a(\a) { ++a }; my $b = 42; say a $b
04:59 camelia rakudo-moar e3d6b7: OUTPUT«43␤»
04:59 skids At any rate, I'll either have to have the PR in, or replicate the code within the lexical scope of .assuming for my new .assuming code to be mergeable.
05:00 skids Yeah, the "sigilless" variables are actually bind-only things.  So they'll surprise people trying to use them as such.
05:00 skids m: my \a = 1; a++
05:00 camelia rakudo-moar e3d6b7: OUTPUT«Cannot assign to an immutable value␤  in block <unit> at /tmp/LwWgR90gbV:1␤␤»
05:02 lizmat skids: I'm not too happy with  '@$%&'.index($sigil).defined;
05:02 lizmat feels hacky
05:03 skids I could put it back to being a ~~ but I figured that was more efficient.
05:03 lizmat also, $name.substr(0,1) ne '\\'  maybe better as !$name.starts-with('\\') ?
05:03 lizmat ah well, it's in a .perl, right?
05:04 dalek rakudo/nom: 1c9ad4f | skids++ | src/core/Parameter.pm:
05:04 dalek rakudo/nom: Handle "is parcel" better in Parameter.perl and Parameter.sigil
05:04 dalek rakudo/nom:
05:04 dalek rakudo/nom: This modifies:
05:04 dalek rakudo/nom:
05:04 dalek rakudo/nom:   Parameter.sigil to only be '\' when it would otherwise be '$' but
05:04 dalek rakudo/nom:   the parameter 'is parcel'
05:04 dalek rakudo/nom:
05:04 dalek rakudo/nom:   Parameter.perl to emit 'is parcel' in the cases where unspace
05:04 dalek rakudo/nom:   would mess up a re-parse, not to emit '\%' or '\&' anymore
05:04 dalek rakudo/nom:   and use 'is parcel' instead for those, and to correctly add an
05:04 dalek rakudo/nom:   'is parcel' to '|c is parcel'.  I don't know if the last one makes
05:04 dalek rakudo/nom:   any sense, but if it doesn't it probably should not parse in the
05:04 dalek rakudo/nom:   first place.
05:04 dalek rakudo/nom: review: https://github.com/rakudo/rakudo/commit/1c9ad4f3d1
05:04 dalek rakudo/nom: 6e8c751 | skids++ | src/core/Parameter.pm:
05:04 dalek rakudo/nom: Remove redundant conditional
05:04 dalek rakudo/nom: review: https://github.com/rakudo/rakudo/commit/6e8c751508
05:04 dalek rakudo/nom: 73297ef | lizmat++ | src/core/Parameter.pm:
05:04 dalek rakudo/nom: Merge pull request #454 from skids/assuming
05:04 dalek rakudo/nom:
05:04 dalek rakudo/nom: Handle "is parcel" better in Parameter.perl and Parameter.sigil
05:04 dalek rakudo/nom: review: https://github.com/rakudo/rakudo/commit/73297ef3d7
05:04 skids Yeah true.  I didn't know about .starts-with.  I could fix those up if you like as a separate commit.
05:05 skids lizmat: thanks a lot.
05:05 lizmat nah, that's ok
05:06 sivoais joined #perl6
05:09 skids I'll add some idempotency tests for those tomorrow.
05:09 * skids up way too late.
05:09 skids as usual.
05:11 lizmat good night, skids!
05:11 * lizmat up way too early
05:12 lizmat PSA: if anybody has anything of note to mention for the Perl 6 Weekly, let me know
05:13 lizmat expected publication time: around 12 hours from now (yes, I've done most of the work already)
05:19 tinyblak joined #perl6
05:43 yeahnoob joined #perl6
05:43 dalek rakudo/nom: df5da3f | lizmat++ | src/core/Any.pm:
05:43 dalek rakudo/nom: Remove unnecessary fouling of the namespace
05:43 dalek rakudo/nom: review: https://github.com/rakudo/rakudo/commit/df5da3fa28
05:43 Psyche^ joined #perl6
05:51 diana_olhovik joined #perl6
05:55 kaare_ joined #perl6
06:06 dalek rakudo/nom: f2d9c9f | lizmat++ | src/core/Any.pm:
06:06 dalek rakudo/nom: Sanitize adverb error reporting
06:06 dalek rakudo/nom: review: https://github.com/rakudo/rakudo/commit/f2d9c9f7d0
06:07 * lizmat catches up on some sleep
06:07 ShimmerFairy sleep well, lizmat o/
06:22 ugexe skids: strange error on windows for Sum, Cannot find method 'array[uint32]', testers.p6c.org/reports/55027.html
06:23 kanl joined #perl6
06:30 ugexe fwiw, this shows that line itself normally works on the same machine: https://gist.github.com/ugexe/499a7adddb2550c3339e
06:32 abraxxa joined #perl6
06:35 FROGGS joined #perl6
06:35 kanl is there a safer/more efficient way to find out the "width" of a range? it may be undesirable to { my $r = 1 .. 1000000000; $r.elems.say }. and since the bounds may not be integer, one subtracting them may also be undesirable..
06:37 FROGGS since ranges can consist of arbitrary steps, only generating the list will give a correct answer I think
06:37 yoleaux 5 Jul 2015 21:31Z <brrt> FROGGS: if he cares enough about the 'system dynasm' option to object to me removing it
06:37 FROGGS .tell brrt Ummm, what?
06:37 yoleaux FROGGS: I'll pass your message to brrt.
06:39 kanl FROGGS: i guess i should rephrase my question, how would one determine the 'distance' between the bounds of a range?
06:40 kanl m: my $r = 1 .. *; $r.elems.say; # this should be fast.
06:40 camelia rakudo-moar f2d9c9: OUTPUT«Inf␤»
06:41 kanl while 1 .. 1000000000 takes long.
06:41 FROGGS well... that sounds like subtracting is the best choice, no?
06:42 kanl but a .. aaaaaaaaaaaaa can't be simply subtracted
06:43 FROGGS hmmmm
06:43 kanl please lemme know if i'm missing some simple and obvious solution if there's already one :)
06:43 Timbus do you not want .bounds
06:43 FROGGS seems like I'm not awake enough yet :o)
06:44 Timbus Range.bounds
06:44 kanl m: my $r = a .. aaaaaaaaaaaaa; say [-] $r.bounds
06:44 camelia rakudo-moar f2d9c9: OUTPUT«5===SORRY!5=== Error while compiling /tmp/AUKqsu37xd␤Preceding context expects a term, but found infix .. instead␤at /tmp/AUKqsu37xd:1␤------> 3my $r = a ..7⏏5 aaaaaaaaaaaaa; say [-] $r.bounds␤»
06:44 kanl m: my $r = 'a' .. 'aaaaaaaaaaaaa'; say [-] $r.bounds
06:44 camelia rakudo-moar f2d9c9: OUTPUT«Cannot convert string to number: base-10 number must begin with valid digits or '.' in '⏏a' (indicated by ⏏)␤  in block <unit> at /tmp/7T0QNNoYbu:1␤␤»
06:45 Timbus letters seems tricky, fair enough
06:46 kanl just noting that the current implementation of .elems of the Range type may not be efficient enough
06:46 telex joined #perl6
06:47 espadrine joined #perl6
06:51 zakharyas joined #perl6
06:52 labster m: my $t = DateTime.now; say $t.second, " ", $t.whole-second;
06:52 camelia rakudo-moar f2d9c9: OUTPUT«45 45␤»
06:53 labster Woo, got it right on the seconds boundary!
06:53 labster (or not)
06:55 * kanl imagines Range implemented as $min => $offset, then iterating/traversing would be calling .succ $offset number of times.
06:56 kanl make that $offset + 1 :)
06:57 Foxcool joined #perl6
07:00 kanl kind of a related question, is there a version of .succ that can take an offset?
07:01 domidumont joined #perl6
07:01 kanl i.e. something like { my $s = '01'; $s.succ( 3 ) } # gives '04'
07:02 kanl would be hella nice and handy if there is already one.
07:03 labster m: say "01".succ(3);
07:03 camelia rakudo-moar f2d9c9: OUTPUT«Too many positionals passed; expected 1 argument but got 2␤  in block <unit> at /tmp/LZdrKZ5HmP:1␤␤»
07:03 FROGGS m: say ("01".succ xx 3)
07:03 camelia rakudo-moar f2d9c9: OUTPUT«02 02 02␤»
07:04 labster apparently not, but it's not a bad idea.  Save you a loop
07:04 FROGGS err
07:05 FROGGS labster: you just move the loop
07:05 kanl labster: it's not just a matter of looping. rather, it's directly getting there.
07:06 kanl eagerly looping may not be a good idea, just saying.
07:06 labster m: my $s = "01"; $s.=succ for ^3; say $s;
07:06 camelia rakudo-moar f2d9c9: OUTPUT«04␤»
07:06 domidumont joined #perl6
07:07 FROGGS I think it is the same as with .lines calling .get repeatedly...
07:08 FROGGS you can/should/want to implement .succ and .pred for your own type, and then everything will just work
07:08 labster Yes, but for some data types, we should just be able to add the integer instead of 1.
07:08 FROGGS allowing a parameter to .succ just makes it complex for your own implementation
07:08 FROGGS true
07:12 labster class Cool {  method succ(Int $x) { my \this = self; this.=succ for ^$x; this } } ?
07:12 darutoko joined #perl6
07:12 labster and then fast path ones we know how to do better?
07:13 kanl <more rant> also, to me a Range type being immmutable and without any kind of arithmetic operation is kinda limited. something like { 1 .. 4 ,& 2 .. 6 } getting 2 .. 4 would be pretty useful/practial stuff. that said, A Range object would need to be in a listy container. since some ops may result in "holes", i.e. subtraction
07:13 kanl </rant>
07:15 labster m: say DateTime.new(now).second, " ", DateTime.now.second
07:15 camelia rakudo-moar f2d9c9: OUTPUT«10.460504 10␤»
07:18 bjz joined #perl6
07:20 bjz joined #perl6
07:22 RabidGravy joined #perl6
07:22 brrt joined #perl6
07:24 moritz kanl: I'd suggest you implement such operations as a module
07:25 moritz kanl: and if many people use it, we can ponder its adaption into core
07:25 kanl moritz: that is what i'm doing. but my fu is weak :)
07:25 oha can I my regex foo { ... <foo>* ... } ?
07:25 moritz kanl: time to up your fu, I'd say :-)
07:25 moritz oha: yes
07:26 moritz though be careful that it always consumes at least one character, otherwise <foo>* will loop infinitely
07:26 oha moritz, it says "Method 'foo' not found for invocant of class 'Cursor'"
07:26 RabidGravy marnin!
07:26 moritz m: my regex foo { a }; say 'a' ~~ / <foo> /
07:26 camelia rakudo-moar f2d9c9: OUTPUT«「a」␤ foo => 「a」␤»
07:26 moritz m: my regex foo { a <foo>* }; say 'aa' ~~ / <foo> /
07:26 camelia rakudo-moar f2d9c9: OUTPUT«Method 'foo' not found for invocant of class 'Cursor'␤  in regex foo at /tmp/vk4jJW0Q8H:1␤  in block <unit> at /tmp/vk4jJW0Q8H:1␤␤»
07:26 moritz huh
07:26 moritz m: my regex foo { a <&foo>* }; say 'aa' ~~ / <foo> /
07:27 camelia rakudo-moar f2d9c9: OUTPUT«「aa」␤ foo => 「aa」␤»
07:27 moritz oha: I don't know why it works in /.../ and not 'my regex ... {  }', but with <&foo>, it works
07:27 oha ok
07:27 moritz could be a bug
07:27 oha not sure what's the & for, but i will just blindly use it for now
07:27 moritz for lexical lookups
07:28 oha moritz, maybe it can't "unfold" it?
07:28 moritz oha: dunno
07:28 moritz just like  sub f() { }; say &foo.name
07:28 moritz lexical routines are installed with a leading & in the lexpad
07:32 [Sno] joined #perl6
07:34 aborazmeh joined #perl6
07:34 aborazmeh joined #perl6
07:36 g4 joined #perl6
07:46 kanl m: my $r = '1' .. 2; $r.bounds.map: { .WHAT.say }; $r.list.map: { .WHAT.say };
07:46 camelia rakudo-moar f2d9c9: OUTPUT«(Str)␤(Int)␤(Str)␤(Str)␤»
07:47 kanl m: my $r = 1 .. '2'; $r.bounds.map: { .WHAT.say }; $r.list.map: { .WHAT.say };
07:47 camelia rakudo-moar f2d9c9: OUTPUT«(Int)␤(Int)␤(Int)␤(Int)␤»
07:47 kanl why is .max.WHAT not necessarily consistent with .min.WHAT?
07:58 bjz joined #perl6
08:00 DrForr Looking at that we clearly need a .FOX namespace in order to implement map{.FOX.say} :)
08:02 kanl what's .FOX?
08:03 quester left #perl6
08:03 DrForr Nothing that exists right now, it's just a joke.
08:03 DrForr https://www.youtube.com/watch?v=jofNR_WkoCE
08:05 kanl https://www.youtube.com/watch?v=eF9R5aWFzkA
08:05 kanl a better one to dance to, imho :)
08:05 DrForr I prefer his flat-floot floozie. :)
08:06 DrForr *foot
08:08 DrForr (which I can't find on YouTube.)
08:12 dakkar joined #perl6
08:16 domidumont joined #perl6
08:17 espadrine joined #perl6
08:20 yeahnoob joined #perl6
08:21 El_Che 32q
08:22 El_Che oops
08:23 [ptc] El_Che: :wq  :-P
08:26 bin_005 joined #perl6
08:28 mr-foobar joined #perl6
08:32 vendethiel joined #perl6
08:33 rmgk joined #perl6
08:34 kanl does anyone object to me filing a bug on Range type's .elems being eager?
08:34 rindolf joined #perl6
08:35 vendethiel are worries "only" for p5-like errors? I'd love a pragma that disables *only that* :-).
08:36 vendethiel (the commit messages says "usually", and I'm worried I'd disable other interesting warnings with a "no worries")
08:37 vendethiel .oO( we should introduce a "be happy" version )
08:45 kanl [perl #125559]
08:45 synbot6 Link:  https://rt.perl.org/rt3/Publi​c/Bug/Display.html?id=125559
08:46 vendethiel kanl: what other solution is there :)?
08:47 g4 joined #perl6
08:49 kanl finding the distance between bounds seems a more viable solution, though not sure if it's doable. but one certainly/apparently does not have to eagerly loop over 1 .. * to for .elems to give Inf
08:50 amurf joined #perl6
08:51 kanl that said, it is certainly doable in case of Int.
08:51 vendethiel kanl: for 1..*; we know we have an infinite loop
08:51 kanl and for 1..100000000?
08:52 kanl m: (1..100000000000).elems.say;
08:52 camelia rakudo-moar f2d9c9: OUTPUT«(timeout)»
08:54 vendethiel that's not an infinite loop. but yes, calculating elem that way is probably not the best
08:55 kanl therefore i'd like to consider i a bug :)
08:55 kanl ^it
09:00 virtualsue joined #perl6
09:05 tinyblak_ joined #perl6
09:05 VinceDee joined #perl6
09:21 tinyblak_ joined #perl6
09:29 kanl joined #perl6
09:35 gfldex joined #perl6
09:46 atroxaper joined #perl6
09:46 domidumont joined #perl6
09:50 cognominal joined #perl6
10:12 * sjn has cleaned up http://pad.hackeriet.no/p/p6-deploy a little today. It's less of a braindump now, but would still benefit from some discussion
10:12 sjn tadzik, daxim: ^
10:13 * sjn is especially interested in thoughts on what of it may go into S11 :)
10:15 El_Che sjn: Having a look. What about application deployment like a [jwe]ar or fatpack? Out of scope?
10:17 sjn no
10:17 sjn definitely not out of scope
10:18 sjn El_Che: feel free to add a little about that :)
10:21 * sjn thinks fatpack/[jwep]ar would be analogous to docker images
10:22 El_Che well, docker is what's in Vogue and the Cosmopolitan this week
10:22 El_Che but containers is not the answer for everything
10:23 El_Che a lightweight container is a heavy dependency :)
10:24 sjn nah, it depends
10:24 sjn it's not like everyone *must* use buzzword-du-jour technology
10:24 El_Che there are no docker containers in Solaris (there are zones)
10:24 sjn but being "mindshare-compatible" is probably smart, therefore container-awareness
10:24 El_Che sure
10:25 sjn zones are close enough for my concern :)
10:25 sjn (same goes for jails)
10:25 El_Che I mean, "next to a simple drag and drop method"
10:25 sjn that's a point too
10:25 El_Che what makes go a winner for sysadmins types now? just drop the binary and run
10:26 sjn mm. for user-facing installations, that's the way to go
10:26 sjn (e.g. something like they do in OSX)
10:26 sjn BUT
10:26 sjn there's a missing bit here, which is really important
10:28 * sjn hopes to get some thoughts about that from lizmat and FROGGS and perhaps tadzik: Is there a way to do modify the module search path from "the outside"? (e.g. if I install a Perl 6 application in a separate directory, what do I have to do to make "use" work with the modules that came bundled with the application?
10:29 nine sjn: perl6 -I and use lib just like in Perl 5?
10:30 itz joined #perl6
10:30 sjn sure, use lib could work
10:30 itz morning
10:30 nine Also there's %ENV<PERL6LIB>
10:30 sjn although I've never been a fan of putting relative paths into "use lib" or @INC (or whatever is Perl6's equivalent)
10:31 sjn hm
10:31 sjn PERL6LIB might work if one had a wrapper script or something like that for the application
10:32 sjn itz: good *!
10:37 nine A wrapper script, that could be generated by the installation mechanism
10:37 * sjn isn't happy with that idea :-|
10:39 sjn is there a way to get the current library search path from perl6?
10:40 * sjn would hope it was available with "perl6 -V", but I can't see it at a first glanec
10:40 sjn glace*
10:40 sjn glance*
10:40 itz I'm still getting two test failures with OS X - t/spec/S24-testing/line-numbers.t and t/spec/S32-io/IO-Socket-INET.t
10:42 * sjn looks at perl6 -V moar::libdir
10:46 virtualsue joined #perl6
10:51 nine m: say @*INC
10:51 camelia rakudo-moar f2d9c9: OUTPUT«file#/home/camelia/.pe​rl6/2015.06-186-gf2d9c9f/lib inst#/home/camelia/.perl6/2015.06-186-gf2d9c9f file#/home/camelia/rakudo-inst-1/share/perl6/lib file#/home/camelia/rakudo-in​st-1/share/perl6/vendor/lib file#/home/camelia/rakudo-in​st-1/share/perl6/site/lib…»
10:52 nine sjn: ^^^
10:52 itz hmmm seems to be qqx relatged and in scrollback
10:52 itz ^ related
10:54 masak good afternoon, #perl6
10:54 moritz \o, masak
10:55 leont joined #perl6
11:11 FROGGS joined #perl6
11:14 sjn nine: what's that #inst and #file prefix for?
11:14 sjn good *, masak :)
11:17 larion joined #perl6
11:21 lizmat good *, #perl6!
11:21 lizmat sjn: they indicate the type of CompUnitRepo object that should be used
11:21 lizmat file# is for CompUnitRepo::Local::File
11:22 lizmat inst# is for CompUnitRepo::Local::Installation
11:24 sjn hm
11:25 FROGGS m: say CompUnitRepo::Local::File.short-id # obtained like this
11:25 camelia rakudo-moar f2d9c9: OUTPUT«file␤»
11:28 lizmat sjn: you can also write your own CompUnitRepo module, which you could use in an app
11:31 timbunce_ joined #perl6
11:38 atroxaper joined #perl6
11:43 dalek Inline-Perl5: 78008b5 | (Stefan Seifert)++ | / (2 files):
11:43 dalek Inline-Perl5: Support named parameters of .new method of imported P5 classes.
11:43 dalek Inline-Perl5:
11:43 dalek Inline-Perl5: use Foo:from<Perl5>;
11:43 dalek Inline-Perl5: Foo.new(foo => 'custom');
11:43 dalek Inline-Perl5: review: https://github.com/niner/Inl​ine-Perl5/commit/78008b5773
11:53 DrForr Hee. I *think* I was needing that over the weekend.
11:57 nine DrForr: why didn't you say so? :) Have been debugging all Saturday and this would have been a nice easy fix in between ;)
11:57 DrForr As you may have seen I was working on something else :)
12:02 dalek rakudo/nom: 626f906 | lizmat++ | src/core/ (2 files):
12:02 dalek rakudo/nom: Mogrify adverb slice logic into an Exception
12:02 dalek rakudo/nom:
12:02 dalek rakudo/nom: So that we can properly test for them.  This should probably be
12:02 dalek rakudo/nom: run at compile time somehow, but for now runtime will do.
12:02 dalek rakudo/nom: review: https://github.com/rakudo/rakudo/commit/626f906b66
12:06 domidumont joined #perl6
12:18 DrForr Getting a failure here in t/from.t - Looks like you're assuming Moose is installed.
12:20 DrForr nine: ^^^^
12:24 AlexDani` joined #perl6
12:28 [Coke] moritz: regarding your rant, you can coerce types in signatures, if you want. several core subs do that, IIRC.
12:30 DrForr nine: Maybe change Moose to a core Perl5 module name instead? (I haven't looked at the test.)
12:31 rurban joined #perl6
12:34 brrt joined #perl6
12:34 Possum joined #perl6
12:37 masak nine: https://github.com/niner/Inline-Perl5/pull/26
12:37 masak nine++ # Inline::Perl5
12:38 cognominal joined #perl6
12:38 dalek Inline-Perl5: 2618b36 | masak++ | README.md:
12:38 dalek Inline-Perl5: fix s/cought/caught/ typo
12:38 dalek Inline-Perl5: review: https://github.com/niner/Inl​ine-Perl5/commit/2618b360c2
12:38 dalek Inline-Perl5: 3325ebd | niner++ | README.md:
12:38 dalek Inline-Perl5: Merge pull request #26 from masak/patch-1
12:38 dalek Inline-Perl5:
12:38 dalek Inline-Perl5: fix s/cought/caught/ typo
12:38 dalek Inline-Perl5: review: https://github.com/niner/Inl​ine-Perl5/commit/3325ebd0c8
12:38 nine masak: thanks for fixing my spelling errors!
12:39 timotimo *cough* *cough*
12:42 dalek Inline-Perl5: 7bfcb32 | (Stefan Seifert)++ | t/ (2 files):
12:42 dalek Inline-Perl5: Fix test failing if Moose is not installed
12:42 dalek Inline-Perl5:
12:42 dalek Inline-Perl5: Move the new test to t/from.t which already checks for Moose.
12:42 dalek Inline-Perl5: review: https://github.com/niner/Inl​ine-Perl5/commit/7bfcb32c0d
12:42 nine DrForr: fixed. Thanks for the report! I want to specifically test Moose there, since it's very importent in the Perl 5 world.
12:45 masak important* ;)
12:45 masak or, less likely, impotent*
12:45 nine I guess, I shouldn't try to spell anything today
12:45 El_Che masak: lol
12:46 nine Moose is quite potent, I assure you :)
12:46 El_Che when it hasn't drink too much anyway
12:46 masak nine: "Today is a day for eschewing convention and embarking on a creative endeavor." :P
12:46 El_Che even my answer sounds drunk
12:48 atroxaper joined #perl6
12:48 itz is there any simple way to use File::Find on more than one thread?
12:48 masak decommute &
12:49 jnthn yoleaux: I can haz messages???
12:49 yoleaux 4 Jul 2015 19:45Z <hoelzro> jnthn: could you weigh in on http://irclog.perlgeek.de/p​erl6/2015-07-04#i_10848766 if you have some time?
12:49 dalek rakudo/nom: d2faa16 | lizmat++ | src/core/Any.pm:
12:49 dalek rakudo/nom: Make sure nogo's are repeatable
12:49 dalek rakudo/nom: review: https://github.com/rakudo/rakudo/commit/d2faa16082
12:54 oha is there a better way? multi sub f(Str $uri, ...) { return callwith(URI.new($uri), ...); }
12:55 oha other than having URI inherits from Cool :)
12:55 jnthn return callwith(...) is better spelled nextwith
12:56 oha jnthn, right. still, if i have a dozen of multis with URI, i need to make another dozen with the combinations of Str
12:56 jnthn hoelzro: Multi-dispatch will never consider a native candidate for a boxed argument, 'cus otherwise that candidate would always mean we ignore the boxed one. And we really have to hit the Int candidate for int.
12:56 jnthn hoelzro: Uh, *for Int. Otherwise we go truncating big integers all over the place.
12:57 jnthn We are a little more liberal with only subs, since it doesn't much hurt to Make It Work there.
12:57 hoelzro jnthn: alright, thanks for weighing in(t)!
12:59 SmokeMachine joined #perl6
13:00 lucasb joined #perl6
13:00 Alina-malina joined #perl6
13:01 leont What is the new way to do «@foo = $a ?? foo !! Nil»?
13:02 leont I just tried «()» but it didn't seem to DWIM
13:02 lizmat s/Nil/()
13:03 lizmat ah>
13:03 lizmat ?
13:03 leont (erm, may be PEBKEC)
13:03 leont I changed it, but precompiled versions weren't automatically updated.
13:04 aborazmeh joined #perl6
13:05 aborazmeh joined #perl6
13:06 lucasb m: say Real.new
13:06 camelia rakudo-moar 626f90: OUTPUT«Memory allocation failed; could not allocate 8192 bytes␤»
13:06 lucasb I think this is because Real.Str calls .Bridge, that calls .Num, that calls .Bridge again, etc.
13:08 raiph joined #perl6
13:09 [Coke] m: say Real.new(3)
13:09 camelia rakudo-moar 626f90: OUTPUT«Default constructor for 'Real' only takes named arguments␤  in any  at src/gen/m-Metamodel.nqp:1676␤  in block <unit> at /tmp/hr1f2WfYnA:1␤␤»
13:12 timotimo it occurs to me that a channel with many irc bots is kind of like a shared commandline
13:13 dalek roast: 887c43f | lizmat++ | S32-array/adverbs.t:
13:13 dalek roast: Tests for array slice adverb exception handling
13:13 dalek roast: review: https://github.com/perl6/roast/commit/887c43fd8c
13:14 leont Why can't I get a Proc::Status from a Proc?
13:14 timotimo oha: you could spell the type in your multi subs "URI(Str)" that way you'd get them coerced
13:14 leont And why do some docs say run/shell returns one and others the other…
13:14 timotimo leont: probably have to wait for it to exit?
13:15 leont That sounds logical, but there's no wait method documented
13:15 timotimo hm
13:15 * timotimo hasn't looked into the new things yet
13:15 nine Phew!
13:15 [ptc] maybe wait just isn't documented yet?
13:15 leont Trying it out now
13:15 leont No such method 'wait' for invocant of type 'Proc'
13:17 nine Today, I've for the first time tried to use Inline::Perl5 for a real program and instantly hit two bugs. The one I fixed earlier and a very strange utf8-related one. Just about 5 hours later, I've finally proven it to be a Perl 5 or URI::Encode bug :)
13:17 nine Or....not :(
13:18 itz is there any doc for gather/take?
13:19 nine itz: look for take
13:20 leont It seems foo.?bar doesn't work anymore on a type object (or at least I think it used to)
13:21 itz nine: ah
13:22 leont Does anyone have a working example of run(:out)?
13:22 dalek nqp/multidim: a9dedf4 | jnthn++ | t/moar/02-multidim.t:
13:22 dalek nqp/multidim: Tests for cloning a multi-dim array.
13:22 dalek nqp/multidim: review: https://github.com/perl6/nqp/commit/a9dedf4701
13:25 lucasb Interesting that Proc::Status in IO/Handle.pm says it'll be removed together with pipe(). run/shell return a Proc object, but I didn't see any way to wait for the process to finish.
13:27 dalek roast: 665d368 | lizmat++ | S32-array/adverbs.t:
13:27 dalek roast: Add array slice callable adverb tests
13:27 dalek roast: review: https://github.com/perl6/roast/commit/665d3686b7
13:29 leont Yeah, this seems rather unfinished
13:30 muraiki joined #perl6
13:31 gcole joined #perl6
13:33 lucasb I made a mistake; I think run do waits for the process to finish before returning :)
13:33 lucasb I tried: run('bash', '-c', 'sleep 2; echo foo'); say 'ok'
13:35 lucasb say run('bash', '-c', 'exit 42').status +> 8  # says 42
13:37 PerlJam lucasb: note that there's also Proc.exitcode (so that you don't have to do the bitshift dance)
13:38 lucasb PerlJam: yeah, thanks :)  also: +run(...)
13:40 domidumont joined #perl6
13:42 leont Well, my code relies on Proc::Status, because it was previously handling input from Proc::Async
13:43 leont And Proc::Status was actually pretty useful, since it provides the abstraction but also the raw data
13:43 oha m: use URI; sub f(URI(Str) $x) { ... }; f("http://x.com");
13:43 camelia rakudo-moar d2faa1: OUTPUT«===SORRY!===␤Could not find URI in any of:␤  file#/home/camelia/.perl6/​2015.06-188-gd2faa16/lib␤  inst#/home/camelia/.perl6/2015.06-188-gd2faa16␤  file#/home/camelia/rakudo-inst-2/share/perl6/lib␤  file#/home/camelia/rakudo-inst-2/share/perl6/ven…»
13:44 oha timotimo, nice, but i can't make it to work. any reference or keywords I should look for? right now it fails with: Method 'URI' not found for invocant of class 'Str'
13:44 timotimo oha: maybe you get URI with "star:"
13:44 timotimo oh, of course
13:44 dalek roast: 87dd187 | lizmat++ | S32-hash/adverbs.t:
13:44 dalek roast: Tests for hash slice adverb exception handling
13:44 dalek roast: review: https://github.com/perl6/roast/commit/87dd187fc9
13:44 timotimo yeah, you can install a candidate for the coercion multi, i forgot what it's called; COERCE perhaps?
13:44 oha timotimo, my problem tho is that i can't find any reference in the docs, so i can't dig it on my own
13:45 lizmat timotimo: I don't think COERCE is implemented, or completely thought out for that matter
13:45 timotimo mhm
13:45 oha i just found something on S13
13:47 Woodi joined #perl6
13:48 tadzik oha: hmm, I wonder if one could make sub f($uri as URI) work
13:48 tadzik oh, a solution came up already
13:48 timotimo didn't we deprecate the "as" syntax?
13:48 timotimo no, not a solution, sadly
13:48 tadzik I don't know, did we? :)
13:48 oha tadzik, same same
13:49 timotimo it seems like it's still in there
13:49 timotimo problem is, currently the coercion type syntax relies on the type coming in to have a method that can coerce into the type you want
13:49 tadzik rihgt
13:49 tadzik you could augment it!
13:49 * tadzik hides
13:50 nine Ok, it really is a bug in Perl 5's URI!
13:50 timotimo nine: hooray!
13:52 nine And in Geo::Coder::OSM as well. URI::query_form cannot deal with a mix of Unicode string/UTF-8 encoded parameters and Geo::Coder::OSM is manually encoding one parameter (though it works without) and passing through others.
13:53 lucasb m: say Rational
13:53 camelia rakudo-moar d2faa1: OUTPUT«No appropriate parametric role variant available for 'Rational'␤  in any specialize at src/gen/m-Metamodel.nqp:2470␤  in any compose at src/gen/m-Metamodel.nqp:2780␤  in any make_pun at src/gen/m-Metamodel.nqp:1641␤  in any find_method at src/gen/m…»
13:53 lucasb I know Real and Rational are roles, not objects. I was just playing with printing them.
13:53 lucasb Do you think it would make sense to have default parameters of [Int,Int] in Rational, like Rational[::Nu = Int, ::De = Int] ?
13:53 tadzik m: say i*Rational
13:53 camelia rakudo-moar d2faa1: OUTPUT«No appropriate parametric role variant available for 'Rational'␤  in any specialize at src/gen/m-Metamodel.nqp:2470␤  in any compose at src/gen/m-Metamodel.nqp:2780␤  in any make_pun at src/gen/m-Metamodel.nqp:1641␤  in any find_method at src/gen/m…»
13:53 nine Could easily happen in a pure Perl 5 application as well. Inline::Perl5 just makes it more probable, since all strings get their UTF-8 flag set.
13:53 tadzik :(
13:55 PerlJam Inline::Perl5++  sussing out Perl 5 bugs :)
13:56 tinyblak joined #perl6
13:56 leont Yay! It seems the synchronous TAP::Parser is actually working as intended now :-)
13:56 aborazmeh joined #perl6
13:56 aborazmeh joined #perl6
14:02 [Coke] timotimo: how is that a problem?
14:03 [Coke] like, if we had a coercion to Int, and you passed in some random object... how would that work without a method to call?
14:03 skids joined #perl6
14:07 leont And it seems Proc::Status simply stopped existing or some such
14:09 PerlJam [Coke]: If there were a generic coercion thingy  (presumably that's what COERCE is supposed to be).  Something like: multi sub COERCE(Thingy, Int) returns Int { ... }
14:10 lucasb For the coercion Foo(Bar) to work, there must be a Bar.Foo method, right?  Would make sense for the coercion to also search for a Foo.new(Bar) method?
14:10 mr-foobar joined #perl6
14:11 oha lucasb, and which one should win, if both are present?
14:11 lucasb maybe first try Bar.Foo, then search Foo.new(Bar) ? :)
14:12 oha (can i suggest a warning when you use $1 when there is only 1 capture block? it took me a while to understand why it matched but didn't captured)
14:12 PerlJam oha: that sounds like a good idea.  Similar to the P5 "variable used only once" message I guess.
14:13 oha lucasb, so you are saying that Bar is better at knowing how Foo should be created, then Foo?
14:14 oha PerlJam, the fact that it is undefined my trigger the warning, but yeah... i didn't expected the first was $0 so i spent some time to realize it
14:14 lucasb class Bar { method Foo { Foo.new(self or some such) }
14:15 oha lucasb, that's the easy case, and it will probably be symmetric then. but what if the coercion is more complex?
14:15 dalek joined #perl6
14:16 oha Bar.new(a,b); Foo.Bar() { Bar.new(x,y); }
14:18 lucasb oha: I don't know. Either Foo or Bar will have to know how to convert between each other. Just brainstorming ideas... :)
14:19 oha what if there is a multi sub coerce(From, To) { } ?
14:21 timotimo i think something like that was planned, yeah
14:22 dalek rakudo/nom: d9c1e26 | timotimo++ | src/core/Failure.pm:
14:22 dalek rakudo/nom: make Failure objects a tiny bit smaller
14:22 dalek rakudo/nom: review: https://github.com/rakudo/rakudo/commit/d9c1e267f5
14:23 larion joined #perl6
14:25 timotimo does someone with JS (and perhaps angular in particular) skills want to have a look at the profiler template in nqp's repository?
14:25 timotimo a) it's quite slow and allegedly upgrading to the next angular version gives a nice speed boost "for free", but just uping the version makes all ng-show attributes stop working
14:26 timotimo b) the breadcrumb navigation in the call graph section is easily flustered and then there's no way to go back to the root of the call graph; perhaps a universal "up" navigation button that's failsafe would be nice
14:27 khw joined #perl6
14:27 pullphinger joined #perl6
14:28 dalek nqp/multidim: 472df2c | jnthn++ | t/moar/02-multidim.t:
14:28 dalek nqp/multidim: Test special-case 2D/3D array access ops.
14:28 dalek nqp/multidim: review: https://github.com/perl6/nqp/commit/472df2cf7d
14:28 dalek nqp/multidim: cb7e790 | jnthn++ | t/moar/02-multidim.t:
14:28 dalek nqp/multidim: Tests for serialize/deserialize of MultiDimArray.
14:28 dalek nqp/multidim: review: https://github.com/perl6/nqp/commit/cb7e7906d7
14:29 dalek nqp: 188d7e0 | jnthn++ | tools/build/MOAR_REVISION:
14:29 dalek nqp: Bump to MoarVM with multi-dim array support.
14:29 dalek nqp: review: https://github.com/perl6/nqp/commit/188d7e0b5f
14:29 aborazmeh joined #perl6
14:29 aborazmeh joined #perl6
14:30 dalek Heuristic branch merge: pushed 16 commits to nqp by jnthn
14:31 tinyblak joined #perl6
14:36 lucasb m: .say for Int.new, Num.new, Rat.new
14:36 camelia rakudo-moar d2faa1: OUTPUT«0␤0␤0␤»
14:36 lucasb m: Complex.new
14:36 camelia rakudo-moar d2faa1: OUTPUT«Cannot call new(Complex: ); none of these signatures match:␤    (Complex $: Real \re, Real \im, *%_)␤  in block <unit> at /tmp/bkPrAioNog:1␤␤»
14:36 lucasb Do you think it would make sense to have a default value of 0+0i for complex numbers as well?
14:39 PerlJam might as well if we have defaults for the others
14:45 smls joined #perl6
14:50 Sqirrel joined #perl6
14:51 jnthn m: use Test; sub foo(::T) { { my T $b; is $b, Int; } }; foo(1)
14:51 camelia rakudo-moar d2faa1: OUTPUT«Method 'defined' not found for invocant of class 'T'␤  in sub is at lib/Test.pm:113␤  in sub foo at /tmp/a0NNpLccJr:1␤  in block <unit> at /tmp/a0NNpLccJr:1␤␤»
14:52 timotimo i didn't break that with my recent signature lowering work, did i?
14:53 jnthn timotimo: No
14:57 lucasb m: sub foo(::T) { my T $b; say $b }; foo(1)
14:57 camelia rakudo-moar d2faa1: OUTPUT«(Int)␤»
14:57 lucasb m: sub foo(::T) { { my T $b; say $b } }; foo(1)
14:57 camelia rakudo-moar d2faa1: OUTPUT«Method 'gist' not found for invocant of class 'T'␤  in sub foo at /tmp/GSlPTQKx6t:1␤  in block <unit> at /tmp/GSlPTQKx6t:1␤␤»
14:58 dalek rakudo/nom: 87687ea | jnthn++ | src/Perl6/Metamodel/GenericHOW.nqp:
14:58 dalek rakudo/nom: Look in outer scopes for type var instantiation.
14:58 dalek rakudo/nom:
14:58 dalek rakudo/nom: Fixes RT #125537.
14:58 dalek rakudo/nom: review: https://github.com/rakudo/rakudo/commit/87687eae2e
14:59 dalek roast: 201f031 | jnthn++ | S06-signature/type-capture.t:
14:59 dalek roast: Test for RT #125537.
14:59 dalek roast: review: https://github.com/perl6/roast/commit/201f031ada
15:02 lucasb m: say .perl for <1/2>, <1/3>
15:02 camelia rakudo-moar d2faa1: OUTPUT«0.5␤<1/3>␤»
15:02 lucasb Shouldn't Rats always have a .perl representation as Rats? There is special casing for multiples of 2 and 5 in Rat.perl
15:02 nowan joined #perl6
15:05 smls jnthn: I've been thinking more about the situation with `method elems` for custom Positional types. Would it be possible for the Positional role to provide a default implementation which simply dies when called, and overrides the one from Any that always returns 1 ?
15:05 zoosha joined #perl6
15:06 smls That would force positional containers to implement it themselves, while other things would sill get the one from Any.
15:07 jnthn smls: Hmm, may be workable
15:09 jnthn The role doesn't require much of anything at the moment...
15:09 jnthn Thing is though
15:09 jnthn AT-POS is the exact same situation
15:10 jnthn Also, I fear that, since you may want to write a multi elems, we'd end up making a mess for folks
15:11 lizmat PSA: Perl 6 Weekly will be published in about 4 hours from now: let me know anything newsworthy I should let the world know about
15:11 jnthn ('cus you normally *do* just want to implement the :D case)
15:11 lizmat meanwhile, I'm cycling&
15:12 jnthn lizmat: I got done with the key MoarVM underpinning for multi-dimensional arrays (including having things like a 3x3x3 int array being a single packed blob of memory)
15:12 jnthn lizmat: And will work next on Perl 6 level support for this.
15:12 jnthn Guess that's my main news :)
15:12 smls jnthn: As for "expecting authors to remember implementing .elems", it looks like you didn't implement it in CArray for example... :P
15:13 tinyblak joined #perl6
15:13 smls $my-native-array[*-1]  silently overrides the first elem, rather than dying with "sorry, a native array can't know its length"
15:13 [Coke] Any sixers in NYC? I'll be down near penn station for 2 days this week.
15:14 virtualsue bah, i made a branch off MoarVM instead of a fork
15:15 * virtualsue needs to level up on git wizardry
15:17 jnthn smls: And...it's apparently taken until now for it to not bite anyone :P
15:18 itz virtualsue: the "github" wrapper "git" allows "git fork"
15:23 dalek rakudo/nom: 37f384e | jnthn++ | src/Perl6/Metamodel/BOOTSTRAP.nqp:
15:23 dalek rakudo/nom: Actually return instantiated Scalar.
15:23 dalek rakudo/nom:
15:23 dalek rakudo/nom: Fixes RT #124940.
15:23 dalek rakudo/nom: review: https://github.com/rakudo/rakudo/commit/37f384e268
15:23 dalek roast: 0210f20 | jnthn++ | S06-signature/type-capture.t:
15:23 dalek roast: Unfudge test for RT #124940.
15:23 dalek roast: review: https://github.com/perl6/roast/commit/0210f20726
15:23 kurahaupo joined #perl6
15:24 smls What's the recommended way to restrict a method to defined invocants, without using a custom invocant parameter name instead of self?
15:24 smls method elems (:D:) { ...}   ?
15:24 smls method elems (Any:D $:) { ... }   ?
15:25 moritz method elems (::?CLASS:D:) { ... }
15:25 moritz iirc I've specced (aka speculated) a bare :D to default to the invocant type, but it's not implemented
15:26 smls ok
15:27 nine Sounds like a very common use case
15:27 smls I guess making :D the default and requiring an explicit  :U  or  :_  or  :*  for accepting type objects, would be too radical at this point? :P
15:27 smls nine: Indeed
15:29 skids I'd say that's useful not just for invocants.  But might conflict with adverb literals.  If that turns out to be a big deal maybe *:D?
15:29 dalek roast: c24974b | jnthn++ | S05-capture/dot.t:
15:29 dalek roast: Correct test identified in RT #125003.
15:29 dalek roast:
15:29 dalek roast: It wrongly assumed that a Capture matched multiple times stringifies
15:29 dalek roast: to the final match, whereas it's actually an array of all of them.
15:29 dalek roast: review: https://github.com/perl6/roast/commit/c24974b82f
15:31 ugexe lucasb: my $proc = run("$*EXECUTABLE", "-e", "say 1; die", :out); say "out: {$proc.out.lines}";
15:31 smls m: dd Array.elems
15:31 camelia rakudo-moar d2faa1: OUTPUT«0␤»
15:31 smls ^^ the buil-in containers don't seem to restrict stuff to defined invocants
15:31 smls m: dd (Array)[5]
15:31 camelia rakudo-moar d2faa1: OUTPUT«$v = Any␤»
15:32 smls looks like undefined arrays behave like empty arrays :P
15:32 skids smls: autoviv.
15:33 smls Hm. Are you sure that's not a separate mechanism?
15:33 itz grrr I want gather/take in perl5 now :)
15:33 tinyblak joined #perl6
15:33 moritz smls: there many built-ins that restrict methods to defined invocants
15:34 moritz m: say DateTime.later(:1hour)
15:34 camelia rakudo-moar d2faa1: OUTPUT«Cannot look up attributes in a type object␤  in block <unit> at /tmp/SQsVKV4wzI:1␤␤»
15:34 moritz hm
15:34 moritz :(
15:34 telex joined #perl6
15:34 smls method later (DateTime $: *%unit)    ;)
15:34 nine It's less that they restrict and more that they explode ;)
15:35 smls looks like it
15:36 moritz mlenz@mlenz-workstation:~/p6/rakudo (nom)$ git grep ':D:'|wc -l
15:36 moritz 977
15:36 moritz m: Buf.push(42)
15:36 camelia rakudo-moar d2faa1: OUTPUT«Cannot modify an immutable Buf␤  in any  at src/gen/m-Metamodel.nqp:1676␤  in block <unit> at /tmp/0UflDs2Cm0:1␤␤»
15:36 moritz m: say Code.static_id
15:36 camelia rakudo-moar d2faa1: OUTPUT«Invocant requires a 'Code' instance, but a type object was passed.  Did you forget a .new?␤  in block <unit> at /tmp/GuNV8RynSn:1␤␤»
15:36 moritz finally :-)
15:37 moritz m: say Num.isNaN
15:37 camelia rakudo-moar d2faa1: OUTPUT«Invocant requires a 'Num' instance, but a type object was passed.  Did you forget a .new?␤  in block <unit> at /tmp/LMCzJRKQJe:1␤␤»
15:40 nys joined #perl6
15:43 TimToady lizmat: if you like, you can mention that I've been privately prototyping the new non-flattening list and array semantics to see where the new gotchas will be
15:44 smls re. changing the default: It wouln't have to be changing "Type:" to mean "Type:D:" by default. Just make it so that when no explicit invocant is specified at all, it assumes "::?CLASS:D:" instead of "::?CLASS:".
15:44 TimToady that doesn't work for constructors
15:45 smls so, constructors would have to specify an explicit invocant
15:45 RabidGravy theoretically would be it be possible for .assuming() to return a Code with a  "proper" signature based on the original one?
15:46 smls but most other methods wouldn't have to anymore.
15:46 ugexe speaking of assuming, it doesn't work on jvm :(
15:46 skids RabidGravy: yes I have a patch.  I will subit it tonight.
15:46 RabidGravy skids++ # nice one
15:47 jnthn dinner &
15:47 lucasb ugexe: thanks for that run() snippet. that is about that S24-testing/line-numbers.t test?
15:47 geekosaur belated lizmat++
15:47 ugexe i saw you and leont asking how to use run
15:47 * geekosaur running on way too little sleep... pity today's schedule disallows a nap
15:48 lucasb ugexe: oh, ok
15:48 skids RabigGravy: You can test this fork if you're up for it: https://github.com/skids/rakudo/commit/9​75e9892d2c597a0083f47041debf78856e2e240
15:50 leont lizmat++ # P6 Weekly caused me to update TAP::Parser for synchronous support :-)
15:51 timotimo ooh awesome
15:51 timotimo lizmat++
16:10 diana_olhovik joined #perl6
16:16 leont I'm currently organizing my code into multiple files with multiple related classes. It seems precompilation isn't agreeing with this notion, any suggestions?
16:17 leont Is this a common issue? Should I reorganize?
16:17 ugexe sounds like you need to rewrite your META file
16:17 ugexe provides section specifically
16:18 davido__ joined #perl6
16:18 dha joined #perl6
16:18 dha joined #perl6
16:19 leont Right, I had a pull request for that!
16:19 atroxaper joined #perl6
16:20 leont Without description, so I didn't realize it might be related
16:21 uncleyea1 joined #perl6
16:21 tinyblak joined #perl6
16:22 timotimo yeah, without the "provides", the "use" statement will not find stuff
16:23 dalek roast: 557532a | (Lucas Buchala)++ | S24-testing/line-numbers.t:
16:23 dalek roast: Change use of qx// to run() in test
16:23 dalek roast: review: https://github.com/perl6/roast/commit/557532ab76
16:23 ugexe i believe it may have more to do with building the dependency order by mapping namespaces to file paths
16:23 leont The PR doesn't seem to have fixed it, but it is missing classes so I guess I should amend it further
16:24 lucasb ^^ please review if everything is fine with my commit, thanks
16:24 ugexe you should trace the build order and see if you think it looks correct
16:25 leont It does actually
16:25 leont «Cannot invoke this object (REPR: Null, cs = 0)» is not a very helpful error
16:28 ugexe i say that because im not sure panda parses dependency order for provides correctly when there are multiple namespaces mapped to a single path
16:29 ugexe as in, the topological sort should not count FILE.pm with class A and class B twice if FILE2.pm depends on class A and class B
16:31 ugexe is it on the ecosystem that i can pull down?
16:32 timotimo lizmat: perhaps you can put my call for help for the profiler template into the weekly to find someone with js experience and a bit of free time?
16:32 leont Yes, as TAP::Harness
16:34 dha Assignment operators. Can one assume that they work similarly in p6 to the way they do in p5? S03 indicates so, but the operators document at docs.perl6.org only documents C<=> and C<< => >>.
16:35 spider-mario joined #perl6
16:35 dha Also, the string coercing bitwise operators now experimentally in p5 (C<&.=>, etc.) ... I'm guessing they're probably not in p6
16:35 dha ?
16:36 ugexe oh i see what you mean
16:37 ugexe for now, you probably need to declare the entire name.
16:37 ugexe package TAP { class Generator {
16:38 uncleyear joined #perl6
16:38 ugexe probably has to be TAP::Generator for the current build order to be generated in its current fashion
16:42 leont I see
16:42 leont Well, at least that isn't a very big change :-)
16:43 leont Though I'm doing that in multiple places… :-/
16:44 ugexe jvm is failign to build during .\perl6-j.bat --target=jar --output=lib/Test.pm.jar -Ilib lib/Test.pm on both windows and linux
16:49 [Coke] getting a spectest failure on os x locally: Unable to execute 'PERL6_BINARY=/Users/william​coleda/sandbox/rakudo/perl6 sh t/spec/S32-io/IO-Socket-INET.sh 7 1024' in block <unit> at t/spec/S32-io/IO-Socket-INET.t:170
16:50 timotimo dha: but => isn't an assignment operator
16:51 [Coke] guessing that PERL6_BINARY isn't being passed through somewhere.
16:51 dha Well, operators lists it under "Item Assignment Precedence" so, although I can see how one might say "that defines the precedence level, rather than the operators in that precedence level", it's confusing in that respect.
16:53 TimToady m: say Int.new
16:53 camelia rakudo-moar d2faa1: OUTPUT«0␤»
16:53 TimToady is there any use case for Int.new returning 0 rather than blowing up?
16:54 ShimmerFairy my Int $a; defaulting to 0, perhaps?
16:54 TimToady m: my Int $a; say $a
16:54 camelia rakudo-moar d2faa1: OUTPUT«(Int)␤»
16:54 TimToady doesn't
16:54 dalek roast: cf81ec2 | coke++ | / (31 files):
16:54 dalek roast: kebab case skip-rest
16:54 dalek roast:
16:54 dalek roast: Even in comments and old fudges.
16:54 dalek roast: review: https://github.com/perl6/roast/commit/cf81ec21c5
16:55 Jonis joined #perl6
16:55 [Coke] TimToady: he's suggesting that maybe that's why it doesn't.
16:56 [Coke] ... oh. I see what camelia says tehre. nevermind.
16:56 nine TimToady: as always the non-existence of a use-case is much harder to prove than the existence.
16:56 timotimo "i want a new instance of what i was given, so i'll just call .new on the thing i was given"?
16:56 [Coke] lots of failures in the last moar-jit spectest run:
16:56 [Coke] https://github.com/coke/perl6-roast-data/blob​/master/log/rakudo.moar-jit_summary.out#L3891
16:56 ShimmerFairy TimToady: to be honest, I'm not sure there's much of a use-case for Int.new in user code :P
16:57 ugexe m: my $x = Int.new; my $y = Int; say 1 if $x; say 2 if $y # i guess the expectation of this is the question
16:57 camelia rakudo-moar d2faa1: ( no output )
16:57 ShimmerFairy [Coke]: Were you referring to me just then, ooc?
16:57 TimToady yes (s)he was :)
16:58 ShimmerFairy I wasn't sure, because I'm not a he :)
16:59 ShimmerFairy TimToady: I was reminded of something a bit earlier: Should ~& and friends _really_ still be coercing strings to buffers? I'm of the opinion that you should explicitly convert to the buffer you want if you need to use the "stringwise" bit ops.
17:00 PerlJam Is Int.new how we autoviv?
17:00 TimToady don't think so
17:01 TimToady ShimmerFairy: it's more like "ABCD" should be considered an allomorphic literal if used by a buffer op
17:02 FROGGS joined #perl6
17:02 smls so it should throw an exception when given a Str that has non-ASCII chars?
17:02 TimToady that has been suggested
17:02 ShimmerFairy I'd prefer it warn you and leave the consequences of not being more specific to the programmer :)
17:02 TimToady or possibly non-Latin-1
17:03 TimToady for a use case, see http://rosettacode.org/wiki/Find​_the_missing_permutation#Perl_6
17:04 ShimmerFairy If you do limit the range of allowable characters, I think 7-bit ASCII is just a bit too restrictive.
17:04 TimToady I think the RC entry needs 8 bits, at least
17:05 Juerd ShimmerFairy: It's the only thing you can re-encode to most other currently fashionable encodings without changing the binary representation, so ASCII does make sense.
17:06 ShimmerFairy Juerd: sure, but I think allowing 0x80..0xFF single-byte representations isn't too much to ask for :)
17:06 Juerd If it would allow latin1, then what does that even mean? Does it allow utf8 encoded source code with only code points under 256, or should the source itself be latin1 encoded? And isn't it a bit weird to auto-decode as latin1 for a binary-as-in-data operator?
17:07 Juerd ShimmerFairy: There's the thing, there's no easy way to even get those in your code if your editor (TEXT editor) is but a bit sane.
17:07 ShimmerFairy Juerd: this is why I've always thought the ~ style bitops shouldn't accept strings, and force you to convert to the buffer you want :)
17:08 ShimmerFairy TimToady: that is a pretty nice use-case though.
17:08 smls Juerd: I don't think that problem applies here
17:08 Juerd Maybe we just need different delimiters for binary data.
17:08 Juerd q:base64/.../   # :)
17:08 smls If you have a Str, you already know the meaning of each char unambiguously
17:09 timotimo q:hexdump:to<end>
17:09 Juerd smls: What's the "meaning" of a character in binary-as-in-data context?
17:09 Juerd timotimo: <3
17:09 smls well, in the case proposed above, latin-1 by default
17:09 Juerd smls: I think that that case makes less sense than restricting to ASCII.
17:10 TimToady sometimes prohibiting nonsense also prohibits sense
17:10 Juerd utf-8 encoded latin1-compatible codepoints aren't binary data.
17:10 ShimmerFairy I like to think of the potential acceptable range as "Characters U+0000 through U+00FF encoded in UTF-32, but with only the least significant byte kept" :P
17:11 Juerd ASCII is the only thing that we're still using where text and binary are specced as the same thing.
17:12 Juerd iso8859 as a thing you might want to mention anywhere in your documentation or source made sense when Perl 6 was conceived, but it's 2015 now :)
17:12 TimToady thing is, xoring sets high bits; do we require people to xor an even number of times?
17:12 smls TimToady: Your rosetta solution could be made to work by adding a simple  ».encode("latin-1")  right?
17:12 ShimmerFairy It would, but it would look slightly less nice, I'd have to admit.
17:12 TimToady just ».encode will work
17:13 TimToady since UTF-8 is fine for ASCII
17:13 smls right
17:13 [Coke] ShimmerFairy, TimToady: apologies.
17:13 ugexe latin-1 wont explode on invalid utf-8 though i thought
17:14 ShimmerFairy [Coke]: don't worry too much about it, I was getting it wrong until not too long ago myself :P
17:16 ShimmerFairy I personally think Latin1 is the best choice if some sort of limit ends up being used.
17:16 * TimToady rejoices that all kinds of people feel safe here, except maybe trolls
17:16 ShimmerFairy TimToady: well, I'm not the first of my kind here, so that helps :)
17:17 ShimmerFairy Latin1 is the most common extension of ASCII (as I understand it), so it would cover a lot of cases. And if it doesn't do the right thing for you, then there's always .encode()
17:17 |Tux| safe is so relative. sometime the info I get here almost makes my brain explode. hence not safe
17:19 TimToady m: say (~^'ABCD').WHAT
17:19 camelia rakudo-moar d2faa1: OUTPUT«(Failure)␤»
17:19 masak ShimmerFairy: [backlogging] I just want to say congratulations on the -- as au++ would say -- runtime polymorphism. :D
17:19 * ShimmerFairy wonders how possible it is to argue that Unicode is actually the most common extension of ASCII nowadays...
17:20 ShimmerFairy masak: thanks :3
17:20 masak ShimmerFairy: now the change in nick makes a bit more sense, too.
17:21 masak I mean, the timing of it.
17:22 PerlJam masak: good save  :)
17:22 ShimmerFairy masak: yes, my previous nick was almost comically gendered once the issue came up :)
17:22 masak ShimmerFairy: strangely, yes. I don't really know *why* your prev nick would count as gendered, but it somehow does.
17:23 ShimmerFairy masak: first names like "Lou" are homophones to "lue", that's why
17:23 masak oooooh
17:24 masak good thing you found a nick that's hardly gendered at all :P :P :P
17:24 * TimToady notes the relationship of rnd with shimmer however :)
17:25 zakharyas joined #perl6
17:26 RabidGravy (I may have somewhat overstated the simplicity of the libmp3lame binding - it's got about a billion optional parameters)
17:26 masak RabidGravy: well, you know what they say. first, make it work. then, support all the billion optional paramters.
17:27 timotimo RabidGravy: how does C handle optional parameters?
17:27 ShimmerFairy I worked with the theora library once, and I remember my biggest headache was dealing with the YUV colorspace (which of course isn't the library's fault)
17:28 RabidGravy masak, yup
17:28 moritz timotimo: usually by having a struct with a member for each option
17:28 moritz timotimo: and allowing them to be NULL
17:29 ShimmerFairy C doesn't let you assign default values to parameters?
17:29 moritz nope
17:30 moritz and variadic functions are a pain in C
17:30 RabidGravy timotimo, moritz in common with most libraries of this genre it has a static opaque "handle" and a squillion get/set functions
17:31 |Tux| new Capture warning makes me need to change a sheet in my talk :)
17:32 masak progress++ # \o/
17:32 moritz RabidGravy: better than MUMPS (a FORTRAN library) where you set all the options yourself in that not-opaque-enough handle
17:32 |Tux| (staying in touch)++
17:34 |Tux| FWIW I don't really like the fact that it is a single line. It doesn't read well
17:34 |Tux| Potential difficulties:
17:34 |Tux| To pass an array, hash or sub to a function in Perl 6, just pass it as is.
17:34 |Tux| For other uses of Perl 5's ref operator consider binding with ::= instead.
17:34 |Tux| Parenthesize as \(...) if you intended a capture of a single variable.
17:34 |Tux| at -e:1
17:34 |Tux| ------> my @a = 1,2; $a = \?@a; $a.WHAT.say
17:34 |Tux| that reads much better
17:34 masak |Tux|: agreed. care to change it?
17:35 |Tux| *I* won't :)
17:35 masak oh... :/ pity.
17:35 ShimmerFairy |Tux|: but you just did! (see backlog)
17:35 * masak .oO( whaddya take me for, a *core* developer!? )
17:36 |Tux| err, yes!
17:36 beastd joined #perl6
17:36 geekosaur I did look around for other long warnings and they didn't seem to be autowrapped
17:36 geekosaur er, not auto-, hard-
17:36 |Tux| this one is exceptionally long
17:37 ShimmerFairy (btw, if 'no worries' ends up blocking other, not-P5 warnings, I wonder if it would be worth it to have a new kind of warning for P5 warnings, <.p5ism("...")> or such)
17:37 geekosaur there was an earlier suggestion to have typed warnings like there are typed errors/exceptions currently
17:38 moritz ShimmerFairy: we already have <.obs> for obsoletion warnings
17:38 ugexe timotimo: your last commit seems to be where jvm stops building
17:38 ShimmerFairy moritz: should the Perl 5 warnings prefer <.obs> then?
17:40 ShimmerFairy geekosaur: For some reason I'm reminded of how the C preprocessor has #error but not #warning (discounting GCC's nonstandard support for it)
17:40 moritz yes
17:40 moritz ShimmerFairy: I thought they did already
17:41 ShimmerFairy moritz: the 'no worries' pragma came about to block Perl 5-based <.worry> messages (by blocking all <.worry> messages)
17:42 rindolf joined #perl6
17:43 [Coke] "perl6 core" "who's your friend?" # throwback to an ancient chip & dale cartoon, yikes.
17:43 moritz ShimmerFairy: doing a "git grep '\.obs'" and a "git grep '\.worry'", I get the impression that there is more p5 specific with <.obs> than with <.worry>
17:43 moritz but then <.obs> is fatal, so you cannot easily disable it
17:45 ShimmerFairy Hm. Well, the point of 'no worries' is to not tell people like me about how the Perl 5 code I'm trying to wrote won't DWIM, because I don't know any Perl 5 in the first place.
17:45 ShimmerFairy *write
17:46 itz_ I think the more common case is people knowing Perl 5
17:47 dha And, now... annoying questions about heredocs... :-)
17:47 masak yay
17:48 dha The heredoc docs include this line: C<my $escaped = escaque(q:to/TERMINATOR/, language => 'html');>. Should I assume that "escaque" "esacape" there? and, if so, is there actually an C<escape> function?
17:48 ShimmerFairy itz_: sure, that's why the warnings are on by default. I just want to turn off the warnings that mean nothing to me :)
17:50 smls dha: I think that's just meant do show how one can use a heredoc inside an expression
17:50 smls *to
17:50 dha Also, the heredoc strings are specified as, e.g. C</END/> for "END". Are these regexes, or some odd quoting construct specific to heredoc syntax?
17:51 dha smls -  Well, yes, but I don't have any idea what an "escaque" is, and it might confuse people.
17:51 smls escaque() is not a built-in function; just meant as a hypothetical example
17:51 moritz dha: not a regex
17:51 moritz m: say qw/foo bar baz/.join('|')
17:51 camelia rakudo-moar d2faa1: OUTPUT«foo|bar|baz␤»
17:51 moritz the quoter/.../ thingy isn't reservied for heredocs
17:52 smls dha: Right, it might be clearer to change it to  "my-escaping-function("
17:52 dha moritz -  ah. So those are just part of the quoting operator syntax, and could just as easily be C<q:to{TERMINATOR}>
17:52 dha smls -  ok. I think I'll patch that so it makes more sense.
17:53 dalek doc: 0178965 | moritz++ | lib/Language/quoting.pod:
17:53 dalek doc: Try to clarify example for heredocs, dha++
17:53 dalek doc: review: https://github.com/perl6/doc/commit/0178965f33
17:53 moritz dha: I'm afraid I'm faster :-)
17:53 dha Finally (I think).
17:53 dha moritz -  No worries. As long as it gets done.
17:53 dha :-)
17:53 ShimmerFairy Yes, the use of // to delimit is simply a convention that's developed over time. (masak has noted before how he doesn't like it too much :P)
17:54 dha ShimmerFairy -  right. I really should have realized that. the C<:to> got in between the q and the / and confused me for a moment.
17:55 domidumont joined #perl6
17:55 dha And finally(?), it used to be that if you surrounded your terminator string with single quotes or double quotes it either didn't interpolate or did. Is there a way to make that distinction in Perl 6? For instance, using C<qq> instead of C<q>?
17:55 smls I like square brackets as quote delims personally, as in  q:to[END]
17:55 dha (That's how I would guess it would work but it's not documented in the quoting documentation.
17:56 smls qq:to  vs  q:to  I think
17:57 dha I guess I'll have to write a test... *sigh*
17:57 dha :-)
17:57 smls synopses confirm it: http://design.perl6.org/S02#Heredocs
17:58 dha Well, hopefully it's actually implemented... :-)
17:58 smls :)
18:00 brrt joined #perl6
18:01 dha Yep. it works. whew.
18:02 dalek doc: 39d9449 | moritz++ | lib/Type/IO/Pipe.pod:
18:02 dalek doc: Bare-bones documentation for type IO::Pipe
18:02 dalek doc: review: https://github.com/perl6/doc/commit/39d944967c
18:02 ugexe typo says 'method prodc'
18:02 moritz ugexe: thanks
18:03 dalek doc: d42aeab | moritz++ | lib/Type/IO/Pipe.pod:
18:03 dalek doc: Two small fixes in IO::Pipe docs
18:03 dalek doc:
18:03 dalek doc: * IO::Handle is a class, not a role
18:03 dalek doc: * typo in method name, ugexe++
18:03 dalek doc: review: https://github.com/perl6/doc/commit/d42aeabe16
18:03 dalek doc: ee67d9f | moritz++ | type-graph.txt:
18:03 dalek doc: Add IO::Pipe to type graph
18:03 dalek doc: review: https://github.com/perl6/doc/commit/ee67d9f547
18:10 ShimmerFairy joined #perl6
18:11 smls_ joined #perl6
18:14 lucasb If the only thing a .new method does is call nqp::create(self).BUILD(...), then why have an explicit .new method at all, since this is what the inherited .new would do anyway? Yesterday I asked about Capture.new; here are other examples:
18:14 lucasb m: class R is Range {}; R.new(1,2)
18:14 camelia rakudo-moar d2faa1: OUTPUT«Method 'BUILD' not found for invocant of class 'R'␤  in block <unit> at /tmp/7bCxgvL4E9:1␤␤»
18:14 lucasb m: class C is Complex {}; C.new(1,2)
18:14 camelia rakudo-moar d2faa1: OUTPUT«Method 'BUILD' not found for invocant of class 'C'␤  in block <unit> at /tmp/dTymn3Jt__:1␤␤»
18:16 raiph joined #perl6
18:16 moritz lucasb: it is likely that Range.new is much older than our object construction mechanism
18:17 hoelzro while working on a script, I discovered that LEAVE blocks are scheduled right away, instead of once the line they're found on has been reached (ex. I expected the LEAVE phaser here to never be run: die "uh-oh"; LEAVE say 'hi')
18:18 lucasb For example, if something like Range's nqp::create(self).BUILD(-Inf, Inf, ...) was changed to self.new(-Inf, Inf, ...) it would work all right?
18:18 hoelzro if one is doing clean up on an object bound to a variable (ex. $db), is it idiomatic to CYA and do LEAVE $db && $db.close?
18:20 dha Hmm... taking longer than I would expect for github changes to propagate...
18:21 [Coke] hoelzro: the timing makes sense, given the compile time phasers.
18:21 moritz hoelzro: yes
18:21 hoelzro [Coke]: it makes sense to me now, but surprised me at first
18:22 hoelzro I've also noticed with LEAVE (and POST) phasers that if the phaser throws an exception during an unwind, the original exception is masked unless one uses an explicit CATCH block; would anyone be opposed to improving the top level error handler to print out all exceptions being thrown?
18:23 [Coke] I wouldn't expect having multiple exceptions being thrown simultaneously to make sense.
18:24 [Coke] isn't it always the most recent one that was thrown?
18:24 hoelzro m: die 'uh-oh'; LEAVE die 'leaving'; CATCH { default { .say } }
18:24 camelia rakudo-moar d2faa1: OUTPUT«uh-oh␤  in block <unit> at /tmp/YINsD8hy8s:1␤␤leaving␤  in block <unit> at /tmp/YINsD8hy8s:1␤␤»
18:25 hoelzro [Coke]: if the exception propagates to whatever handles uncaught exceptions, only the most recent is printed
18:25 hoelzro my use case is for the Xapian binding I'm working on; if I do this:
18:26 hoelzro my $db = Xapian::WritableDatabase.new('test.db', $mode); LEAVE $db.close
18:26 hoelzro if opening the database fails, seeing "Any has no method close" doesn't help me
18:26 [Coke] I would expect that if close throws an exception, that's what you get.
18:26 [Coke] so you'd have to wrap your leave in a try.
18:27 [Coke] LEAVE try {$db.close}; # ingore any exceptions here, don't care.
18:27 mr-foobar joined #perl6
18:27 hoelzro or do the $db && $db.close trick
18:28 hoelzro that just feels...weird to me
18:28 hoelzro that the original reason for stack unwinding is hidden
18:28 [Coke] hoelzro: you ever program in java?
18:28 hoelzro heh, not for a while
18:28 hoelzro but iirc in Java you can link exceptions
18:28 hoelzro for better or for worse
18:31 ugexe m: class Foo { method close { say 2; }; }; sub Bar { LEAVE { Foo.new.?close }; }; sub Baz { LEAVE { Foo.new.?blargh }; }; Bar(); Baz()
18:31 camelia rakudo-moar d2faa1: OUTPUT«2␤»
18:45 masak it is correct that I don't like // delimiters too much for heredoc markers. it's a pity they seem to be the default/convention.
18:45 masak reason I don't like them is exactly that they signal "regex!" without being one.
18:45 masak I think my current favorite is <> as delimiters
18:48 dha I can see that, but they're pretty much traditional for the q operators as well.
18:48 dha But, hey! You can do whatever you want!
18:51 * masak boggles
18:52 * vendethiel waves
18:53 espadrine joined #perl6
18:53 domidumont joined #perl6
18:54 jercos is there an "I really know what I'm doing" flag for typed buffers?
18:55 ugexe m: Buf[uint32].perl.say # ?
18:55 camelia rakudo-moar d2faa1: OUTPUT«Buf[uint32]␤»
18:55 jercos say I have a string that was mistakenly decoded as utf-8 and happened to be valid... .encode("utf-8").decode("latin-1") throws a "Can not decode a utf-8 buffer as if it were latin-1"
18:56 jercos which is generally correct, but seems counterproductive in the corner-cases where I want that to happen, despite the potential consequences
18:56 masak I'm... a little bit surprised that's not already allowed.
18:56 jercos the other way around seems to be
18:56 masak I don't think of a buffer as a "utf-8 buffer". I think of it as a sequence of ints.
18:56 jercos m: "Hello, world".encode("utf-8").decode("latin-1")
18:56 camelia rakudo-moar d2faa1: OUTPUT«Can not decode a utf-8 buffer as if it were latin-1␤  in block <unit> at /tmp/VL3o4vTpEN:1␤␤»
18:57 jercos m: "Hello, world".encode("latin-1").decode("utf-8")
18:57 camelia rakudo-moar d2faa1: ( no output )
18:57 FROGGS m: "Hello, world".encode("utf-8").WHAT
18:57 camelia rakudo-moar d2faa1: ( no output )
18:57 FROGGS m: say "Hello, world".encode("utf-8").WHAT
18:57 camelia rakudo-moar d2faa1: OUTPUT«(utf8)␤»
18:57 ShimmerFairy masak: surely you don't mean the utf8 type though, right? :)
18:57 FROGGS it is not a buf8
18:57 masak jercos: anyway. I completely agree with you.
18:58 masak jercos: it should go ahead and try... and *then* fail with a failing position if it's not actually decodable as latin-1.
18:58 * masak submits rakudobug
18:58 masak ShimmerFairy: I have no idea. do I?
18:58 masak oh, from what FROGGS++ eval'd it seems I do.
18:59 masak well, I will stop submitting a rakudobug if someone tells me why this is a feature, not an annoyance ;)
18:59 ShimmerFairy m: say buf8.new("Hello, world".encode("utf-8")).decode("latin1")
18:59 camelia rakudo-moar d2faa1: OUTPUT«Hello, world␤»
19:00 ShimmerFairy ^ Once you don't have a Unicode buffer type, it'll work as expected
19:01 jercos hrm... would that incur the same cost as buf8.new(.list)?
19:01 jercos it definitely seems hackier than I would expect
19:01 dha Hm... Am I crazy, or does the latter example at http://doc.perl6.org/syntax/-%3E seem odd to be in the documentation for C<< -> >>?
19:01 FROGGS m: my &d = Blob.^find_method('decode'); say "Hello, world".encode("utf-8").&d('latin-1') # is that error message correct?
19:01 camelia rakudo-moar d2faa1: OUTPUT«Invocant requires a 'Blob' instance, but a type object was passed.  Did you forget a .new?␤  in any  at src/gen/m-Metamodel.nqp:1676␤  in block <unit> at /tmp/c6lQpnpoDa:1␤␤»
19:02 FROGGS ohh wait
19:02 FROGGS m: my &d = Blob[uint8].^find_method('decode'); say "Hello, world".encode("utf-8").&d('latin-1') # is that error message correct?
19:02 camelia rakudo-moar d2faa1: OUTPUT«Invocant requires a 'Blob[uint8]' instance, but a type object was passed.  Did you forget a .new?␤  in any  at src/gen/m-Metamodel.nqp:1676␤  in block <unit> at /tmp/wegl2_fkWe:1␤␤»
19:02 FROGGS hmmm
19:02 ShimmerFairy jercos: I think ideally you'd be able to use a .buf8 method, but for some inexplicable reason there have never been methods for converting to various buffer types.
19:03 jercos maybe a .genericize for specialized buffer types?
19:03 jercos 'twould spit out a buf8 for utf8, buf16 for utf16, so on so forth? :p
19:03 colomon joined #perl6
19:04 smls_ m: say (-> $a, $b { $a ** 2 + $b ** 2})(3, 4)
19:04 camelia rakudo-moar d2faa1: OUTPUT«25␤»
19:04 smls_ dha: Yeah, it's a little odd. This ^^ might be more appropriate.
19:04 ugexe m: "Hello World".encode('utf-8').unpack("A*").say
19:04 camelia rakudo-moar d2faa1: OUTPUT«Hello World␤»
19:05 ShimmerFairy I think it'd be better if we simply had the appropriate type conversion methods :P (also less letters)
19:05 ShimmerFairy Wait, since when did we have (un)pack implemented?
19:05 FROGGS since two years at least
19:05 smls_ only partially though I think
19:05 dha Yeah, the current example to be a digression from documenting the arrow operator into documenting general block syntax.
19:05 FROGGS smls_: aye
19:05 dha s/block/Block/;
19:06 ShimmerFairy FROGGS: I was under the impression that they weren't there at all, because the spec mentions zip about them.
19:07 diana_olhovik_ joined #perl6
19:07 smls_ dha: Ah, it's because that section is automatically extracted from /language/functions where it is actually called "Blocks and Lambdas"
19:08 dha oop. That strikes me as efficient, but wrong. :-)
19:08 smls_ Maybe the way we do that extraction/aggregation needs more thought
19:08 dha I vote yes, fwtw.
19:09 smls_ Do we even need /syntax/* pages? It's not like they're represented in the menu.
19:10 smls_ Maybe we just need to point to /language/syntax.html#some_subsections when you search for syntax tokens
19:28 dha What the.... C<while> isn't documented???
19:28 masak dha: it's kind of an experimental feature.
19:28 masak :P
19:28 [Coke] dha: your sacrifice is appreciated. :)
19:29 [Coke] (it really is, thanks!)
19:29 PerlJam yeah, dha++
19:29 masak waitwait, we perform sacrifices to create documentation nowadays?
19:29 dha It's my... I don't know, "pleasure" seems a bit much... :-)
19:29 masak I must have missed that.
19:29 [Coke] :)
19:30 smls jnthn: Is the return value of ASSIGN-POS and BIND-POS significant?
19:34 dha So, I'm looking at the bit on No-Ops in perlop. Can I assume that C<1 while foo();> still works? Or has it become horribly complicated?
19:37 mohij joined #perl6
19:38 masak dha: :)
19:38 masak dha: that bit still works
19:38 smls m: 1 while $++ < 5;
19:38 camelia rakudo-moar d2faa1: ( no output )
19:38 dha Huh. Seems that C<300 for (1..1000000);'
19:38 dha also works.
19:39 * masak wonders if `1` is the best thing to put there, in terms of things-that-leak-memory
19:39 smls m: 1
19:39 camelia rakudo-moar d2faa1: ( no output )
19:39 Peter_R joined #perl6
19:39 smls ^^ why no "useless use of literal in void context"?
19:39 dha (in perlop, it says that 1 and 0 are special case to not emit warnings in void context)
19:39 smls masak: Then what is?
19:39 dha (but now, it seems a number in void context is ok even if it's not 1 or 0)
19:40 vendethiel dha: I think that's for perl5 modules :)
19:40 vendethiel (that are, iirc, supposed to return 1 if loaded correctly)
19:40 dha vendethiel -  could be for that too (and, yes, they are). But it also seems to be special cased for a virtual no-op.
19:41 dha m: 300
19:41 camelia rakudo-moar d2faa1: ( no output )
19:41 dha m: "boo!"
19:41 camelia rakudo-moar d2faa1: ( no output )
19:41 vendethiel m: { 300 };
19:41 camelia rakudo-moar d2faa1: ( no output )
19:41 VinceDee joined #perl6
19:41 dha Hm... yeah, should those be emitting warnings?
19:42 * vendethiel would think so
19:42 smls m: 300; 400
19:42 camelia rakudo-moar d2faa1: OUTPUT«WARNINGS:␤Useless use of constant integer 300 in sink context (line 1)␤»
19:42 smls ah
19:42 smls just the last one in the file doesn't warn
19:42 vendethiel oooh. that doesn't warn because it's "returned", then?
19:42 smls yeah
19:43 dha Hm. fwiw, perl 5 doesn't warn unless you specifically enable warnings.
19:43 smls use warnings;  is on by default in P6
19:43 dha (which is, I guess, unsurprising, but p6 should have warnings on by default, no?)
19:44 amurf joined #perl6
19:44 dha right.
19:44 dha m: 1, 1
19:44 camelia rakudo-moar d2faa1: ( no output )
19:44 vendethiel that's a list :)
19:44 vendethiel m: SEQ(1; 2)
19:44 camelia rakudo-moar d2faa1: OUTPUT«WARNINGS:␤Useless use of constant integer 1 in sink context (line 1)␤»
19:44 dha m: 1, 0
19:44 camelia rakudo-moar d2faa1: ( no output )
19:44 dha oh, right.
19:44 dha m: 1; 1;
19:44 camelia rakudo-moar d2faa1: OUTPUT«WARNINGS:␤Useless use of constant integer 1 in sink context (line 1)␤»
19:44 vendethiel we don't really have perl5's "soft comma" (as I think they call it)
19:46 lizmat https://p6weekly.wordpress.com/​2015/07/06/2015-27-it-was-hot/   <---- the new Perl 6 Weekly
19:46 vendethiel lizmat++
19:46 dha lizmat++
19:47 colomon lizmat++
19:47 dha So...  Now I'm confused. Does C<1 while foo();> work or not?
19:47 dha 1 does not seem to be special cased as it is in p5.
19:47 masak m: sub foo { state $n = 2; return True if $n-- }; say "OH HAI" while foo()
19:47 camelia rakudo-moar d2faa1: OUTPUT«OH HAI␤OH HAI␤»
19:48 masak dha: it works.
19:48 vendethiel > vendethiel mentioned an an interesting paper on recursion vs corecursion. For the aficionado, I think.
19:48 vendethiel yes, indeed... uses some jargon as well
19:48 masak m: sub foo { state $n = 2; say "OH HAI"; return True if $n-- }; 1 while foo()
19:48 camelia rakudo-moar d2faa1: OUTPUT«OH HAI␤OH HAI␤OH HAI␤»
19:48 lizmat dha: maybe "loop { foo() }" is more idiomatic Perl 6
19:48 masak dha: I'm not aware that `1 while foo();` is special-cased in Perl 5.
19:48 dha masak -  perlop says yes.
19:48 masak lizmat: that doesn't do the same! o.O
19:48 smls masak: Well, it "works" in that it produces not side-effects.
19:49 smls But does it guarantee not to run out of memory?
19:49 ggoebel joined #perl6
19:49 masak lizmat: `loop` loops forever. `while foo()` stops if foo() returns something falsy.
19:49 lizmat duh
19:49 dha I'm currently dealing with http://perldoc.perl.org/perlop.html#No-ops
19:49 masak smls: does `1 while foo();` *guarantee not to run out of memory* in Perl 5!?
19:50 masak smls: what if foo() allocates lots of stuff?
19:50 smls dha's link seems to suggest it does
19:50 smls well, that's different :)
19:51 skids (backlogging) IIRC the use case for Int.new was something to do with subclassing/$?CLASS.new/etc and was asked after by -- ergh I forget who -- doing TZ support.
19:51 lizmat std: while say "foo"
19:51 camelia std 28329a7: OUTPUT«5===SORRY!5===␤Missing block at /tmp/3AcclRos5F line 1 (EOF):␤------> 3while say "foo"7⏏5<EOL>␤Parse failed␤FAILED 00:00 135m␤»
19:51 smls maybe    Empty while foo()   ?
19:51 lizmat why not just "while foo();"  ???
19:52 dha m: while say "foo"
19:52 camelia rakudo-moar d2faa1: OUTPUT«5===SORRY!5=== Error while compiling /tmp/1A99J_tyCE␤Missing block␤at /tmp/1A99J_tyCE:1␤------> 3while say "foo"7⏏5<EOL>␤    expecting any of:␤        block or pointy block␤        postfix␤»
19:53 smls For the same reasons we're not allowed to write "sub foo;" instaed of "sub foo {*}" I guess
19:54 lizmat well, fwiw, I don't see why "while", "until" and "loop" couldn't take a blorst
19:55 moritz because TTIAR
19:55 mst https://www.flickr.com/photos/vm​brasseur/sets/72157655127918530
19:55 mst bah
19:55 atroxaper joined #perl6
19:55 mst wrong bloody paste buffer
19:55 mst http://blog.hackerrank.com/th​e-inevitable-return-of-cobol/
19:55 mst there.
19:56 brrt joined #perl6
19:56 mst thought the fact that decimal arithmetic got a specific mention was interesting
19:56 ugexe m: ".".IO.chdir("lib").say # this should actually try to chdir into $*SPEC.rel2abs("lib", '.') instead of "/lib" correct?
19:56 camelia rakudo-moar d2faa1: OUTPUT«"/lib".IO␤»
19:56 vendethiel .oO( good thing I learned cobol then )
19:56 vendethiel fun fact: cobol has two constructs named "classes"
19:58 moritz mst: fwiw I've been reading such articles for the last ten years
19:58 vendethiel .oO( I swear, won't these cobol guys die already?! )
19:58 vendethiel (sorry)
19:58 moritz mst: and these days I tend to shrug it off as Y2K-like hype
19:58 timotimo ugexe: oh damn, thank you for noticing, i'll revert it
19:59 PerlJam There's still a cobol course at the University where I work.
19:59 mst moritz: more that "there's nothing that the logic can easily be directly ported to"
19:59 mst seemed interesting
19:59 mst I didn't see it as hype, just a note about language features
19:59 moritz mst: *nod*
20:00 moritz fwiw my stance is that if there's a lot of money to be made with COBOL stuff, I still wouldn't like to program in it, but maybe write cross-compilers that do the work for me :-)
20:01 masak that actually sounds like fun. no clue if it's viable, though.
20:02 dalek rakudo/nom: 2823563 | timotimo++ | src/core/Failure.pm:
20:02 dalek rakudo/nom: Revert "make Failure objects a tiny bit smaller"
20:02 dalek rakudo/nom:
20:02 dalek rakudo/nom: It makes the JVM build break, sadly
20:02 dalek rakudo/nom:
20:02 dalek rakudo/nom: This reverts commit d9c1e267f50513eaeb9717be01fea97585e4ca85.
20:02 dalek rakudo/nom: review: https://github.com/rakudo/rakudo/commit/2823563ddc
20:02 moritz masak: last I had that thought, I googled around a bit, and found Java <-> COBOL interop business products
20:02 lizmat timotimo: why not make it conditional for the JVM ?
20:03 nowan joined #perl6
20:04 brrt masak: ehm, since you've studied macro's quite a bit
20:04 yoleaux 06:37Z <FROGGS> brrt: Ummm, what?
20:04 timotimo hmm
20:04 masak brrt: yeees?
20:04 brrt can you advice me to pick a sigil for my macro's in my little tree template language
20:04 masak how about &, like subs?
20:04 brrt i'm thinking ^ for declaring (in the name) and ` for quoting
20:05 masak honestly, I can't advise on such a thing without more context.
20:05 brrt i've already used & for c-level macro's (like offsetof/alignof/sizeof
20:05 brrt https://github.com/MoarVM/MoarVM/b​lob/even-moar-jit/src/jit/exprlist is context :-)
20:06 masak but "tree template language" sounds different enough that much of what I've learned about Perl 6 macros doesn't apply :)
20:06 * masak clicks, looks
20:06 brrt the s-exps represent tree templates
20:06 masak oh, cute.
20:06 brrt $1, $2 etc represent operand param 1 and 2, respectively
20:06 brrt (&offsetof MVMObject st) becomes offsetof(MVMObject, st)
20:07 masak ah.
20:07 masak could you also name a situation where you'd need those (non-c-level) macros?
20:08 brrt yes, can you see the getlex_no thingy?
20:08 masak yes, last in the file.
20:09 brrt the let expression containing $str is actually a quite common pattern in the dynasm code; it acquires a string from the compunit string array]
20:09 brrt it's.. unwieldy, and i've gotten it wrong several times
20:09 brrt if you do get it wrong, tree traversal will die in interesting ways
20:09 masak but it's a fixed template, right? no unquotes?
20:09 brrt whereby interesting means 'rather nonobviously wrong'
20:10 masak or is there something in there that you feel should be parameterized?
20:10 brrt hmm... it should probably contain fill-ins for parameters (e.g. $1)
20:10 brrt yes, i'll need parameters
20:10 * vendethiel looks as well, as he enjoys macros himself
20:10 masak hmmmmm
20:10 dha PERLOP DONE.
20:10 timotimo oh yeah!
20:10 masak dha++
20:11 dha woo.
20:11 PerlJam brrt: Can you show that same example again, but with your hypothetical macro syntax?
20:11 brrt will do
20:11 masak brrt: how about something like `let (($str MACRO_load_str($1) ...` ?
20:12 brrt hmmm
20:12 masak brrt: (that is, a macro is used (and defined) by it having a MACRO_ prefix)
20:12 brrt that's.. not necessarily a bad idea
20:12 masak could work.
20:12 dha ok, this is ridiculous. I'm trying to pull updates for perl6/doc, but it's telling me it's "Already up-to-date." despite changes from a couple of hours ago not being there.
20:12 brrt the only objection i have is that it breaks sexp syntax (i.e. requires another parser)
20:13 brrt but it's nice and obvious
20:13 * dha smacks github with a hammer
20:13 tony-o dha: correct branch?
20:13 dha should be.
20:13 masak brrt: it only requires a hook in the sexp parser that splices in the tree returned from the macro.
20:13 * dha checks to make sure
20:13 masak brrt: you have an easier task than I do in Perl 6, because your trees don't have an environment :)
20:13 PerlJam I was having a feeling about ^ not being "big enough" for a macro sigil, but MACRO_ wouldn't have that (possibly imagined) problem.
20:14 [Sno] joined #perl6
20:14 smls dha: Works for me. Do you have the correct `git remote -v` ?
20:14 masak I think what I like most about the MACRO_ idea is that the definition of macros basically falls out of what's already there.
20:15 masak because otherwise the question becomes "how does the macro specify its parameters? some (...) syntax?"
20:15 masak but here it's just $1, $2... like with the function definitions that are already there.
20:15 dha oh. the git remote -v is, in fact, wrong. Grr. It *wasn't* at some point...
20:15 timotimo brrt: but wouldn't it work just as well with (MACRO_load_str $1) instead of MACRO_load_str($1)?
20:16 brrt hmm yes, it would
20:16 masak right. that was my next point.
20:16 timotimo :)
20:16 masak maybe for consistency you should write it as `(&MACRO_load_str $1)`...
20:16 masak up to you whether you want that & up front
20:16 masak another idea I had was `(&&load_str $1)`
20:17 masak but that might be too confusable with &load_str
20:18 PerlJam maybe `(%load_str $1)`  :)
20:19 brrt https://gist.github.com/bdw/736b57fe772fc0269dbe
20:19 brrt is what it'd be under my suggeted syntax
20:20 brrt so many sigils to choose from
20:20 masak the sigils are not the important choice :)
20:20 masak finding some nice consistency is what matters
20:20 brrt hmm
20:21 PerlJam as long as it's not foolish consistency
20:21 masak right. I'm considering whether re-using $1 et al. for macros is foolish consistency.
20:21 brrt i.. think it is
20:21 brrt hmm
20:22 brrt although
20:22 masak brrt:  you should probably do ,a instead of `a for unquotes
20:22 brrt macro's probably shouldn't have $1 parameters in the first place
20:22 masak brrt: because ,a is unquote in Lisp, whereas `a means quasiquote
20:22 dha joined #perl6
20:22 brrt fair enough
20:22 masak swapping their meaning is too confuzzling
20:23 PerlJam brrt: you mean, macros should have parameters, just not the same a $1, $2, etc ?
20:23 RabidGravy do you know what the most important thing
20:23 PerlJam RabidGravy: happiness.
20:23 masak and I don't think the ` is necessary in the parameter list
20:23 masak RabidGravy: friends
20:23 brrt right. $1 and $2 should refer - i think - to parameters of the operand to which it applies
20:23 PerlJam brrt: right.
20:23 masak brrt: yeah, that makes sense
20:24 RabidGravy changing '.' to  '~' for string concatenation
20:24 masak RabidGravy: \o/
20:24 brrt i think friendship can reasonably compete with that :-P
20:24 masak brrt: and you don't need the ^ before 'get_string' either, AFAIU
20:24 brrt no, you're right
20:24 RabidGravy how many times I mistype . instead of , and it wouldn't get caught until something breaks at runtime
20:25 PerlJam unless you want macros to stand out all the time.
20:25 masak oh, now I see. you're being consistent between definition and use.
20:25 masak hm.
20:25 masak yeah, it works. keep it if you want.
20:25 brrt i'd add that i want the args to the macro spliced in directly
20:25 brrt as in, able to take a list rather than $1
20:26 * PerlJam would still use a "fatter" character than ^ to signify macros
20:26 masak brrt: now for some tough questions.
20:26 brrt such as? the ^ signifies a 'higher level' for me
20:26 brrt ok, bring'm on :-)
20:26 masak brrt: can a parameter such as `a be used many times in the macro body?
20:26 * PerlJam looks up and sees no macros
20:26 brrt yes
20:27 masak brrt: what if it's something with a side effect? does it run several times?
20:28 brrt ...yes, and if you want something else you use (let)
20:28 masak good.
20:28 brrt no obvious way to prevent that, anyhow :-)
20:28 masak right.
20:28 bin_005 joined #perl6
20:28 PerlJam brrt: I would use @ or % or ** or something.  But only because I'd like to know at a glance where the macros are and for me, ^ kind of disappears in the mix
20:29 brrt macro's are fun. i use 'm in C a lot now too
20:29 masak brrt: do you predict that you'll ever invoke a macro inside a macro body?
20:29 brrt could be, yes; i intend to use parser-level splicing
20:29 masak right.
20:29 brrt hmm
20:29 brrt maybe that is not a good idea
20:29 PerlJam brrt: the same macro?  (i.e. "recursion")
20:30 masak seems to be so far.
20:30 masak just that recursion and mutual recursion are out.
20:30 brrt not the same same macro, no
20:30 masak heh, PerlJam++ beat me to it :)
20:30 brrt macro needs to be declared before it can be used
20:30 masak right.
20:30 masak glad we agree.
20:30 brrt :-)
20:30 masak then I really like ^ as a character choice, I think :)
20:31 masak the mnemonic is "look above for the thing to put here" :D
20:31 masak which is a (weak) reason not to include it in the definition...
20:32 masak brrt: do you ever envision passing a function (reference) to a macro? what about passing a macro to a macro?
20:32 brrt hmmm... i did include the $ for the name definitions in the let declaration
20:32 masak brrt: what about returning a macro (reference) from a macro?
20:33 brrt wait, let me think about that
20:33 * masak thinks, too
20:33 brrt the last, no, i don't need that kind of power
20:33 brrt the first, to be clear there's not really such a thing as a function at this level
20:33 brrt just trees
20:34 PerlJam seems to me like there's a lot of power in being about to pass a macro to another macro.
20:34 brrt they look like code, they represent code, but they're trees, and they're never evelauted
20:34 masak PerlJam: yes, I think so too.
20:34 masak PerlJam: the use case I'm envisioning is something like sort-using-callback.
20:35 masak brrt: right, understood.
20:35 brrt as in: (^foo ,a) (,a b) and you'd pass (^foo ^bar) which would result to (^bar b) which would evaluate to whatever (^bar b) would evaluate
20:35 brrt that is very powerful, i use it in C
20:36 brrt but the macro-evaluation semantics are more complex; you'd have to do a tree-walk after constructing the macro to fill it in
20:36 masak aye.
20:36 brrt not-sure-if-worth-it
20:36 masak maybe forbid it until you see that it would be worth it?
20:38 brrt yes, seems reasonable
20:38 masak ok, I like where we ended up. good luck. :>
20:39 PerlJam brrt: are you going to use this for the jit?
20:39 brrt :-) thanks
20:39 brrt yes
20:40 brrt this generates tree templates, which are then stitched together to form an expression tree
20:41 espadrine_ joined #perl6
20:41 brrt 'tree' is a huge misnomer at this point, but so what
20:41 MueThoS76 joined #perl6
20:41 brrt the expression tree is then input to the (hypothetical so far) code generator
20:41 masak one final thought: as you start using this... pay close attention to how it shapes your thoughts. after not-too-long you will get so used to thinking in terms of this model that it will be hard-ish to think outside of it.
20:42 masak so take the chance while you're still not so used to it ;)
20:43 PerlJam masak++ I'd say those are some words of wisdom
20:44 masak "the map is not the territory" -- EY
20:44 dha Oof. Out of curiosity, is it a known thing that the search field in docs.perl6.org pages is kinda.... awful?
20:44 brrt yes, i'll do that :-)
20:44 brrt thanks
20:45 masak dha: I was thinking the same the other day.
20:45 masak dha: I don't think it's hopeless, it's just... been through fewer iterations than the rest of that page.
20:46 dha So, C<while> isn't actually documented in those documents, so, I'm not wholly surprised it can't be searched for (although I am wholly surprised that it's not documented...)
20:46 dha But C<given> *is* documented, but can't be searched for.
20:46 masak that's an outright bug. please submit.
20:47 dha ok. Submit an issue at https://github.com/perl6/doc ?
20:48 brrt that cobol article makes some ... strange points
20:49 RabidGravy cobol is strange
20:49 masak dha: yes, please.
20:49 dha *nod*
20:50 brrt anyway, off for tonight :-)
20:51 skids dha: Someone else started the control flow, and I added a lot of what's there, but I stopped short of doccing some loops because GLR will change their return value, so examples would have been premature.
20:51 RabidGravy (and I'm saying that having not done any cobol since perhaps 1997)
20:51 dha GLR?
20:51 skids Great List Refactor.
20:51 skids (That IS documented :-)
20:51 dha Ah.
20:52 PerlJam S99:GLR
20:52 dalek rakudo/nom: 6e425fd | lizmat++ | src/Perl6/World.nqp:
20:52 dalek rakudo/nom: Be more strict in accepting no args pragma's
20:52 dalek rakudo/nom: review: https://github.com/rakudo/rakudo/commit/6e425fdc02
20:52 dha Ah.
20:52 synbot6 joined #perl6
20:52 PerlJam S99:GLR
20:52 synbot6 Link: http://design.perl6.org/S99.html#GLR
20:53 PerlJam much better
20:53 dha Still, while and for loops can be *bascially* documented, surely?
20:53 lizmat while / until I see no problem with
20:54 lizmat for...  not so sure what would be the best at this stage of the game
20:54 davido__ joined #perl6
20:54 skids They can be docced to some extent, but the return values are a big part of it.
20:56 dha If you say so. But, for people coming from p5 at least, something about how C<< -> >> is used in such statements would probably be really helpful.
21:02 larion joined #perl6
21:02 dalek roast: b07221d | lizmat++ | S02-types/WHICH.t:
21:02 dalek roast: Add X::Adverb::Slice
21:02 dalek roast: review: https://github.com/perl6/roast/commit/b07221dac2
21:03 skids I certainly don't mean to discourage you :-).  I'd just keep it to a couple short quick examples knowing the section will be reworked later.
21:03 skids Also, BTW, this is one area where the synopsis reads very smoothly.
21:07 dha ok.
21:12 RabidGravy dha, the "pointy block" is the same whether it's used in a for, an if, or an "anonymous sub" so yeah that's fair
21:13 dha right, but as a perl 5 programmer wouldn't even know to look for it...
21:13 dha Or *when* to look for it, for that matter.
21:16 RabidGravy Almost all "control structures" it's a pointy block
21:16 RabidGravy or a block which can be pointy if it makes sense
21:16 dha Well, but you actually *know* that.
21:17 masak maybe it should be mentioned under "control flow"?
21:17 dha Not a bad idea.
21:18 * lizmat goes to catch some sleep (again)
21:18 dha I mean, C<< -> >> is actually documented (and searchable!), but... that's sort of backwards from the perspective I'm coming from. It says "Whenever you see something like { $_ + 42 }, -> $a, $b { $a ** $b }..."
21:18 masak lizmat: 'night
21:19 hoelzro can you return a Str via a char ** in NativeCall? ex. void my_routine(char **return_pointer) { *return_pointer = "foobar" }; my sub my_routine(Str $return-str is rw) is native(...) { * }
21:19 dha Whereas, from my perspective I'm thinking "but if I'm actually trying to write code, what am I supposed to do?" for which, looking for C<< -> >> isn't obvious.
21:20 masak also might be good to mention cases where this is actually useful.
21:20 masak I've always been fond of `if condition() -> $interesting-truthy-value { ... }`
21:20 RabidGravy yeah
21:20 masak as well as `given computation() -> $bound-result { ... }`
21:21 masak I sometimes do `given open($path) -> $fh { ... }`
21:21 dha This seems, to me, a pretty important aspect of the language, and that it's not easy to find appears a bit problematic.
21:22 dha (not easy to find for a beginner, anyway)
21:22 RabidGravy the for case is the clearest for someone coming to it from p5 though IMO
21:22 masak I don't know about "very important". it's just nicely consistent, and easy to learn to like :>
21:23 AlexDaniel joined #perl6
21:24 masak in that vein -- but a different construct -- I hope the documentation will speak warmly of the `repeat while my $keep-going { ... }` pattern, which declares a variable before the loop, but evaluates it afterwards.
21:24 masak (we discussed it the other day)
21:26 dha Well, does C<for my $x qw[1 2 3 4]> still work? If not, and you need to do C<< for 1, 2, 3, 4 -> $x >>, C<< -> >> seems important.
21:27 * dha would check, but is currently rebuilding p6
21:27 RabidGravy yes the latter
21:28 masak m: for my $x <1 2 3 4> { }
21:28 camelia rakudo-moar 6e425f: OUTPUT«5===SORRY!5=== Error while compiling /tmp/C5bGTuW3L3␤Missing block␤at /tmp/C5bGTuW3L3:1␤------> 3for my $x <17⏏5 2 3 4> { }␤    expecting any of:␤        block or pointy block␤        infix␤        infix stopper␤»
21:28 RabidGravy always "for @listy-thing -> $v { }"
21:28 dha Right, so IMO, that makes the pointy block pretty darned important...
21:28 masak m: my @list; for my $x (@list) { }
21:28 camelia rakudo-moar 6e425f: OUTPUT«5===SORRY!5=== Error while compiling /tmp/ti2hjcdH4O␤This appears to be Perl 5 code␤at /tmp/ti2hjcdH4O:1␤------> 3my @list; for 7⏏5my $x (@list) { }␤»
21:29 masak 'night, #perl6
21:29 RabidGravy but it's cooler because it will take multiple args to the block
21:29 RabidGravy so you can e.g.  for %h.kv -> $key, $value  { }
21:30 RabidGravy and so on and so forth
21:31 dha Oh, I'm sure it's WAY handy, but that means it would be a lot more useful to have it documented.
21:32 [Coke] I am sure everyone is on the same page there.
21:34 dha Ok. :-)
21:34 dha But is anyone going to do anything about it? ;-)
21:34 RabidGravy yes you are ;-)
21:35 dha Nah, not me. I may wind up explaining it to p5 people, but I'm not taking responsibility for the official explanation. :-)
21:35 RabidGravy It's probably only a little tweaking in the http://docs.perl6.org/language/5to6
21:36 RabidGravy in the first instance
21:36 dha Hm. Good point.
21:37 dha My problem with doing that, however, is that, without actual documentation, I'm not sure that I actually understand how it works.
21:38 dha For instance, what happens with C<< for %h.kv -> $a, $b, $c>?
21:38 dha ok, I didn't do the angle brackets right there, but you can see what I'm saying.
21:39 RabidGravy my dumb view of it is that nearly all the blocks of control structures are "anonymous subs" and that the -> introduces the arguments
21:40 El_Che pretty much like || in ruby
21:40 RabidGravy some of those control structures (such as 'for') may call that "anonymous sub" multiple times with different argumentas
21:43 dha Also, it looks like C<< -> >> localizes the, in these examples, C<$a>, C<$b>, etc. variables. Is that actually the case?
21:43 dha (I'm not necessarily asking that, but it's an example of the things I don't know well enough to document)
21:44 RabidGravy yes, in the same way as " sub ($a, $b) { } " does
21:44 RabidGravy which is why, e.g., no "my"
21:44 dha I assume that should be "sub foo ($a, $b)..." ?
21:45 rindolf joined #perl6
21:46 RabidGravy no, no literally:
21:46 RabidGravy m: my $f = sub ($c) { say $c }; $f("gg")
21:46 camelia rakudo-moar 6e425f: OUTPUT«gg␤»
21:46 dha ah. so, essentially, an anonymous sub.
21:47 RabidGravy (you can declare a signature for an anonymous sub)
21:47 dha *nod*
21:47 RabidGravy which is (almost) exactly the same as:
21:48 RabidGravy m: my $f = -> $c { say $c }; $f("gg")
21:48 camelia rakudo-moar 6e425f: OUTPUT«gg␤»
21:48 RabidGravy which is a nice one for the obfu fans
21:49 dha huh. ok, see, I can see how that would work, but I wouldn't have thought of it, EVER, and have no idea how I would explain it.
21:49 dha This is why I would not feel comfortable writing the documentation for pointy blocks.
21:51 RabidGravy to be honest the http://docs.perl6.org/language/control#blocks could explain this a bit more clearly
21:52 dha That looks like it has the backwards problem from the C<< -> >> documentation.
21:53 dha C<< -> >> starts talking about Blocks without pointiness, and this talks about Blocks, but leaves out pointiness entirely.
21:53 RabidGravy yep
21:54 RabidGravy need more stupid people who have to explain things to normal people sometimes to work on the documentation ;-)
21:55 dha Like me? :-)
22:01 rindolf joined #perl6
22:05 nys joined #perl6
22:06 RabidGravy dha, you worry too much so you can't be stupid enough ;-)
22:07 dha Clearly.
22:09 virtualsue o/ dha
22:09 * dha waves
22:09 virtualsue and \o RabidGravy
22:09 RabidGravy :-*
22:11 RabidGravy I may take a poke at that control document in the morning as some light relief from these modules I'm doing
22:11 zoosha joined #perl6
22:13 RabidGravy anyway I'm *not* going to watch Jaws 2 for the umpteenth time so I think I'll crash
22:13 RabidGravy toodlepip #perl6
22:22 dha joined #perl6
22:34 davido__ joined #perl6
22:36 labster m: DateTime.new(year=> 2015, seconds => -86500).say
22:36 camelia rakudo-moar 6e425f: OUTPUT«2015-01-01T00:00:00Z␤»
22:37 TimToady I used to write '0 while stuff()', but that bothered people somehow more than '1 while stuff()'
22:37 labster m: DateTime.new(year=> 2015, seconds => 86500).say
22:37 camelia rakudo-moar 6e425f: OUTPUT«2015-01-01T00:00:00Z␤»
22:37 TimToady these days, I'd probably write 'Nil while stuff()'
22:37 labster m: DateTime.new(year=> 2015, second => -86500).say
22:37 camelia rakudo-moar 6e425f: OUTPUT«second out of range. Is: -86500, should be in 0..^62␤  in block <unit> at /tmp/CvFHToW68F:1␤␤»
22:38 labster 62 is kinda LTA there, but otherwise good.
22:40 TimToady yeah, should really say 0..61 I suspect
22:40 labster yeah, it looks good in the source code, with 0..^24 and 0..^60 above it... but 62 looks magical here.
22:41 TimToady arguably it's 0..^61 because of leap seconds, but maybe the idea is that the earth could take a major wobble at some point and need 2 leap seconds at once
22:41 geekosaur yes
22:42 geekosaur 2 leap seconds are allowed for in the spec
22:42 * TimToady I'd rather see them abolish leap soconds and do a major correction every century or so
22:42 labster And never do them at all in UTC.
22:43 TimToady well, you need them eventually, but only when the delay gets up around half a timezone
22:43 TimToady so they should probably solve it with leap hours someday
22:43 TimToady scheduled well in advance
22:44 labster i.e. some future programmer's problem.
22:45 TimToady ayup
22:45 vendethiel *g*
22:45 vendethiel .oO( but perl6 is supposed to still be around then! )
22:45 dha Never do today what you can put off until the next century.
22:45 TimToady when timezones have a slop of 15°, there's no reason to keep civil time so close to astronomical
22:45 labster Perl 6 will build up temporal debt
22:45 [Coke] by that point, we'll all be going off earth central time and won't care about matching midnight to a longitude.
22:47 labster I think they already have that in the central kingdom^W^W PRC.
22:54 TEttinger joined #perl6
22:55 skids joined #perl6
22:59 cognominal joined #perl6
23:05 leont joined #perl6
23:08 amurf joined #perl6
23:09 dalek rakudo-star-daily: 7610cde | coke++ | log/ (9 files):
23:09 dalek rakudo-star-daily: today (automated commit)
23:09 dalek rakudo-star-daily: review: https://github.com/coke/rakudo​-star-daily/commit/7610cde5b9
23:09 dalek perl6-roast-data: 7142afa | coke++ | / (9 files):
23:09 dalek perl6-roast-data: today (automated commit)
23:09 dalek perl6-roast-data: review: https://github.com/coke/perl6​-roast-data/commit/7142afa90b
23:20 telex joined #perl6
23:22 dalek doc: c33d70b | (David H. Adler)++ | WANTED:
23:22 dalek doc: Added C<srand> and C<state> to WANTED
23:22 dalek doc: Added C<use> to WANTED
23:22 dalek doc: review: https://github.com/perl6/doc/commit/c33d70bb86
23:22 dalek doc: eef0e62 | (David H. Adler)++ | lib/Language/regexes.pod:
23:22 dalek doc: Added language to specify the default values for C<:c>
23:22 dalek doc: review: https://github.com/perl6/doc/commit/eef0e62f19
23:32 atroxaper joined #perl6
23:58 spollei joined #perl6

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

Perl 6 | Reference Documentation | Rakudo