Perl 6 - the future is here, just unevenly distributed

IRC log for #perl6, 2014-10-04

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:03 Hor|zon joined #perl6
00:05 ssutch joined #perl6
00:07 bjz joined #perl6
00:08 bjz joined #perl6
01:14 Mso150 joined #perl6
01:18 fhelmberger joined #perl6
01:24 ssutch joined #perl6
01:25 kurahaupo joined #perl6
01:50 FROGGS_ joined #perl6
02:03 noganex joined #perl6
02:04 Hor|zon joined #perl6
02:19 gtodd1 TuxCM:  so here -->  my@x=("1ab");for @x { s{^(\d+)} = sprintf "%3d:", $1; }; @x.say  ; you want to format the digit in the list?
02:41 Alina-malina joined #perl6
02:44 retupmoc1 joined #perl6
02:44 [Coke]_ joined #perl6
02:45 avuserow_ joined #perl6
02:45 sergot_ joined #perl6
02:45 btyler_ joined #perl6
02:45 ugexe_ joined #perl6
02:52 japhb joined #perl6
02:58 FROGGS_ joined #perl6
03:05 _slade_ joined #perl6
03:36 MikeFair joined #perl6
03:36 MikeFair__ joined #perl6
03:39 MikeFair__ joined #perl6
04:05 Hor|zon joined #perl6
04:53 PZt joined #perl6
05:17 rindolf joined #perl6
05:18 xenoterracide joined #perl6
05:18 fhelmberger joined #perl6
05:57 MikeFair_ joined #perl6
06:03 SamuraiJack_ joined #perl6
06:06 Hor|zon joined #perl6
06:30 samebchase joined #perl6
06:36 anaeem1 joined #perl6
06:43 kaare_ joined #perl6
06:52 FROGGS pmichaud: about caching only a subset of calls... wouldn't the sanest approach be to only cache only some MMD candidates?
06:56 darutoko joined #perl6
06:57 camelia joined #perl6
06:58 FROGGS s:2nd/only\s//
07:04 FROGGS nowadays we can send a signal to a spawned (shell) process, right?
07:04 FROGGS I'd like to add test for the REPL
07:04 FROGGS tests*
07:07 FROGGS lizmat: I managed to run spectests for all backends over night, https://gist.github.com/FROGGS/ac4fff2b2d2c815eacb3
07:07 FROGGS lizmat: looks like parrot need some love still
07:08 lizmat good morning, FROGGS
07:08 lizmat was going to look at that today as well  :-)
07:08 FROGGS good morning :o)
07:08 lizmat as well as the chdir() issues colomon found
07:08 FROGGS ahh, don't know about that one
07:10 FROGGS m: multi foo(Int) is cached { say 'Int' }; multi foo(Str) { say 'Str' }; foo 1; foo 1; foo 'a'; foo 'a'
07:10 camelia rakudo-moar b3331e: OUTPUT«Cannot invoke object with invocation handler in this context␤  in sub foo at /tmp/zWM01_TzeB:1␤  in block <unit> at /tmp/zWM01_TzeB:1␤␤»
07:10 FROGGS :/
07:10 FROGGS I feared that
07:12 lizmat that's odd, the wrap should only be applied to the first
07:12 FROGGS m: multi foo(Int) is cached { say 'Int' }; foo 1; foo 1;
07:12 camelia rakudo-moar b3331e: OUTPUT«Cannot invoke object with invocation handler in this context␤  in sub foo at /tmp/EpBFnacF6n:1␤  in block <unit> at /tmp/EpBFnacF6n:1␤␤»
07:12 lizmat that's worthy of a rakudobug
07:12 FROGGS m: sub foo(Int) is cached { say 'Int' }; foo 1; foo 1;
07:12 camelia rakudo-moar b3331e: OUTPUT«Int␤»
07:12 FROGGS yeah
07:13 * FROGGS masaks that bug
07:18 FROGGS RT #122899: Cannot apply trait 'is cached' on multi candidate
07:18 synopsebot Link: https://rt.perl.org/rt3//Public/Bug/Display.html?id=122899
07:18 FROGGS would be nice is synopsebot would fetch the title of the bug as well
07:22 lizmat m: proto foo(|) is cached { * }; multi foo(Int) { say 'Int' }; multi foo(Str) { say 'Str' }; foo 1; foo 1; foo 'a'; foo 'a'
07:22 camelia rakudo-moar b3331e: OUTPUT«Int␤Str␤»
07:23 lizmat putting the "is cached" on the proto seems to be a workaround
07:23 lizmat breakfast&
07:36 [TuxCM] gtodd1, yes
07:49 FROGGS[mobile]2 joined #perl6
07:59 Mso150 joined #perl6
08:03 masak alohoj, #perl6
08:06 masak pmurias: http://irclog.perlgeek.de/perl6/2014-10-03#i_9453701 -- I'm keeping such a list locally. I may or may not be convinced of the merits of making it public.
08:06 masak pmurias: regardless, I'll be blogging about use cases and implementation choices.
08:08 Hor|zon joined #perl6
08:15 laben joined #perl6
08:15 laben ohayo #perl6
08:15 lizmat masak laben  o/
08:15 lizmat laben: panda should be really fixed now
08:16 spider-mario joined #perl6
08:17 laben mh, it was already fixed for me, at least from Panda tests and compilation of Inline::Perl5
08:17 laben lizmat: i remember having posted here that
08:18 lizmat laben: well, you were the only one  :-(
08:18 laben maybe because i'm the only one who does not bootstrap panda
08:18 lizmat but it's ok now, was a stupid thinko on my part, uncovered by FROGGS++
08:19 laben so, were you able to retain the new specced behaviour?
08:19 carlin heh, my perl6 script made bash explode, can't replicate it though :(
08:19 carlin *** Error in `/bin/bash': double free or corruption (out): 0x0000000001bea600 ***
08:19 laben gosh, 4 bash updates in a week, damned shellshock
08:20 lizmat laben, almost: dir() still returns IO::Path objects
08:20 lizmat making that more up to spec, is going to be more involved
08:23 laben lizmat: sorry i did not test bootstrapping, it errors out indeed with older rakudo
08:23 lizmat no worries, we found the issue
08:26 Mso150 joined #perl6
08:31 carlin is anyone else getting test failures installing Inline::Perl5 through panda?
08:31 carlin I'n getting
08:31 carlin t/callables.t ............. 1/3 panic: MUTEX_LOCK (22) [op.c:697]
08:31 carlin but it doesn't happen with a manual checkout :/
08:32 rurban joined #perl6
08:35 laben just tested, i don't get failures neither manually nor with panda
08:35 laben carlin: did you update rakudo before using panda?
08:36 carlin using rakudo HEAD, and a rebootsrapped panda
08:36 carlin I'll blow away the install directory and try fresh
08:36 laben carlin: good idea
08:40 leont joined #perl6
08:56 lizmat yuck: on parrot, a gather { loop {} } instead of a gather loop {} broke dir()
08:58 carlin strange test failure still happens with a fresh install, doesn't happen with rakudo 230233b3941d2 and panda 51fc726008
08:58 carlin bisecting it down better than that is proving to be difficult as various rakudo commits break panda + various panda commits don't work with older rakudo
08:59 nine Where can I find docs about make?
08:59 carlin man make? :)
09:00 nine I mean the Perl 6 thing called make that I found in JSON::Tiny::Actions
09:00 nine like: make $/.values.[0].ast;
09:01 carlin http://doc.perl6.org/routine/make
09:02 nine That's....somewhat terse
09:02 nine in other words: I have no idea what it's trying to tell me
09:03 nine And how can this be the method from class Match? It looks more like a function call
09:04 lizmat S05:2963 might give you more info
09:04 synopsebot Link: http://perlcabal.org/syn/S05.html#line_2963
09:04 lizmat also, the course materials from last year's NQP workshop
09:14 FROGGS[mobile] joined #perl6
09:14 nine Does my action object has to have a method for every token in the grammar?
09:15 jnthn nine: No, we only call action methods that exist.
09:15 darutoko- joined #perl6
09:15 jnthn nine: No method = no call.
09:16 jnthn Some tokens are too boring/primitive to really deserve an action method (typically, lexer-ish things)
09:19 fhelmberger joined #perl6
09:38 nine Thanks all! Slowly making progress
09:59 [Sno] joined #perl6
10:08 Hor|zon joined #perl6
10:15 laben mmh, the doc.perl6.org documentation seems a bit incomplete...
10:18 camelia joined #perl6
10:27 kurahaupo joined #perl6
10:32 araujo joined #perl6
10:35 pepl joined #perl6
10:36 erkan joined #perl6
10:47 timotimo o/
10:47 pmurias joined #perl6
10:48 lizmat timotimo \o
11:06 pmurias masak: personally I'm interested in seeing the use cases list, I think putting it on github so people can add their own things they would like to do with macros makes sense
11:08 pmurias masak: Implementing the use cases in some of the existing macro systems could also prove a useful exercise to see what are the good/bad points of various approaches
11:27 nine Is SVG::Plot known to work?
11:31 timotimo i've used it like a month ago and it worked
11:32 timotimo if you don't use it properly, though, it can fail in mysterious ways
11:32 nine I've found out that SVG.serialize wants svg => $svg instead of just plain $svg and now I get a diagram but without any values.
11:36 dalek rakudo/nom: 630a729 | (Elizabeth Mattijsen)++ | src/core/IO/Spec/ (2 files):
11:36 dalek rakudo/nom: Add naive IO::Spec::Unix||Win32.basename
11:36 dalek rakudo/nom:
11:36 dalek rakudo/nom: Mostly for internal .dir usage, as it doesn't handle edge cases well
11:36 dalek rakudo/nom: review: https://github.com/rakudo/rakudo/commit/630a729618
11:51 rurban joined #perl6
11:55 nine Mysterious indeed. It clearly seems to create SVG for the bars but they are missing in output.
11:55 nine Is there a variant of .perl that pretty prints?
11:55 masak pmurias: I will give it some thoughts. I can see pros and cons of sharing at this point.
11:55 masak thought*
11:56 masak pmurias: it will get easier once the way forward is clear and the design "congeals".
11:57 masak pmurias: in the meantime, please propose use cases ;)
12:01 nine timotimo: Seems like it's my old friend again...list interpolation. I really wonder if SVG::Plot still works for you on recent Rakudo
12:01 timotimo i shall find out whether i still have that piece of code.
12:03 nine timotimo method linkify returns a [] instead of a list which is why data and x-axis labels are missing from output while y-axis labels are there.
12:03 nine timotimo: replacing take $.linkify($k, $p) with take $p fixes it for me.
12:03 timotimo (and also build a fresh rakudo)
12:08 nine take |$.linkify($k, $t); also works
12:09 Hor|zon joined #perl6
12:14 masak the | in that position always surprises me a little.
12:15 masak mostly because Perl 6 does not have a prefix:<|> -- it's only valid in siggies.
12:16 timotimo https://www.pehub.com/wp-content/uploads/2012/03/siggi-yogurt-vanilla.jpg ?
12:19 nine I wonder what the real fix would be
12:24 dalek rakudo/nom: ae11b53 | (Elizabeth Mattijsen)++ | src/core/IO/Path.pm:
12:24 dalek rakudo/nom: Fix dir() on all backends
12:24 dalek rakudo/nom:
12:24 dalek rakudo/nom: - :test now works as intended
12:24 dalek rakudo/nom: - :absolute parameter (new spec) also works
12:24 dalek rakudo/nom: - :CWD parameter doesn't work correctly yet on all backend (todo)
12:24 dalek rakudo/nom:
12:24 dalek rakudo/nom: I hope future backends will just work as moar  :-)
12:24 dalek rakudo/nom: review: https://github.com/rakudo/rakudo/commit/ae11b53ab6
12:26 pmurias masak: what are the cons?
12:29 masak pmurias: grep for "A little retrospection" at https://en.wikiquote.org/wiki/Fred_Brooks
12:34 pmurias that would be a cons against developing the macro specification by committe
12:37 kjs_ joined #perl6
12:48 masak pmurias: my time to design this will be limited, and there is a whole lot of prior art and material to process and consider. I'm disinclined to add to that the burden of having to explain and defend early design decisions, time which could be spent on other things.
12:51 masak having said that, I will try to blog-early-blog-often about thoughts I have and decisions I make.
13:09 dalek rakudo/nom: d3622d8 | (Brad Gilbert)++ | src/core/Instant.pm:
13:09 dalek rakudo/nom: Make Instant.perl to produce eval-able code
13:09 dalek rakudo/nom:
13:09 dalek rakudo/nom: Instant.new takes one positional argument, not a argument named x
13:09 dalek rakudo/nom: review: https://github.com/rakudo/rakudo/commit/d3622d80d4
13:09 dalek rakudo/nom: 3af2500 | lizmat++ | src/core/Instant.pm:
13:09 dalek rakudo/nom: Merge pull request #318 from b2gills/nom
13:09 dalek rakudo/nom:
13:09 dalek rakudo/nom: Make Instant.perl to produce eval-able code
13:09 dalek rakudo/nom: review: https://github.com/rakudo/rakudo/commit/3af2500b9b
13:12 rurban I'm adding several parrot encoding and cclass fixes. FROGGS++ and usev6++
13:12 masak rurban++
13:12 lizmat moritz: re Instant.pm, is there a reason why the only attribute is called "x" and all internal accesses use the $.x form ?
13:13 lizmat rurban++ indeed
13:13 masak lizmat: I didn't author the code, but -- analogy with x axis and its coordinate?
13:14 lizmat IO::Path.x means executable...  so that might be confusing
13:14 masak is there a second question in there about using $.x in methods instead of $!x ? I consider that good, or at least consistent/defendable, style.
13:14 masak IO::Path and Instant are non-intersecting.
13:15 lizmat true, but generally browsing code you'd expect .x to mean executable first
13:16 masak I agree that it's a poor name, but not for that reason ;)
13:19 lizmat anyway, if you're subclassing Instant, it feels you would be subclassing methods
13:19 lizmat and those methods could use $.x
13:19 lizmat internally, I would prefer $!x for performance reasons
13:19 lizmat and I'm pretty sure jnthn is with me on this :-)
13:20 masak $!x and $.x for read accesses in OO code have two very different and equally valid intents.
13:20 masak the former says "I do not intend for the access to $!x to be virtual"
13:20 masak the latter says "the access to $!x is virtual, and can be overridden by subclasses"
13:21 lizmat yes, I'm quite aware of this  :-)
13:21 masak I was pretty sure you were :)
13:21 lizmat cycling&
13:21 masak my point is simply that $.x in OO code is not automatically wrong, and should not be knee-jerk replaced.
13:22 lizmat that's why I asked moritz if he had a specific reason  :-)
13:22 Ven_ joined #perl6
13:22 masak if you ask me, knowing when to do $!x and when to do $.x is really hard, as it involves anticipating what subclassers might do with the code.
13:22 masak which quickly ruins into YAGNI.
13:22 FROGGS[mobile] joined #perl6
13:22 masak runs*
13:23 lizmat hence my inclination to always use $!foo in the core for performance, and wait until somebody needs it to change it  :-)
13:24 lizmat really cycling&
13:24 grondilu joined #perl6
13:24 masak I understand that sentiment, but I don't think it's that universal.
13:27 djanatyn joined #perl6
13:29 vendethiel joined #perl6
13:30 rurban who is usev6?
13:31 vendethiel o/, #perl6.
13:32 masak good univalence, vendethiel
13:34 vendethiel err. thanks, masak, I guess
13:34 * masak .oO( note to self: mixing greetings and higher-order type theory confuses people )
13:36 vendethiel Kind of. Sorry, I'm really tired, so you'll need to wait for brain cells to connect
13:38 masak no worries :)
13:40 kurahaupo joined #perl6
13:45 zakharyas joined #perl6
13:50 dj_goku timotimo: always fun readding the weekly blog posts! keep it up!
13:51 gtodd1 TuxCM: my @x=("1ab");for @x { s{^(\d+)} = sprintf "%3d :", "$1"; }; @x.say
13:51 gtodd1 m: my @x=("1ab");for @x { s{^(\d+)} = sprintf "%3d :", "$1"; }; @x.say
13:51 gtodd1 oops
13:51 camelia rakudo-moar ae11b5: OUTPUT«  0 :ab␤»
13:53 gtodd TuxCM:  hmm so the ^(\d+) bit doesn't work ... with the RHS  the as expected?
13:53 gtodd m: my @x=("1ab");for @x { s{^(\d+)} = sprintf "%3d :", $1; }; @x.say
13:53 camelia rakudo-moar ae11b5: OUTPUT«No such method 'item' for invocant of type 'NQPMu'␤  in method message at src/gen/m-CORE.setting:13332␤␤»
14:05 FROGGS[mobile]2 joined #perl6
14:05 b2gills lizmat: IO::Spec::Win32 should split up paths on both \ and / ( both have worked since DOS 2 )
14:10 Hor|zon joined #perl6
14:14 virtualsue joined #perl6
14:15 vendethiel masak: where would "is parsed" (or the like) macros be in your macro proposal? (which part, that is)
14:15 vendethiel I'm scared of this one. I know that a lot of people think this is what "killed" CL, because reader macros encouraged a "dead island programming": only you can use stuff you've done, because there's so much other syntaxes going on
14:16 vendethiel and, while I can see the argument - I don't think it's true, I don't think CL would have won without them - it seems people nowadays care a lot less about those kind of things
14:16 masak vendethiel: here's what I observe: "is parsed" is currently a kind of threshold that people pass in order to get more interesting parsing of the Perl 6 program. as they pass it, they give up all the nice things that come with AST macros.
14:16 vendethiel Just look at the operators in scala/haskell. They're definitely too much "sometimes", but we have the same power (actually, a greater one, only agda has a better parsing thingie :P)
14:17 masak vendethiel: I don't know exactly how yet, but I'm hoping we can make some use cases that currently need "is parsed" work with Qtrees instead.
14:17 masak this is partly what I mean with "have the cake and eat it".
14:17 vendethiel masak: I guess in a lot of cases, those could be slangs
14:17 virtualsue left #perl6
14:18 virtualsue joined #perl6
14:18 vendethiel I'm just... Wondering. It's the "too much power" as usual
14:19 [Coke] .seen donaldh
14:19 yoleaux I saw donaldh 8 Sep 2014 09:40Z in #perl6: <donaldh> according to [Coke]++
14:20 [Coke] .ask donaldh if I can "donaldh/perl6-eclipse-plugin for dummies README"
14:20 yoleaux [Coke]: I'll pass your message to donaldh.
14:20 virtualsue joined #perl6
14:20 [Coke] .ask donaldh (that is, if I can -have- one, not make one)
14:20 yoleaux [Coke]: I'll pass your message to donaldh.
14:20 [Coke] has anyone used his perl6 plugin for eclipse ye?
14:20 [Coke] t?
14:24 masak it will be a slippery slope to slangs, more like.
14:24 masak as in, debates will happen whether some particular code should've been in a slang, or whether 20 macros are fine :)
14:24 masak Perl 6 thrives on "too much power".
14:32 pecastro joined #perl6
14:35 vendethiel masak: it might do, but that doesn't force me to like it everywhere :P
14:36 vendethiel I know that I think differently on that one (compared to most here
14:36 vendethiel )
14:43 vendethiel masak: (when doing haskell and stuff, I usually explicitly list all the operators I import, to be very sure)
14:44 dalek nqp: 390f7fa | Carlin++ | src/vm/moar/profiler/template.html:
14:44 dalek nqp: avoid mixed-content issues in the profiler output
14:44 dalek nqp:
14:44 dalek nqp: loading the css/js over https in an http page has no negative side-effects
14:44 dalek nqp: but using http in an https page will cause some browsers to not load the
14:44 dalek nqp: assets due to mixed-content restrictions
14:44 dalek nqp: review: https://github.com/perl6/nqp/commit/390f7fad57
14:44 dalek nqp: 0672e0d | rurban++ | src/vm/moar/profiler/template.html:
14:44 dalek nqp: Merge pull request #189 from carbin/brought-to-you-by-the-letter-s
14:44 dalek nqp:
14:44 dalek nqp: avoid mixed-content issues in the profiler output
14:44 dalek nqp: review: https://github.com/perl6/nqp/commit/0672e0d66c
14:49 masak vendethiel: hrm. well, I'm all for listing imports explicitly.
14:49 masak vendethiel: maybe I didn't completely understand your "too much power" message, then.
14:49 vendethiel masak: I don't want people to be absolutely unable to read other people's code.
14:50 masak vendethiel: my main point is that the combined power various components in Perl 6 provides is enough rope to shoot yourself in the foot several times over.
14:50 masak but that doesn't mean... right, that, that people should write unmaintainable code.
14:50 vendethiel masak: that might be a stupid idea, though. It seems like the operator power given by Perl6 isn't abused... yet
14:51 masak I hope that the Perl 6 code I produce can stand as an example for people that the power inherent in Perl 6 can be used in such a way as to *both* be useful and readable.
14:51 masak I'm not speaking for anybody else, but I have a feeling many others on #perl6 are guided by a similar sentiment.
14:51 vendethiel masak: I see it like editors. The more people are given power, the more they tend to use it for themselves
14:51 vendethiel Which is both normal and scary
14:51 masak readability (and all its associated attributes, such as maintainability and semantic clarity) feels like a central tenet in what I do when I produce code.
14:53 vendethiel masak: Right. I guess what I'm trying to say is "don't get too cozy"
14:54 masak if macros don't give you the power to do ridiculously inadvisable things to your program, I will consider my mission to have failed. :)
14:54 vendethiel hahaha.
14:54 masak but that's not the same as saying we shouldn't have sane defaults and guide people towards safety.
14:54 vendethiel Alright - I can agree with that
14:55 vendethiel I just think we should label it "be cautious" as with the ability to add new operators
14:55 vendethiel it's good to have it, but if you're pondering whether you should use it or not, don't.
14:55 masak that much I agree with.
14:55 vendethiel (that's the same thing I answer when people ask me if they should use eval "if you're wondering, then don't")
14:55 masak but that's not specific to macros in any sense.
14:55 vendethiel not even to macros, just to parsed macros.
14:56 gfldex joined #perl6
14:56 vendethiel Like, you can go crazy with your classes and be java-ey with pseudo-interfaces and 500 classes for a fizzbuzz, but I'll still be able to "read" your code. I'll know what a specific chunk does
14:56 masak in the choice between a lexical variable or a new class, all other things being equal, I will go with the lexical variable, because it's simpler.
14:56 vendethiel (btw, I'm very happy that we have tighter/looser rather than "99" like in haskell0
14:56 masak *nod*
14:57 masak I guess what you say comes down to the following: there will be some macros that have a very local, predictable effect on the code. and other macros won't. we prefer the former kind, for the benefit of the reader's sanity.
14:57 [TuxCM] gtodd, why does the $1 have to be quoted???
14:58 [TuxCM] m: my @x=("1ab");for @x { s{^(\d+)} = sprintf "%3d :", "$1"; }; @x.say
14:58 camelia rakudo-moar 3af250: OUTPUT«  0 :ab␤»
14:58 [TuxCM] m: my @x=("1ab");for @x { s{^(\d+)} = sprintf "%3d :", $1; }; @x.say
14:58 camelia rakudo-moar 3af250: OUTPUT«No such method 'item' for invocant of type 'NQPMu'␤  in method message at src/gen/m-CORE.setting:13332␤␤»
14:58 vendethiel masak: yeah. same as with hygiene, uh?
14:58 * masak submits rakudobug
14:58 [TuxCM] THAT is what I was wondering about
14:58 masak vendethiel: yes.
14:59 vendethiel masak: I hope you'll find time to read "50 years of lisp". It personally melted my brain :-)
15:00 masak vendethiel: bumping its priority as you've now mentioned it twice.
15:00 vendethiel wow, I almost feel smart now ;)
15:01 vendethiel (the whole book isn't available freely yet, though... But sublexical scope, anaphoric macros, pandoric macros and the others have gotten me wondering)
15:02 liztormato joined #perl6
15:02 masak m: for my @x = "1ab" { s{^(\d+)} = sprintf "%3d :", Nil }
15:02 camelia rakudo-moar 3af250: OUTPUT«No such method 'item' for invocant of type 'NQPMu'␤  in method message at src/gen/m-CORE.setting:13332␤␤»
15:03 liztormato TuxCM: $1 is a match object. The "" stringify
15:04 liztormato You could also $1.Str
15:05 masak m: $_ = "1ab"; s{^(\d+)} = sprintf "%3d :", "$1"; .say
15:05 masak m: $_ = "1ab"; s{^(\d+)} = sprintf "%3d :", $1; .say
15:05 camelia rakudo-moar 3af250: OUTPUT«use of uninitialized value of type Any in string context  in block <unit> at /tmp/Ct_Zoj4ABV:1␤␤  0 :ab␤»
15:05 camelia rakudo-moar 3af250: OUTPUT«No such method 'Int' for invocant of type 'Any'␤␤»
15:05 masak yes, that works locally.
15:05 masak m: $_ = "1ab"; s{^(\d+)} = sprintf "%3d :", $1.Str; .say
15:05 camelia rakudo-moar 3af250: OUTPUT«use of uninitialized value of type Any in string context  in block <unit> at /tmp/_m6KcgPksb:1␤␤  0 :ab␤»
15:05 masak hm, I'm not getting those uninit warnings locally in the REPL.
15:06 masak liztormato: but why in the world would I need to stringify in this case?
15:06 masak oh!
15:06 masak $1 !
15:06 masak m: $_ = "1ab"; s{^(\d+)} = sprintf "%3d :", $0; .say
15:06 camelia rakudo-moar 3af250: OUTPUT«  1 :ab␤»
15:06 masak :)
15:06 masak I think the real bug is that sprintf reacts badly to a Nil.
15:06 liztormato Yeah. It was for TuxCM
15:07 masak m: sprintf "%d", Nil
15:07 camelia rakudo-moar 3af250: OUTPUT«No such method 'item' for invocant of type 'NQPMu'␤  in method message at src/gen/m-CORE.setting:13332␤␤»
15:07 masak that's LTA.
15:07 * masak submits that
15:07 masak m: sprintf "%s", Nil
15:07 camelia rakudo-moar 3af250: OUTPUT«Too many directives: found 1, but no arguments after the format string␤␤»
15:07 masak oh...
15:07 masak right, so the problem isn't the Nil as such.
15:08 masak but rather that there's nothing to populate the %d with.
15:09 timotimo liztormato: wouldn't ~$1 do the same as $1.Str and "$1"?
15:09 vendethiel should.
15:09 liztormato Yes
15:12 masak he's *passing it to sprintf*
15:12 masak why does he need to cast it at all!?!?
15:13 masak also, the (p5-ism) problem that made that code not work is that it was $1, not $0 -- and he had only one numbered capture group.
15:13 vendethiel .oO( let's forbid $1! )
15:14 denis_boyun joined #perl6
15:15 bartolin joined #perl6
15:17 masak m: sprintf "%d"
15:17 camelia rakudo-moar 3af250: OUTPUT«No such method 'item' for invocant of type 'NQPMu'␤  in method message at src/gen/m-CORE.setting:13332␤␤»
15:17 masak should give the same error as
15:17 masak m: sprintf "%s"
15:17 camelia rakudo-moar 3af250: OUTPUT«Too many directives: found 1, but no arguments after the format string␤␤»
15:17 bartolin rurban: I'm usev6 on github. I was afk for a while.
15:20 fhelmberger joined #perl6
15:31 liztormato Continuing cycling&
15:31 liztormato left #perl6
15:33 MikeFair joined #perl6
15:36 Ven_ joined #perl6
15:37 * masak .oO( are the bikes really tiny? the agile methodology favors small cycles! )
15:38 timotimo m)
15:39 MilkmanDan joined #perl6
15:41 masak vendethiel: just thought of an example. inheritance between classes. has been used in many cases to great effect -- in some domains more clearly a benefit than in others.
15:41 masak vendethiel: and yet, every time inheritance is used, a little bit of negative readability is introduced, simply by the complete understanding of the system now being spread across more than one class.
15:42 masak this is "essential negative readability", in the sense that the physical disconnect between base class and deriving class is also what makes inheritance useful in the first place.
15:43 esaym153 joined #perl6
15:43 * TimToady now in Maria Alm, Austria
15:43 masak the disconnect can be mitigated by IDE tools, such as "jump to definition".
15:43 TimToady s/in/exhausted in/
15:44 masak TimToady: welcome to Europe!
15:46 nine TimToady: that's where my father grew up :)
15:48 rurban Oh, Maria Alm is beautiful!
15:53 mst masak: paul graham's On Lisp is excellent as well
15:56 masak mst: and free. so I might start with that one, while the other is being delivered. :)
15:56 kjs_ joined #perl6
15:58 mst masak: hence mentioning it :)
15:58 mst it's also well worth reading about fexprs and operative functions at some point
15:58 mst though those are more interesting in terms of semantic-ish macros rather than syntactic-ish ones
16:04 guru joined #perl6
16:04 rurban bartolin: can you please recheck rakudo with latest parrot master on a bsd with a non-utf8 locale
16:05 bartolin rurban: yes, will do that
16:10 rurban worked ok for me, but I have no bsd's right now
16:11 Hor|zon joined #perl6
16:12 [TuxCM] Ouch: if $foo ~~ s{^ "x"} = "" {
16:13 [TuxCM] does not enter the block, as the replacement is false. I expected it to enter the block because the substituation succeeded
16:15 bartolin I'm testing on NetBSD right now. tomorrow I could conveniently test on my daily build on FreeBSD. would that suffice?
16:16 rurban sure.
16:23 virtualsue joined #perl6
16:24 pmurias masak: from the discussion I'm feeling we are misunderstanding each other ;) What I feel would be usefull if people helped create is something like: https://gist.github.com/pmurias/46e8a79a1e1d47822dda
16:27 mst pmurias: second one: Test::Simpler by Damian (of course)
16:27 mst pmurias: third one: not a macro, but Log::Contextual
16:28 mst (more p5 prior art for idea theft purposes)
16:30 mst (also beware 'optimised out', often you just want to make it really really fast but be able to turn it back on by poking your daemon or something)
16:32 masak pmurias: your biological and technological distinctiveness has been added to my own. thank you. :)
16:33 masak and no, I don't think we are misunderstanding each other.
16:34 masak I just prefer to "own" some data at this part of the process, is all.
16:43 bartolin rurban: I build latest rakudo with latest parrot master and the two non-ASCII tests from S19-command-line/dash-e.t fail with non-utf8 locale. otherwise both tests run fine now. (that matches behaviour on linux)
16:44 Mouq joined #perl6
16:44 pmurias mst: the third one was taken from a masak++ talk, but I'm not sure if that use case is actually beneficial
16:48 mst pmurias: Log::Contextual being able to only call expensive stuff when that log level is on has been a huge advantage
16:48 SamuraiJack_ joined #perl6
16:48 mst I use it freaking everywhere
16:50 vendethiel pmurias: for me, those are the "macros generating code" kind of use case
16:50 spider-mario joined #perl6
16:52 vendethiel pmurias: I still have other use-cases in mind, i.e. I want to build a "match" statement with macros
16:53 vendethiel pmurias: I also want a RAII-like `given` version. `given open('file') { .say("foo") } # here the file is closed`
16:53 ssutch joined #perl6
16:54 vendethiel (I have thousands of stuff like that I want to do, like generating coumpound operators or other stuff, but a lot of them do not involve code generationg)
17:01 _slade_ joined #perl6
17:12 MikeFair joined #perl6
17:20 Mso150 joined #perl6
17:27 Ven_ joined #perl6
17:46 gfldex joined #perl6
17:57 erdic joined #perl6
18:04 Ven_ joined #perl6
18:12 Hor|zon joined #perl6
18:17 kjs_ joined #perl6
18:17 Guest77467 joined #perl6
18:36 * lizmat is done cycling
18:37 ribasushi joined #perl6
18:37 masak vendethiel: another loose thought about the "too much power" stuff:
18:37 _slade_ joined #perl6
18:38 masak maybe, just like we tend to favor side-effect-free routines when we can but realize that's not always possible or even desirable, so we'll end up preferring macros with a simple/predictable local mapping from inputs to outputs without messing with the environment
18:39 mst r5rs does this
18:39 mst in that there are two forms for macro declaration, one fully hygeinic, one less so
18:39 masak ...but we also acknowledge that sometimes messing with the environment (as little as we can get away with) is precisely the intent
18:42 * masak .oO( these are your father's parentheses. elegant weapons -- for a more... civilized age. careful! some of them are very sharp )
18:45 masak example of a macro with a side effect: if you use it more than three times in the same compunit, it replaces the entire mainline with an infinite loop that prints "PHP 4EVER!!!" and traps ^C
18:46 ssutch joined #perl6
18:49 masak mst: though looking at Log::Contextual, it seems that it avoids superfluous work through lambdas, not through macro/sourcefilter magic.
18:49 masak but yes, it's still a good example of when the desired semantics is needed, I guess.
18:50 mst masak: yes, I specifically said "not a macro, but Log::Contextual" for that reason :D
18:53 beastd joined #perl6
18:54 masak ah, yes. missed that line.
18:55 kaare__ joined #perl6
18:56 masak "thunk it", i.e. "make it a lambda without it needing braces" is one of the acheived goals in Rakudo macros already.
18:57 lizmat m: say IO::Spec::Win32.split("C:a/b/c/d")  # b2gills: it already does so
18:57 camelia rakudo-moar 3af250: OUTPUT«"volume" => "C:" "dirname" => "a/b/c" "basename" => "d" "directory" => "a/b/c"␤»
18:58 b2gills m: say IO::Spec::Win32.basename("C:a/b/c/d")
18:58 camelia rakudo-moar 3af250: OUTPUT«C:a/b/c/d␤»
18:58 [TuxCM] lizmat, even if d is a directory?
18:58 lizmat b2gills: ah, good point
18:58 [TuxCM] i'd expect it to have filename => d
19:02 lizmat [TuxCM]: IO::Spec does not inspect the file system, it is like P5's File::Spec
19:06 dalek rakudo/nom: 9c807f2 | (Elizabeth Mattijsen)++ | src/core/IO/Spec/Win32.pm:
19:06 dalek rakudo/nom: Fix IO::Spec::Win32.basename
19:06 dalek rakudo/nom:
19:06 dalek rakudo/nom: b2gills++ pointed out that slashes were ok too, since MS-DOS 2
19:06 dalek rakudo/nom: review: https://github.com/rakudo/rakudo/commit/9c807f201b
19:06 lizmat $ 6 'say IO::Spec::Win32.basename("C:a/b/c/d")'
19:06 lizmat d
19:06 Mso150 joined #perl6
19:06 robinsmidsrod joined #perl6
19:06 lizmat m: say IO::Spec::Win32.basename("C:a\\b\\c\\d")
19:06 camelia rakudo-moar 3af250: OUTPUT«d␤»
19:16 Alula joined #perl6
19:20 fhelmberger joined #perl6
19:29 psch joined #perl6
19:29 psch hi #perl6 o/
19:30 masak \o
19:30 psch do we want multiple --target's?
19:30 psch RT #73790 made me also add "a multiple $flag are not allowed"
19:30 synopsebot Link: https://rt.perl.org/rt3//Public/Bug/Display.html?id=73790
19:30 psch masak o/
19:31 psch currently that's disallowing target, optimize, encoding, output
19:31 psch i'm unsure if target belongs on that list
19:33 jnthn No, any latter targets are ignored at present, I guess
19:33 jnthn I mean, it just says "stop at this stage"
19:33 jnthn So only makes sense to have it once.
19:35 psch jnthn: right, so disallowing is What It Means.  i'll push and PR in a bit then
19:38 psch although there's one other thing i'm unsure about.  the code i have checks for multiple flags in HLL::Compiler::command_line.  HLL::CommandLine::Parser makes arrays when an option was encountered more than once, and &command_line acts on them.
19:39 psch i'm not sure if the parser should know that it should treat -e specifically different, although i'm leaning towards "no, because others might want something else allowed"
19:39 vendethiel http://codon.com/refactoring-ruby-with-monads <- actually good monad tutorial
19:40 vendethiel masak: wow, I saw your initial message instantly, but then you stopped pinging me
19:40 vendethiel there's a huge trend in the CL community saying "unhygienic macros are okay cause we a lisp-2", which i strongly disagree with
19:41 vendethiel (and that applies to p6's $@&%)
19:42 psch oh duh, my argument for the placement of the check is actually not valid.  it's still hard-coded in HLL...
19:45 Psyche^_ joined #perl6
19:46 masak vendethiel: I don't know the details, but that sounds like something I'd disagree with as well. maybe even strongly.
19:47 vendethiel masak: it's just that "we're only introducing values/functions"
19:47 vendethiel but sometimes, the lisp-2 magic breaks down :) (ie exports/imports)
19:47 masak *nod*
19:54 masak 'night, #perl6
19:55 lizmat gnight masak
19:55 psch g'nite masak
19:59 rindolf joined #perl6
20:00 vendethiel g'night :)
20:01 PZt joined #perl6
20:13 rmgk_ joined #perl6
20:13 Hor|zon joined #perl6
20:16 FROGGS $ perl6-p
20:16 FROGGS > 42
20:16 FROGGS Null PMC access in get_string()
20:16 FROGGS looks like I'm not yet done with it :/
20:17 odc joined #perl6
20:18 lizmat FROGGS++ for persevering
20:38 lichtkind joined #perl6
20:55 lizmat m: sub a { say CALLER::<$*CWD> }; say $*CWD; a  # should this work or not ?
20:55 camelia rakudo-moar 9c807f: OUTPUT«"/home/p6eval".IO␤(Any)␤»
20:56 lizmat I would have expected the Any to be an .IO as well
20:56 jnthn m: sub a { say DYNAMIC::<$*CWD> }; say $*CWD; a
20:56 camelia rakudo-moar 9c807f: OUTPUT«"/home/p6eval".IO␤(Any)␤»
20:56 jnthn Oh...
20:57 jnthn But there's no lexical $*CWD, iirc
20:57 jnthn It comes from PROCESS
20:57 lizmat uyp
20:57 lizmat yup rather
20:57 jnthn So yeah, those pseudo-package "look in a scope" thingies ain't going to find it, I guess.
20:57 Guest77502 joined #perl6
20:57 lizmat but PseudoStash is doing a nqp::getlexreldyn afaics
20:57 Guest77502 left #perl6
20:58 jnthn Sure
20:58 jnthn Which matches what we're seeing
20:58 jnthn The GLOBAL and PROCESS fallback things are Perl 6 level
20:58 lizmat m: sub a { say CALLER::<$*CWD> // PROCESS::<$*CWD> }; say $*CWD; a  # should this work or not ?
20:58 jnthn See sub DYNAMIC
20:58 camelia rakudo-moar 9c807f: OUTPUT«"/home/p6eval".IO␤(Any)␤»
20:59 lizmat m: sub a { say CALLER::<$*CWD> // PROCESS::<$CWD> }; say $*CWD; a  # should this work or not ?
20:59 camelia rakudo-moar 9c807f: OUTPUT«"/home/p6eval".IO␤"/home/p6eval".IO␤»
20:59 jnthn The * is removed before looking in GLOBAL or PROCESS.
20:59 lizmat yeah...
21:00 jnthn I guess it's arguable that a pseudo-package lookup involving a * twigil should also look at GLOBAL and PROCESS
21:00 jnthn Well, for CALLER and DYNAMIC, anyway...
21:01 jnthn Something makes me hesitate a little on it, though...
21:01 jnthn Not sure what.
21:01 jnthn :)
21:02 jnthn Maybe just that dealing with packages or pseudo-packages is generally non-mangly...
21:02 lizmat yeah...
21:02 [Sno] joined #perl6
21:11 zakharyas joined #perl6
21:17 BenGoldberg joined #perl6
21:20 _slade_ joined #perl6
21:24 labster joined #perl6
21:44 lizmat jnthn: I think we have a chicken / egg problem with visitdir (from the old S32/IO) and chdir (from the new S32/IO)
21:44 lizmat chdir(/abspath) is no problem
21:45 lizmat chdir( /abspath, my $*CWD ) is not a problem either
21:45 lizmat chdir( relpath, my $*CWD ) *is* a problem
21:45 lizmat as it needs the *old* value of $CWD to work from
21:46 lizmat by the "my $*CWD" is already set to Any by that time
21:48 kurahaupo joined #perl6
21:49 jnthn lizmat: Well, can you do something with CALLER::CALLER, and fall back to looking in PROCESS?
21:49 jnthn Oh but...
21:49 lizmat m: say $*CWD; { my $*CWD = $*CWD; say $*CWD }; say $*CWD   # the problem in a nutshell
21:49 camelia rakudo-moar 9c807f: OUTPUT«"/home/p6eval".IO␤(Any)␤"/home/p6eval".IO␤»
21:49 jnthn Hm, why are we passing $*CWD?
21:50 lizmat jnthn: to indicate which dynamic to set
21:50 jnthn That's a...weird API design...
21:50 lizmat it combines chdir() with the specced visitidir
21:51 lizmat however, the same problem would exist with:
21:51 jnthn Wasn't visitdir the one that takes a closure to run under a different $*CWD?
21:51 lizmat my $*CWD = chdir("foo")
21:51 lizmat multi sub visitdir(Str:D)
21:51 lizmat multi sub visitdir(IO::Path:D)
21:52 lizmat was the old spec
21:52 jnthn oh...
21:52 lizmat slushy, I know
21:53 * jnthn ponders if temp $*CWD works out any better...
21:53 lizmat nope, same problem
21:53 lizmat well, what I tried with temp
21:53 jnthn It does strike me was rather odd that we are calling chdir *and* updating $*CWD ourselves...
21:54 lizmat chdir is really nothing *but* updating $*CWD in the new scheme of things
21:54 lizmat which is basically the way the JVM does it
21:54 jnthn Me naive expcetation would be that chdir updates $*CWD
21:54 lizmat yes, it does
21:54 jnthn And since it's contextual then we've no need to pass it
21:54 lizmat but what if you want to update it just in a scope ?
21:55 lizmat { my $*SPEC = chdir() }
21:55 jnthn And then we have a visitdir 'foo', { ... };
21:55 lizmat that's not how visitdir was specced
21:55 jnthn Which calls the closure with an updated $*CWD
21:55 jnthn I know, I'm wondering if it should be that way...
21:56 jnthn I know Panda has an "indir" or similar for doing exactly this
21:56 lizmat yup, it has...
21:56 jnthn I suspect everyone is going to re-invent that...
21:56 lizmat how about:
21:57 lizmat chdir(foo) just changes $*CWD
21:57 lizmat chdir(foo, { code })
21:57 lizmat only changes it inside the code block and executes it ?
21:57 jnthn I like the idea of providing both of them, I'm just not sure the second one should be called chdir
22:02 BenGoldberg letdir, tempdir, temporarily-dir, maybe?
22:02 dwarring joined #perl6
22:03 jnthn Panda's indir ain't so bad...
22:11 Ven_ joined #perl6
22:14 Hor|zon joined #perl6
22:18 lizmat m: my $*FOO = 42; { my $*FOO = $*FOO.Str; say $*FOO }   # expected "42"
22:18 camelia rakudo-moar 9c807f: OUTPUT«use of uninitialized value $*FOO of type Any in string context  in block <unit> at /tmp/LGhEbNXreI:1␤␤␤»
22:19 lizmat ah, I guess it needs to be temp
22:19 lizmat m: my $*FOO = 42; { temp $*FOO = $*FOO.Str; say $*FOO }   # expected "42"
22:19 camelia rakudo-moar 9c807f: OUTPUT«42␤»
22:19 lizmat m: my $*FOO = 42; { temp $*FOO = $*FOO + 1; say $*FOO }
22:19 camelia rakudo-moar 9c807f: OUTPUT«43␤»
22:19 lizmat m: my $*FOO = 42; { temp $*FOO = $*FOO + 1; say $*FOO } ; say $*FOO
22:19 camelia rakudo-moar 9c807f: OUTPUT«43␤42␤»
22:31 jepeway joined #perl6
22:32 jepeway_ joined #perl6
22:36 dalek rakudo-star-daily: ffef5fb | coke++ | log/MoarVM-version.log:
22:36 dalek rakudo-star-daily: today (automated commit)
22:36 dalek rakudo-star-daily: review: https://github.com/coke/rakudo-star-daily/commit/ffef5fbd59
22:36 dalek perl6-roast-data: a73c09e | coke++ | / (4 files):
22:36 dalek perl6-roast-data: today (automated commit)
22:36 dalek perl6-roast-data: review: https://github.com/coke/perl6-roast-data/commit/a73c09e7f6
22:38 lizmat jnthn: it appears that temp doesn't work in the core...
22:38 lizmat going to sleep on it
22:38 lizmat good night, #perl6!
22:38 jnthn 'night
22:42 timotimo gnite liz
22:48 [Sno]_ joined #perl6
23:09 sorear joined #perl6
23:10 Alina-malina joined #perl6
23:17 j4jackj joined #perl6
23:19 [Coke] f
23:19 [Coke] ~>
23:19 _slade_ joined #perl6
23:21 fhelmberger joined #perl6
23:33 slavik joined #perl6

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

Perl 6 | Reference Documentation | Rakudo