Perl 6 - the future is here, just unevenly distributed

IRC log for #perl6, 2015-08-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:17 dalek rakudo/nom: a190b23 | (Geoffrey Broadwell)++ | src/core/Proc.pm:
00:17 dalek rakudo/nom: Fix QX('/bin/false'), previously a spawn failure
00:17 dalek rakudo/nom: review: https://github.com/rakudo/rakudo/commit/a190b23bf9
00:19 Sgeo Is there an easy way to make an array of one element out of an array?
00:19 Sgeo e.g. what I assume @a[0] did in Perl5 (I don't actually know Perl5)
00:20 japhb m: my @a = ^5; say @a[0,];
00:20 camelia rakudo-moar 0dcbba: OUTPUT«0␤»
00:21 japhb m: my @a = ^5; say @a[0,].perl;
00:21 camelia rakudo-moar 0dcbba: OUTPUT«(0,)␤»
00:21 japhb Sgeo: ^^
00:21 Sgeo ty
00:21 japhb np
00:23 Sgeo Wonder if I should try implementing smartmatch in Haskell
00:24 Sgeo It would have the advantage (due to static typing) that unless you use existentials, you're not going to put something silly like input whose type is user-determined on the RHS
00:26 geekosaur but since smartmatch is type-driven, you may need an existential to *implement* it
00:27 Sgeo MPTC (and maybe type families if I want to replicate the regex thing of returning something other than a Bool sometimes) should be sufficient I think
00:53 AlexDaniel “Fix getting ugly low-level backtrace when sinking last statement in a program”
00:53 AlexDaniel hmmm, that's one of my reports that should be marked as done
00:55 AlexDaniel https://rt.perl.org/Public/Bug/Display.html?id=125680
00:55 AlexDaniel this one
00:56 AlexDaniel unless the “running code from file and with -e is different” is not fixed yet
00:56 AlexDaniel if it has to be fixed, of course
00:58 lucasb joined #perl6
00:58 AlexDaniel m: ...
00:58 camelia rakudo-moar a190b2: ( no output )
00:59 AlexDaniel looks correct
00:59 AlexDaniel m: …
00:59 camelia rakudo-moar a190b2: ( no output )
00:59 AlexDaniel nice
01:00 lucasb It feels wrong to me
01:00 AlexDaniel lucasb: why?
01:01 AlexDaniel m: !!!
01:01 camelia rakudo-moar a190b2: OUTPUT«Stub code executed␤  in block <unit> at /tmp/W6eKHDoQJY:1␤␤»
01:01 AlexDaniel m: ???
01:01 camelia rakudo-moar a190b2: OUTPUT«Stub code executed  in block <unit> at /tmp/EtcdaLGf9U:1␤»
01:01 lucasb It should not be silent
01:01 lucasb I think this is related to the latest Failure changes
01:01 lucasb m: fail; say 'hi'
01:01 camelia rakudo-moar a190b2: ( no output )
01:02 AlexDaniel well, jnthn wrote that thing in his blog
01:02 AlexDaniel and it was exactly the issue with …
01:03 AlexDaniel whether it is the Failure changes you are talking – I have no idea
01:05 lucasb if I understood the ticket correctly, you just didn't want to see the huge backtrace
01:06 lucasb but something must be printed, otherwise the user won't know the program failed
01:06 AlexDaniel I'm not sure. Maybe
01:06 AlexDaniel you could use !!! as well
01:07 [Coke] m: exit ...
01:07 camelia rakudo-moar a190b2: ( no output )
01:08 [Coke] m: +...
01:08 camelia rakudo-moar a190b2: OUTPUT«WARNINGS:␤Useless use of "+" in expression "+..." in sink context (line 1)␤»
01:09 lucasb perl6 -e fail  #=> Failed
01:09 lucasb echo fail | perl6 - && echo ok  #=> ok
01:09 lucasb ^^ I think this is a tiny inconsistency :)
01:10 AlexDaniel lucasb: which is also mentioned in my ticket
01:10 AlexDaniel unfortunately I've brought two issues in one ticket, my bad
01:22 ugexe zef will now run Build.pm files as if they were a hooks/build-*.pl6 hook. unfortunately the `isa.(Panda::Builder)` requirement in panda has led to doing `use Panda::Builder; class Build is Panda::Builder { }` even though it looks like most Build.pm files have no need for anything provided by any of the panda classes.
01:22 ugexe so you have to have panda installed still. the alternative route would be to write my own Panda:: classes to emulate (which seems silly). If the Build.pm stays, perhaps builder should instead be checking .^can('build'), not .isa(External::Dependency)
01:24 rmgk joined #perl6
01:40 jkva joined #perl6
01:45 Sgeo m: say *.WHAT
01:45 camelia rakudo-moar a190b2: OUTPUT«(Whatever)␤»
01:47 ilbot3 joined #perl6
01:47 Topic for #perl6 is now »ö« Welcome to Perl 6! | http://perl6.org/ | evalbot usage: 'p6: say 3;' or rakudo:, std:, or /msg camelia p6: ... | irclog: http://irc.perl6.org | UTF-8 is our friend!
01:48 Sgeo m: say (1,2,3)<<.succ
01:48 camelia rakudo-moar a190b2: OUTPUT«5===SORRY!5=== Error while compiling /tmp/dLHFlWYID0␤Unable to parse quote-words subscript; couldn't find right double-angle quote␤at /tmp/dLHFlWYID0:1␤------> 3say (1,2,3)<<.succ7⏏5<EOL>␤    expecting any of:␤        postfix␤        …»
01:49 Sgeo m: say (1,2,3)>>.succ
01:49 camelia rakudo-moar a190b2: OUTPUT«2 3 4␤»
01:49 Sgeo Is there a similar operator for non-methods?
01:51 japhb m: sub foo($a) { say "$a!" }; (1,2,3)>>.&foo
01:51 camelia rakudo-moar a190b2: OUTPUT«3!␤1!␤2!␤»
01:52 japhb Sgeo: ^^
01:52 Sgeo ty
01:52 japhb np
01:52 japhb :-)
02:09 colomon how does that work?
02:13 dayangkun joined #perl6
02:14 davido___ joined #perl6
02:14 colomon I don’t see any trace of .& in S03?
02:22 japhb colomon: It's not a special operator, it's saying I want to use the &foo Callable instead of a method looked up by name.
02:22 japhb And since invocant is just first argument ... it works.
02:23 Sgeo Seems like that... D thing where a method call is just a kind of function call?
02:23 Sgeo http://ddili.org/ders/d.en/ufcs.html
02:23 Sgeo Not... quite, since you need to indicate to it, but surely it at least reduces temptation to monkey patch?
02:24 japhb We simultaneously dissuade monkey patching, and provide really powerful ways to monkey patch.  :-)
02:25 japhb .tell jnthn For the first time, I can run one of my highly-parallel programs reliably under r-m if I only turn it up part way.  Still can't handle it when I turn it all the way up, though.
02:25 yoleaux japhb: I'll pass your message to jnthn.
02:25 colomon japhb: huh.  I get the invocant thing, but I’m still kind of surprised .&foo works.
02:25 japhb .tell jnthn (That was meant as a "Yay!  Happy Day!" moment, BTW.  :-)  )
02:25 yoleaux japhb: I'll pass your message to jnthn.
02:26 japhb bus stop # &
02:26 ugexe use MONKEY-TYPING; augment MONKEY-TYPING { use MONKEY-TYPING; }
02:28 Sgeo What's the difference between : and , for indicating the invocant, what does that actually give you?
02:28 Sgeo And when?
02:37 colomon japhb: hmm… my mandelbrot  script which tries to create 51 threads is still completely unreliable.
02:41 kaare_ joined #perl6
02:43 noganex_ joined #perl6
02:48 Sgeo :m say Mu.WHAT.WHAT.WHAT.WHAT;
02:48 Sgeo m: say Mu.WHAT.WHAT.WHAT.WHAT;
02:48 camelia rakudo-moar a190b2: OUTPUT«(Mu)␤»
02:49 Sgeo m: say 5.WHAT.WHAT.WHAT.WHAT;
02:49 camelia rakudo-moar a190b2: OUTPUT«(Int)␤»
02:54 colomon japhb: … actually, it’s unreliable even with just 3 threads
02:58 ShimmerFairy colomon: surprised me too, but it was nice when uniname didn't exist as a method, so for a while "*".&uniname was how you had to do it.
02:58 colomon m: say "*".&uniname
02:58 camelia rakudo-moar a190b2: OUTPUT«ASTERISK␤»
02:58 colomon m: say "*".uniname
02:58 camelia rakudo-moar a190b2: OUTPUT«ASTERISK␤»
03:03 Sgeo WHEN will .WHEN be defined?
03:04 Mhoram joined #perl6
03:05 Sgeo m: say 1.HOW; say Int.HOW;
03:05 camelia rakudo-moar a190b2: OUTPUT«Perl6::Metamodel::ClassHOW.new␤Perl6::Metamodel::ClassHOW.new␤»
03:05 Sgeo m: say 1.HOW === say Int.HOW;
03:05 camelia rakudo-moar a190b2: OUTPUT«Perl6::Metamodel::ClassHOW.new␤False␤»
03:05 Sgeo oops
03:08 colomon m: say <4 -2 3>.map(*.?abs)
03:08 camelia rakudo-moar a190b2: OUTPUT«4 2 3␤»
03:08 colomon m: say <4 -2 3>.map(&abs)
03:08 camelia rakudo-moar a190b2: OUTPUT«4 2 3␤»
03:08 colomon m: say <4 -2 3>.map(*.&abs)
03:08 camelia rakudo-moar a190b2: OUTPUT«4 2 3␤»
03:08 colomon m: say <4 -2 3>.map(abs)
03:08 camelia rakudo-moar a190b2: OUTPUT«5===SORRY!5=== Error while compiling /tmp/dJUAqZCKML␤Unsupported use of bare "abs"; in Perl 6 please use .abs if you meant $_, or use an explicit invocant or argument␤at /tmp/dJUAqZCKML:1␤------> 3say <4 -2 3>.map(abs7⏏5)␤»
03:16 laouji joined #perl6
03:25 abaugher joined #perl6
03:30 FatalNIX joined #perl6
03:42 jkva joined #perl6
03:49 japhb colomon: URL for your mandelbrot script?
04:20 dustinm` joined #perl6
04:27 laouji joined #perl6
04:30 davido__ joined #perl6
05:00 skids .tell AlexDaniel The message for "..." still has to be fixed; it is a separate issue ("..." implicity tries to "return" from the mainline code, not just sink a Failure)  What was fixed was there is no longer a different backtrace when a Failure is sunk in the last statement.
05:00 yoleaux skids: I'll pass your message to AlexDaniel.
05:14 ChoHag joined #perl6
05:22 fungle joined #perl6
05:26 fungle left #perl6
05:28 jkva joined #perl6
05:40 mr-foobar joined #perl6
05:57 brrt joined #perl6
06:05 leedo joined #perl6
06:06 diana_olhovik_ joined #perl6
06:07 dalek Inline-Perl5: 5dbc3cb | ugexe++ | META.info:
06:07 dalek Inline-Perl5: Build.pm depends on `panda`
06:07 dalek Inline-Perl5:
06:07 dalek Inline-Perl5: Unfortunately modules that use `Build.pm` also have a requirement on `panda`
06:07 dalek Inline-Perl5: review: https://github.com/niner/Inline-Perl5/commit/5dbc3cbaed
06:07 dalek Inline-Perl5: e90710d | niner++ | META.info:
06:07 dalek Inline-Perl5: Merge pull request #37 from ugexe/patch-1
06:07 dalek Inline-Perl5:
06:07 dalek Inline-Perl5: Build.pm depends on `panda`
06:07 dalek Inline-Perl5: review: https://github.com/niner/Inline-Perl5/commit/e90710da0e
06:08 [Sno] joined #perl6
06:21 FROGGS joined #perl6
06:40 llfourn joined #perl6
06:42 telex joined #perl6
06:49 yeahnoob joined #perl6
07:13 darutoko joined #perl6
07:23 rurban joined #perl6
07:28 rurban_ joined #perl6
07:37 pnu joined #perl6
07:40 brrt when was 'our' syntax introduced? which perl5's have it?
07:41 rindolf joined #perl6
07:47 DrForr Back to at least 5.8.9, probably 5.005.
07:47 brrt hmm, ok
07:47 brrt afk
07:54 zakharyas joined #perl6
08:03 TEttinger joined #perl6
08:03 breinbaas can someone kick bruncol (junk pm)
08:04 breinbaas oops, wrong channel - sorry
08:26 jdv79 re-implementing stuff is kind of a PITA
08:26 jdv79 thank god I::P5 exists
08:27 jdv79 rather, thank nine i guess
08:27 DrForr There's also Perl::ToPerl6 :)
08:28 jdv79 well, that's kinda pointless if you're trying to be idiomatic and 6ish
08:29 jdv79 i imagine its valuable in certain cases.  i just can't think of any.
08:31 jdv79 DrForr: what is hard to do?
08:32 DrForr It's not *hard* to convert per se, it's just time better spent fixing up code and changing things to be more idiomatic.
08:34 jnthn I'd imagine getting test suites translated can be pretty useful
08:34 yoleaux 02:25Z <japhb> jnthn: For the first time, I can run one of my highly-parallel programs reliably under r-m if I only turn it up part way.  Still can't handle it when I turn it all the way up, though.
08:34 yoleaux 02:25Z <japhb> jnthn: (That was meant as a "Yay!  Happy Day!" moment, BTW.  :-)  )
08:34 jnthn .tell japhb What're the failure modes you're seeing of turning it up to 11?
08:34 yoleaux jnthn: I'll pass your message to japhb.
08:39 jdv79 that assumes the tests are applicable but, yeah, that's a good one.
08:40 laouji joined #perl6
08:41 jdv79 btw the <!Foo::token> is working now
08:41 timotimo thank god for nine!
08:42 jdv79 i was getting something about a bad big int op with <-Foo::token> and something about couldn't find '>' with the <! form - idk
08:42 jdv79 coding while not fully awake--
08:44 baest joined #perl6
08:49 mr-foobar joined #perl6
08:50 RabidGravy joined #perl6
08:53 espadrine joined #perl6
09:04 RabidGravy marning
09:13 llfourn joined #perl6
09:16 pecastro joined #perl6
09:25 jdv79 what's a good way to get the hex values of encoded utf?
09:25 jdv79 utf8 i mean
09:26 ShimmerFairy m: say "string".encode("utf8")
09:26 camelia rakudo-moar a190b2: OUTPUT«utf8:0x<73 74 72 69 6e 67>␤»
09:26 jdv79 but that obj isn't positional
09:26 jdv79 not sure how to get at the individual bits well
09:26 timotimo m: say "string".encode("utf8").Buf.perl.say
09:26 camelia rakudo-moar a190b2: OUTPUT«Method 'Buf' not found for invocant of class 'utf8'␤  in block <unit> at /tmp/POm4yXklEg:1␤␤»
09:27 timotimo m: say "string".encode("utf8").list.perl.say
09:27 camelia rakudo-moar a190b2: OUTPUT«[115, 116, 114, 105, 110, 103]<>␤True␤»
09:27 ShimmerFairy m: say "string".encode("utf8")[1]
09:27 camelia rakudo-moar a190b2: OUTPUT«116␤»
09:27 jdv79 what is a utf8 obj - the docs are sparse
09:27 timotimo m: say "string".encode("utf8").list.fmt("%x").perl,say
09:27 camelia rakudo-moar a190b2: OUTPUT«5===SORRY!5===␤Argument to "say" seems to be malformed␤at /tmp/4OMXEtzz71:1␤------> 3".encode("utf8").list.fmt("%x").perl,say7⏏5<EOL>␤Other potential difficulties:␤    Unsupported use of bare "say"; in Perl 6 please use .say if you mean…»
09:27 timotimo m: say "string".encode("utf8").list.fmt("%x").perl.say
09:27 camelia rakudo-moar a190b2: OUTPUT«"73 74 72 69 6e 67"␤True␤»
09:27 timotimo oops, a say too many
09:28 timotimo m: say "string".encode("utf8").list.>>fmt("%x").perl
09:28 camelia rakudo-moar a190b2: OUTPUT«5===SORRY!5=== Error while compiling /tmp/u6oGm7CwYd␤Missing dot on method call␤at /tmp/u6oGm7CwYd:1␤------> 3say "string".encode("utf8").list.>>7⏏5fmt("%x").perl␤    expecting any of:␤        method arguments␤        postfix␤»
09:28 timotimo m: say "string".encode("utf8").list>>.fmt("%x").perl
09:28 camelia rakudo-moar a190b2: OUTPUT«("73", "74", "72", "69", "6e", "67")␤»
09:28 timotimo typing isn't my forte right now
09:28 jdv79 NO!  list?  i tried map/for/join/etc:(
09:28 jdv79 geez
09:28 ShimmerFairy It's positional enough, though I personally would say Buf types not doing Positional is a bug :)
09:28 jdv79 thanks
09:28 araujo joined #perl6
09:28 timotimo ShimmerFairy++ # here to keep us honest
09:28 brrt joined #perl6
09:29 ShimmerFairy timotimo: just part of my opinion that Bufs for the last time are not strings and should in no way be designed as such :P
09:29 timotimo :)
09:29 timotimo i also think utf8 ought to support things like map/for/join/etc directly
09:30 ShimmerFairy unless you see a reason for just utf8, there's a reason I've been generalizing to Buf so far :)
09:30 timotimo no reason for that
09:31 timotimo i think we also should have things like split for Buf and friends
09:31 timotimo how do you feel about that?
09:32 ShimmerFairy timotimo: honestly, I'd rather see Buf being interpreted as a sort of "binary-data-based Positional type" rather than the "encoded Stringy type" it currently is :)
09:32 ShimmerFairy timotimo: not sure about split, lemme think for a moment
09:32 timotimo split into sub-bufs; seems useful to me
09:34 ShimmerFairy timotimo: on the one hand I don't see a problem with .split on Bufs, but then I wonder why other Positional types shouldn't have it too :P
09:34 ShimmerFairy I will admit that Bufs are in a weird middle between Stringy things and Positional things. I just think it's far too weighted towards the Stringy side as it stands (though IIRC it was worse in the past).
09:37 timotimo mhm
09:37 jdv79 the use case here is to %-encode utf8
09:37 itz morning
09:38 timotimo ShimmerFairy: oh, imagine a subbuf-rw-powered split
09:39 jnthn The utf8 type is a Blob rather than a Buf
09:40 jnthn Meaning it's immutable
09:40 jnthn So you can't make it invalid utf8
09:40 jnthn m: say "string".encode("utf8")[0]
09:40 camelia rakudo-moar a190b2: OUTPUT«115␤»
09:40 jnthn You can index it
09:40 timotimo ah, of course
09:40 ShimmerFairy That does sound potentially useful, despite the fact that I don't like -rw methods :P (It's not that I think they're wrong, just something about the look of .substr-rw(...) feels wrong, like we shouldn't need the -rw part. I don't know, just me)
09:40 jnthn So I suspect it not doing Positional may be an oversight
09:44 timotimo if we don't have the -rw parts, we'll have .copy instead on the ones that didn't have -rw so far :)
09:45 smls joined #perl6
09:45 |Tux| test             50000    42.725    42.636
09:45 |Tux| test-t           50000    41.682    41.593
09:45 |Tux| :)
09:45 FROGGS |Tux|: we are moving in the right direction again?
09:45 |Tux| yep
09:45 FROGGS awesome
09:45 |Tux| under 42
09:46 * |Tux| pokes lizmat to look at the HLL ticket
09:46 FROGGS isnt 42.000 what we should aim for?
09:46 ShimmerFairy timotimo: sure, I'm not doubting that they're there for a good reason, but for some weird reason it almost feels like Perl 6 should do better than having to stick -rw after a method name :P (I guess it reminds me of languages without overloading, or something)
09:46 |Tux| 0.016 is what we should aim for :P
09:46 FROGGS |Tux|: I can also look into it
09:46 jdv79 m: say sprintf("%X",123) # ok
09:46 camelia rakudo-moar a190b2: OUTPUT«7B␤»
09:46 jdv79 m: say 123.sprintf("%X") # huh?
09:46 camelia rakudo-moar a190b2: OUTPUT«Directives specify 0 arguments, but 1 argument was supplied␤␤»
09:46 ShimmerFairy m: say "%X".sprintf(123)
09:46 camelia rakudo-moar a190b2: OUTPUT«7B␤»
09:47 ShimmerFairy m: say 123.fmt("%X")
09:47 camelia rakudo-moar a190b2: OUTPUT«7B␤»
09:47 FROGGS what was it again...
09:47 ShimmerFairy jdv79: ^ hopefully one of those is what you were after :)
09:47 FROGGS m: use NQPHLL:from<NQP>; use NativeCall
09:47 camelia rakudo-moar a190b2: OUTPUT«===SORRY!===␤Merging GLOBAL symbols failed: duplicate definition of symbol HLL␤»
09:47 FROGGS ahh, yeah
09:47 jdv79 format as inv seems very oddd
09:48 jdv79 i'll use fmt then
09:54 mr-foobar joined #perl6
09:59 RabidGravy eek a little buglet in Panda::Builder.build-order - the regular expression used to get the module names in the use and require lines won't match names with a '-' in them
10:02 timotimo ouch
10:15 RabidGravy https://github.com/tadzik/panda/pull/197 - if anyone has commit on panda
10:18 virtualsue joined #perl6
10:29 WizJin joined #perl6
10:34 laouji joined #perl6
10:40 dalek roast: a93ea8e | lizmat++ | S (7 files):
10:40 dalek roast: Remove tests for Index
10:40 dalek roast: review: https://github.com/perl6/roast/commit/a93ea8e6ea
10:43 colomon japhb: https://github.com/colomon/mandelbrot/blob/master/bin/mandelbrot-parallel.pl
10:47 tadzik RabidGravy: thanks, merged
10:48 RabidGravy yay!
10:48 g4 joined #perl6
10:49 RabidGravy on a related note is there or should there be a  character class that matches a valid perl identifier?
10:50 nine RabidGravy: would be hard since there are different rules for the first character
10:56 ShimmerFairy there should be <ident> IIRC
10:57 brrt joined #perl6
11:12 itz m: say :a<b>.perl
11:12 camelia rakudo-moar a190b2: OUTPUT«:a("b")␤»
11:12 itz m: say :a<b>.gist
11:12 camelia rakudo-moar a190b2: OUTPUT«a => b␤»
11:12 itz are those different for a reason?
11:12 Begi joined #perl6
11:16 Psyche^ joined #perl6
11:21 Begi1 joined #perl6
11:23 espadrine_ joined #perl6
11:27 rindolf joined #perl6
11:28 pmurias joined #perl6
11:29 dalek rakudo/nom: 7200905 | lizmat++ | src/core/ (3 files):
11:29 dalek rakudo/nom: Eradicate Index in favour of something else
11:29 dalek rakudo/nom:
11:29 dalek rakudo/nom: As discussed at http://irclog.perlgeek.de/perl6/2015-08-05#i_11010199
11:29 dalek rakudo/nom:
11:29 dalek rakudo/nom: Please note that this revert somehow breaks $::("PROCESS")::OUT notation
11:29 dalek rakudo/nom: but keeps PROCESS::<$OUT> working.  I have *no* idea how reverting Index
11:29 dalek rakudo/nom: has an effect on parsing at that level.  Have been banging my head for
11:29 dalek rakudo/nom: a while now, and think this just uncovered some deeper issue that needs
11:29 dalek rakudo/nom: more eyes.  Hence this commit.
11:29 dalek rakudo/nom: review: https://github.com/rakudo/rakudo/commit/7200905244
11:33 ChoHag c
11:33 ChoHag Sorry. Left arm no longer works.
11:37 pmurias :(
11:38 nine lizmat: sounds like a real WTF
11:40 lizmat yeah...
11:40 lizmat hope it unveils some deeper underlying issue
11:40 DrForr https://www.flickr.com/photos/ooraa/sets/72157649361108138/ # *so* going this year.
11:43 ChoHag Agh! It's my coffee-drinking arm!
11:44 lizmat somebody call 26333-11 !
11:45 ChoHag <banal masturbation joke>
11:47 ChoHag I'm sure that number signifies something relevant but I don't know what.
11:48 lizmat COFFEE-11
11:48 lizmat oops, 263333-11  :-)
11:48 nine No wonder, we didn't get it :)
11:48 darutoko- joined #perl6
11:49 lizmat Ka-Tsjing!
11:54 llfourn Is there a way of declaring class with a custom HOW?
11:55 llfourn class Foo is_meta CustomMetaClass { } # or something
11:56 brrt joined #perl6
11:59 lizmat perhaps using World.nqp's add_package_declarator...  but that's getting really into the core guts
12:01 llfourn I think I could do a slang to do it but I was wondering if there was a more friendly way
12:01 llfourn like myclass Foo {}
12:02 ShimmerFairy I thought I saw a keyword like 'is' and 'does' once, but I'm not sure now.
12:02 ChoHag It's easy to apply a trait to an attribute, I guess it's similarly easy to apply one to a class.
12:03 pochi joined #perl6
12:03 ChoHag Those are for inheritence and consumption.
12:03 ChoHag Not the disease.
12:03 llfourn ChoHag: Yep I could do Foo.HOW does CustomMetaClass
12:03 llfourn CustomMetaRole*
12:04 llfourn I actually don't know how to apply trait to class
12:04 ChoHag Nor do I :)
12:04 llfourn ie override class Foo is mytrait {}
12:04 ChoHag Traits are basically black magic I think.
12:04 llfourn well I think class is declaration somehow gets in the way of traits
12:06 sunnavy joined #perl6
12:06 ChoHag Looking at traits.pm I wouldn't say 'gets in the way'. Seems like inheritence is implemented using traits.
12:06 gfldex joined #perl6
12:07 llfourn ChoHang: But I don't seem to be able to override it
12:07 ChoHag multi sub trait_mod:<is>(Mu:U $child, Mu:U $parent) {
12:07 ChoHag Any time somebody who knows what they're talking about wants to chime in is fine by me.
12:08 llfourn ChoHag: Yep I tried that once with  sub trait_mod:<is>(Mu:U $child, MyClass:U $parent) { ... }
12:08 llfourn I think
12:08 llfourn hang on
12:09 ChoHag multi sub trait_mod:<is>(Mu:U $clas, :$funky!) { ... }; class Foo is funky { ... }
12:10 ChoHag m: multi sub trait_mod:<is>(Mu:U $clas, :$funky!) { say "Implement funky class" }; class Foo is funky { has $!something }; say "Compiled"; Foo.new.say
12:10 camelia rakudo-moar 720090: OUTPUT«Implement funky class␤Compiled␤Foo.new␤»
12:11 jnthn llfourn: See Grammar::Tracer, OO::Monitors and OO::Actors for examples on how to do custom meta-objects
12:11 llfourn ChoHag: you're right it works
12:11 llfourn jnthn: kk thanks
12:12 jnthn You basically have to introduce a new package declarator or tweak the meaning of an existing one.
12:12 jnthn Grammar::Tracer does the first (changes what "grammar" uses for its meta-object), the second two introduce new package declarators (monitor and actor respectively)
12:13 jnthn Such changes are lexically scoped.
12:13 llfourn jnthn: I just did this which seesm to work: BEGIN { constant Foo = CustomMetaClass.new_type(:name('Foo')) }
12:14 llfourn but a package declarator would be nice!
12:17 ChoHag How can I see if something's a Failure without throwing or handling it?
12:17 llfourn jnhtn: This is excellent. It's much easier than expected. Thanks.
12:18 jnthn ChoHag: sub f() { fail 'whale' }; say f() ~~ Failure
12:19 jnthn m: sub f() { fail 'whale' }; say f() ~~ Failure
12:19 camelia rakudo-moar 720090: OUTPUT«True␤»
12:19 jnthn m: sub f() { 'whale' }; say f() ~~ Failure
12:19 camelia rakudo-moar 720090: OUTPUT«False␤»
12:19 jnthn Like that
12:19 ChoHag Hmm that seems to be throwing it.
12:19 ChoHag I must be doing something wrong...
12:20 [Coke] m: sub f() returns Str { fail 'whale' }; say f() ~~ Failure
12:20 camelia rakudo-moar 720090: OUTPUT«True␤»
12:20 [Coke] jnthn++ ISTR that didn't work at some point.
12:23 xinming joined #perl6
12:25 jnthn It wasn't me how fixed that one :)
12:29 itz is there a simple way of having a hash with case insensitive keys?
12:39 dalek nqp/js: bacd46f | (Pawel Murias)++ | t/nqp/77-curlexpad.t:
12:39 dalek nqp/js: Test for binding using nqp::curlexpad.
12:39 dalek nqp/js: review: https://github.com/perl6/nqp/commit/bacd46ff64
12:42 lucasb joined #perl6
12:45 [Coke] "use coldfusion" is probably not a reasonable answer.
12:47 lucasb I don't understand why 'sub f returns Str { fail }' works. Shouldn't it respect the return type check?
12:48 lucasb Failure is not an Option
12:48 lucasb er, I mean... Failure is not a Str
12:51 skids joined #perl6
12:51 Begi1 itz: my %hash; %hash{'key'} = 'value'; say %hash{'Key'}; and would retrun 'value' ?
12:51 lizmat m: class Foo is Hash { method AT-KEY($a) { nextwith lc $a } }; my %h := Foo.new; %h<a> = 42; say %h<A>.perl   # itz
12:51 camelia rakudo-moar 720090: OUTPUT«42␤»
12:51 [Coke] lucasb: failure is special.
12:52 smls Everyone who cares qbout p6doc, please read (and comment) this: https://github.com/perl6/doc/issues/114
12:52 lizmat itz: depending on your needs, you would probably need to do ASSIGN-KEY and friends as well
12:54 itz lizmat: ty
12:56 lizmat and perhaps make it a role rather than a subclass  :-)
13:00 dalek nqp/js: bf3601d | (Pawel Murias)++ | src/vm/js/ (5 files):
13:00 dalek nqp/js: Pass test 77.
13:00 dalek nqp/js:
13:00 dalek nqp/js: Implement nqp::curlexpad.
13:00 dalek nqp/js: review: https://github.com/perl6/nqp/commit/bf3601d4e7
13:01 pmurias nqp-js: say("Has it bitrotted?")
13:01 camelia nqp-js: OUTPUT«/bin/sh: node: command not found␤»
13:01 LLamaRider joined #perl6
13:01 pmurias :/
13:01 lizmat m: class Foo {}; my %h is Foo  # too bad this isn't implemented
13:01 camelia rakudo-moar 720090: OUTPUT«5===SORRY!5=== Error while compiling /tmp/Aw6poyYJXA␤Variable trait 'is TypeObject' not yet implemented. Sorry. ␤at /tmp/Aw6poyYJXA:1␤------> 3is Foo  # too bad this isn't implemented7⏏5<EOL>␤    expecting any of:␤        constraint␤»
13:02 lizmat pmurias: moritz could be of help perhaps
13:06 ChoHag Remember that case-insensitive means a vastly different thing in the post-ascii modern world than it used to.
13:10 ChoHag What's the advantage in using proto?
13:10 ChoHag Is it of more concern in core than regular code?
13:15 nebuchadnezzar lizmat: shouldn't the eject symbol be at “Foo”, since the “#” introduce comment?
13:16 jnthn ChoHag: If your candidates would all have some common prelude/postlude it can be useful also
13:16 jnthn (to factor it out)
13:16 lizmat m: class Foo {}; my %h is Foo;  # too bad this isn't implemented
13:16 camelia rakudo-moar 720090: OUTPUT«5===SORRY!5=== Error while compiling /tmp/MUhiRdZnHD␤Variable trait 'is TypeObject' not yet implemented. Sorry. ␤at /tmp/MUhiRdZnHD:1␤------> 3class Foo {}; my %h is Foo7⏏5;  # too bad this isn't implemented␤    expecting any of:␤      …»
13:17 lizmat nebuchadnezzar: yeah, but eof parsing issues we're not going to fix any time soon, I think
13:18 nebuchadnezzar ok
13:26 lizmat ChoHag: regarding case-insensitive, lc() should take care of unicode lowercasing.  If it doesn't we hez a bug
13:27 diana_olhovik_ joined #perl6
13:28 ChoHag Including weird corner cases?
13:28 ChoHag Humans are a strange bunch and languages are very human.
13:30 ChoHag When creating an instance, is there an easy way to ensure methods are called with self as an instance without 'multi method foo (::?CLASS:U:) { ::?CLASS.instance.foo(|%_) }
13:30 baest joined #perl6
13:30 ChoHag And if not, what's the right syntax for calling the instance's foo? |%_ looks like it'll ignore positional parameters.
13:31 FROGGS ChoHag: our unicode implementation should (does) take care of special cases for lower-, upper- and titlecase
13:31 ChoHag FROGGS: I like your confidence.
13:31 FROGGS :o)
13:31 FROGGS I know there is a titlecase bug fwiw
13:31 ChoHag s/an instance/a singleton/
13:39 [Coke] there is an RT for a few of the casing issues that are not doable based simply on the unicode metadata.
13:41 jnthn We don't do the SpecialCasing stuff yet
13:41 tony-o FROGGS is back
13:42 FROGGS O.o
13:43 jnthn Which iirc includes some Turkish final thingy, and the German Scheiße...
13:43 FROGGS :P
13:43 ShimmerFairy jnthn: just took a peek at SpecialCasing, that's the first time I've seen ß referred to as "es-zed" O_o
13:43 ShimmerFairy (though I'm glad it takes care of ß->ẞ ☺)
13:45 ShimmerFairy (or wait, I think it does precisely the wrong thing e_e)
13:46 rindolf joined #perl6
13:47 DrForr ess-tzet I thought it was :)
13:49 [Coke] https://rt.perl.org/Ticket/Display.html?id=121377
13:52 ShimmerFairy [Coke]: as far as I'm concerned, ẞ is the capital of ß, and none of this "SS" business unless you're using one of the NFK forms :) . Sadly nothing in current Unicode reflects this (ẞ has ß mapped as its lowercase, but heaven forbid they do the other direction)
13:54 yqt joined #perl6
13:55 ShimmerFairy fwiw  "ß" ~~ m:i/SS/  looks like something that should only work if you asked for a compatibility decomposition (NFKD/NFKC), so I'd really rather not see that working otherwise.
13:56 ShimmerFairy m: say "ß" ~~ m:i/ẞ/  # this works, however :)
13:56 camelia rakudo-moar 720090: OUTPUT«「ß」␤»
13:57 muraiki joined #perl6
13:58 rurban_ joined #perl6
14:03 lucasb m: my $*x = 42; say $*x
14:03 camelia rakudo-moar 720090: OUTPUT«42␤»
14:03 lucasb m: $*x = 42
14:03 camelia rakudo-moar 720090: OUTPUT«Dynamic variable $*x not found␤  in block <unit> at /tmp/VXYMOFAnJD:1␤␤Actually thrown at:␤  in any  at src/gen/m-Metamodel.nqp:2867␤  in block <unit> at /tmp/VXYMOFAnJD:1␤␤»
14:04 brrt joined #perl6
14:04 lucasb ^^ Is everything fine with this? Isn't it strange to need 'my' (lexical scoping) to declare a dynamic scope var?
14:04 jnthn dynamic variables are lexicals, just looked up differently, and falling back to also looking in GLOBAL and PROCESS
14:05 [Coke] some of the tests predate NFG
14:07 ShimmerFairy As I understand it, dynamic variables simply differ in that they're looked up through the chain of CALLERs, rather than OUTERs (to put it roughly)
14:07 ShimmerFairy [Coke]: doesn't surprise me. Which ones, ooc?
14:08 RabidGravy joined #perl6
14:09 lucasb jnthn, ShimmerFairy: ok, thanks
14:16 Begi1 joined #perl6
14:23 dalek nqp/js: 5681981 | (Pawel Murias)++ | src/vm/js/ (4 files):
14:23 dalek nqp/js: Pass test 74.
14:23 dalek nqp/js:
14:23 dalek nqp/js: Implement nqp::nfarunproto and nqp::nfafromstatelist.
14:23 dalek nqp/js: review: https://github.com/perl6/nqp/commit/56819818a5
14:23 dalek nqp/js: 7160de9 | (Pawel Murias)++ | src/vm/js/nqp-runtime/curlexpad.js:
14:23 dalek nqp/js: Fix bug
14:23 dalek nqp/js: review: https://github.com/perl6/nqp/commit/7160de964e
14:31 FROGGS pmurias++
14:36 nine nqp-js: say("Has it bitrotted?")
14:36 camelia nqp-js: OUTPUT«Has it bitrotted?␤»
14:37 nine pmurias: ^^^ fixed it :)
14:40 [Coke] pmurias++ # welcome back! :)
14:48 itz https://rt.perl.org/Ticket/Display.html?id=125761 should be closed and removed if anyone has RT access
14:55 [Coke] marked as spam, gone
14:56 [Coke] (press the big S in the menu bar)
14:56 [Coke] also killed 125759
14:57 [Coke] up to 1,036 tickets.
14:59 pmurias nine: nice nice :)
15:02 Sqirrel joined #perl6
15:04 mr_ron joined #perl6
15:04 mr_ron m: grammar G {token TOP { <B> }; token B { 'b'+ }}; my $parse-rc = G.parse('bbbb'); my $parse-rc2 = G.parse('bb', :rule<B>); $parse-rc<B> = $parse-rc2;
15:04 camelia rakudo-moar 720090: OUTPUT«Cannot modify an immutable Match␤  in block <unit> at /tmp/D8bdDJcb_k:1␤␤»
15:05 mr_ron any way around the immutable match?
15:07 arnsholt mr_ron: Any particular reason you want to modify the match? Sounds like something there might be a better way to achieve
15:07 itz hmm it's a small overlooked grey S in my browser which I never noticed :)
15:07 itz maybe grey either because a web designer has got their hands on it or maybe a function I don't have access to
15:08 telex joined #perl6
15:08 mr_ron arnsholt: I really want to reparse the authority (host and port) of a URI without having to reparse the whole URI.  This was a smaller example.
15:08 FROGGS m: grammar G {token TOP { <B> { make {'B' => $<B>.made} }}; token B { 'b'+ { make ~$/ }}}; my $parse-rc = G.parse('bbbb').made; my $parse-rc2 = G.parse('bb', :rule<B>).hash; $parse-rc<B> = $parse-rc2;
15:08 camelia rakudo-moar 720090: ( no output )
15:09 FROGGS mr_ron: you might want to move the 'make's into action methods and build a hash/structure there
15:10 Ven joined #perl6
15:14 mr_ron FROGGS: thanks - I have to learn more about action methods ...
15:16 mr-foobar joined #perl6
15:16 * Ven waves from the country side
15:17 dalek nqp/js: 385b139 | (Pawel Murias)++ | src/vm/js/ (3 files):
15:17 dalek nqp/js: Implement nqp::composetype, the reprs still don't do anything at composition time
15:17 dalek nqp/js: review: https://github.com/perl6/nqp/commit/385b1398c1
15:17 dalek nqp/js: 0d6e537 | (Pawel Murias)++ | src/vm/js/bin/run_tests:
15:17 dalek nqp/js: Add passing test 61 to run_tests.
15:17 dalek nqp/js: review: https://github.com/perl6/nqp/commit/0d6e5377f7
15:17 Ven or I guess that's one word only, err?
15:17 nine mr_ron: there's little to learn and it's well worth it :)
15:20 jnthn Ven: Yeah, countryside is one :)
15:45 japhb *yawn*
15:45 yoleaux 08:34Z <jnthn> japhb: What're the failure modes you're seeing of turning it up to 11?
15:45 * japhb is still not 100% awake
15:48 japhb jnthn: It varies.  Sometimes just exiting silently during the phase where I'm building up a giant pile of tasks, sometimes "Object does not exist in serialization context" while waiting on the promises; sometimes binding errors for types that aren't used anywhere in my code, like UInt; and sometimes, if I'm quite lucky, it Just Works.
15:49 jnthn Ugh
15:50 jnthn That middle one is especially weird
15:52 japhb jnthn: The code is structured in a way that produces M * N tasks: I start M tasks that each starts N subtasks, and then I loop doing 'await Promise.anyof(@output-promises)'.  For M=1, it's been solid so far.  For M>1, it's immediately in the unstable territory.
15:52 japhb jnthn: FWIW, N == 14, and I create a thread pool scheduler large enough to handle all M * N tasks in separate threads.
15:53 japhb (dynamically at program start, because M can be determined from MAIN's args)
15:53 jnthn Do you actually have M * N CPU cores? :)
15:53 japhb I WISH.
15:53 jnthn Well, I'm asking mostly 'cus if you start that many real OS threads then you'll end up with over-subscription
15:54 Psyche^_ joined #perl6
15:54 jnthn (If M * N is much greater than number of CPU cores)
15:54 virtualsue joined #perl6
15:54 jnthn Still shouldn't explode, of course.
15:55 japhb This structure is partly because >6 months ago, the Rakudo concurrency code could deadlock when there was no user-level reason for it.  That may well be fixed now, but ... I'm just dusting this code off after having it unchanged for quite a while.
15:55 FROGGS joined #perl6
15:55 japhb Oh, I mean, could deadlock if the threadpool was smaller than the task count.
15:56 jnthn ah, ok
15:56 rurban joined #perl6
15:56 japhb When you say over-subscription, are you hinting at something other than the literal meaning?  It sounds like you're saying that's a known failure mode, rather than just something that reduces performance slightly
15:57 jnthn I just mean it can be a performance reduction
15:57 japhb Ah, OK, that's fine then.  :-)
15:57 TimToady well, and maybe it'll tend to bring out different sorts of problems on average
15:58 jnthn Though I'm not sure how slight it is :)
15:58 pippo joined #perl6
15:58 japhb I initially wanted to set the thread pool size to (CORES - 2) or so, so that I could use my computer for other things responsively, but as I said back when I wrote it, that just begged stability issues.  :-/
15:58 pippo o/ #perl6
15:58 japhb o/
15:59 pippo m: @a = 2014,1,1; my $date = Date.new(@a); #does not work
15:59 camelia rakudo-moar 720090: OUTPUT«5===SORRY!5=== Error while compiling /tmp/T04C16FimY␤Variable '@a' is not declared␤at /tmp/T04C16FimY:1␤------> 3<BOL>7⏏5@a = 2014,1,1; my $date = Date.new(@a); ␤»
15:59 pippo why?
15:59 pippo m: @a = 2014,1,1; my $date = Date.new(@a[0], @a[1], @a[2]);
15:59 camelia rakudo-moar 720090: OUTPUT«5===SORRY!5=== Error while compiling /tmp/1453RYG_xG␤Variable '@a' is not declared␤at /tmp/1453RYG_xG:1␤------> 3<BOL>7⏏5@a = 2014,1,1; my $date = Date.new(@a[0]␤»
16:00 TimToady Read the error message
16:00 japhb pippo: You need a 'my' on the variable decl, and I'm guessing Date.new(|@a)
16:00 TimToady that too
16:00 pippo m: my @a = 2014,1,1; my $date = Date.new(|@a);
16:00 camelia rakudo-moar 720090: ( no output )
16:00 pippo m: my @a = 2014,1,1; my $date = Date.new(|@a);say $date;
16:00 camelia rakudo-moar 720090: OUTPUT«2014-01-01␤»
16:00 pippo Thaaaaaaaaaaaaaaaaaaanks :-))
16:01 TimToady arrays don't autoflatten like they do in P5
16:01 smls jnthn: re your gist, line 64 "The [...] array constructor does not flatten, but respects Slips.":  Wouldn't it be easier if the comma operator takes care of interpolating Slips?
16:01 pippo OK
16:01 smls Instead of letting downstream operators like [ ] decide whether or not to respect the Slip's.
16:01 pippo TY
16:02 TimToady or to look at it the other way, P6 arrays are implicitly references without the \
16:02 TimToady so you can pass multiple arrays as single arguments
16:02 TimToady but that means you have to do something like | when you really want the other thing
16:03 japhb jnthn: In your GLR gist, the three lines of comment starting at https://gist.github.com/jnthn/aa370f8b32ef98e4e7c9#file-glr-p6-L86 seem out of place ... or maybe I'm just confused.
16:05 zakharyas joined #perl6
16:05 TimToady smls: that's just a manner of speaking, since [] delegates the work to the list subsystem, which is what handles the commas too
16:06 smls ah, ok
16:06 nine It's shocking how much productivity time I waste by blocking on the decision of what I should make for dinner...
16:07 smls TimToady: Did anything become of your idea to use prefix | for both .Slip and agrument interpolation?
16:07 TimToady we might try it and see if it's worth it
16:08 jnthn smls: At the moment my [a,b] is a call to GLRArrayCircumfix(a,b) because I really didn't want to have to write a GLR, b there too :)
16:08 TimToady it would basically be taking currently illegal | and turning it into slip()
16:08 smls I'm not thrilled about having to write  "my @b = 1, @a.Slip;"  or  "my @b = flat 1, @a;"  but  "my @b = 1, |@a"  wouldn't be so bad.
16:08 * jnthn will probably write the flat variant of it
16:09 jnthn smls: It's up for grabs whether we'll call [...] always with one arg or whether we'll call it with a bunch of args
16:09 jnthn smls: I may do the latter for performance reasons.
16:10 jnthn Oh, and I think we have to
16:10 jnthn Because
16:10 jnthn [(1, 2, 3)] != [1, 2, 3]
16:10 jnthn So yeah, it'll stay largely as it is.
16:11 jnthn japhb: Yeah, I think they somehow were attached to the previous bullet point once... :)
16:12 jnthn Either way, most of the interesting work of handling the Slip is shared over exactly the same code
16:19 spider-mario joined #perl6
16:25 JimmyZ what is the difference between ' my $x := self.CREATE' and ' my \x = self.CREATE' ?
16:26 jnthn Nothing much
16:26 jnthn They probably even compile into the same thing
16:26 TimToady you can rebind $x, can you rebind \x?
16:26 jnthn Oh
16:26 jnthn Yeah, true :)
16:26 TimToady it's really partly intended for explicit SSA programming
16:26 jnthn *nod*
16:27 * jnthn writes SSA code generally
16:27 TimToady I had a thought on distinguishing named vs pair notation: if we made the named form a :> 123 and reserved a => 123 for pairs, then all of the named parameters have a colon somewhere
16:27 TimToady though :> would take some getting used to
16:27 jnthn :/
16:28 jnthn I don't see it as a problem that needs fixing, tbh.
16:28 jnthn And I really don't feel like the echosystem upheavel
16:28 jnthn *ecosystem
16:28 JimmyZ I saw the glr gist some is \x =,and some is $x :=
16:28 JimmyZ :P
16:28 jnthn JimmyZ: Yeah, I've probably been inconsistent. It really doesn't matter.
16:29 jnthn I tend to think in semantics rather than syntax.
16:29 JimmyZ so I thought there are some difference .
16:29 jnthn Well, if I'll rebind it later than it'll be $x
16:29 jnthn But no, don't read too deeply into that :)
16:30 pippo o/
16:30 pippo left #perl6
16:31 jnthn TimToady: I'd sooner outlaw 42 => ... in an argument list as "must have an identifier here" and demand parens around it in that context, than change the operator.
16:31 jnthn Using => to pass named args is deeply culturally embedded in Perl for a long, long while
16:31 TimToady trew
16:32 mr_ron left #perl6
16:32 JimmyZ Did the design docs say  about rebind or difference?
16:32 TimToady not sure
16:32 jnthn Well, my \x = ... is documented as SSA
16:32 jnthn iirc
16:33 JimmyZ it is nice to have, if it is not  there
16:38 JimmyZ I didn't find it talks about SSA in the specs repo...
16:38 JimmyZ good night
16:39 TimToady I didn't either, good night
16:40 jnthn 'night, JimmyZ
16:45 zakharyas joined #perl6
16:46 jdv79 Null regex not allowed?
16:47 jdv79 hmm, i was going to so /[$re_constant | $re_opt] and have the default for re_opt be //
16:47 jdv79 is there some way to do something like that?
16:48 TimToady match ''
16:48 TimToady or <?>
16:49 jdv79 oh, thanks
16:52 smls m: say key : "value";
16:52 camelia rakudo-moar 720090: OUTPUT«5===SORRY!5=== Error while compiling /tmp/7YDKbEeIuc␤Preceding context expects a term, but found infix : instead␤at /tmp/7YDKbEeIuc:1␤------> 3say key :7⏏5 "value";␤»
16:53 smls ^^ bare colon with surrounded by whitespace isn't taken either :P
16:55 smls though I'm kinda hoping that in some future Perl 6.x, that will be allowed for python-like control statements...
16:55 smls given ... { when 1 { ... }; default { ... }  }   has too high brace density
16:55 smls given ... { when 1 :  ... ; default : ...  }   would be prettier
16:55 cognominal joined #perl6
16:57 dalek specs: dfad561 | TimToady++ | S06-routines.pod:
16:57 dalek specs: mention that \x is SSA semantics
16:57 dalek specs: review: https://github.com/perl6/specs/commit/dfad561063
16:58 TimToady smls: we can't use it for that and the invocant colon at the same time
16:59 smls isn't preceding whitespace forbidden for the invocant colon?
16:59 TimToady no, it's just a funny comma
16:59 smls .oO( damn you, incocant comma! *shakes fist* )
17:00 TimToady plus autoquoting the left side is problematic with such an ambiguous character
17:01 smls right
17:01 smls though the control statements usage would not do that
17:01 TimToady plus people will try to leave out the space on the left, and get confused
17:01 TimToady and it's just not really visual enough for a directional relationship
17:02 TimToady (though to be fair, colon is a directional relationship in English, generally)
17:03 TimToady one other minor point, while => requires two characters, ' : ' is really requiring three
17:12 dalek perl6-roast-data: bd19963 | coke++ | / (9 files):
17:12 dalek perl6-roast-data: today (automated commit)
17:12 dalek perl6-roast-data: review: https://github.com/coke/perl6-roast-data/commit/bd19963208
17:13 nine smls: wishing for Python syntax to write prettier one-liners is...ironic :)
17:15 TimToady if we really want something that's one character, we should use something like ≘
17:15 TimToady .u ≘
17:15 yoleaux U+2258 CORRESPONDS TO [Sm] (≘)
17:22 rangerprice joined #perl6
17:28 kjs_ joined #perl6
17:28 jnthn It looks like a cheezburger...
17:28 rangerprice cheezburger is delicious
17:32 timotimo i'm really hungry :S
17:34 baest_ joined #perl6
17:40 japhb jnthn: 🍔
17:40 brrt joined #perl6
17:44 ChoHag 🐍
17:52 skids joined #perl6
18:06 ChoHag How do you create a Pair where the key isn't a Str?
18:07 ChoHag Or: How do I not autostringify the LHS of foo => bar?
18:07 timotimo m: my $test = Pair.new(:key(1), :value(10)); say $test.value.WHAT
18:07 camelia rakudo-moar 720090: OUTPUT«(Int)␤»
18:07 timotimo that's how
18:07 ChoHag No shorter syntax?
18:08 timotimo m: say ((1) => "hi").key.WHAT
18:08 camelia rakudo-moar 720090: OUTPUT«(Int)␤»
18:08 timotimo m: say (1 => "hi").key.WHAT
18:08 camelia rakudo-moar 720090: OUTPUT«(Int)␤»
18:08 timotimo m: say ($_ => "hi").key.WHAT
18:08 camelia rakudo-moar 720090: OUTPUT«(Any)␤»
18:08 timotimo m: $_ = 100; say ($_ => "hi").key.WHAT
18:08 camelia rakudo-moar 720090: OUTPUT«(Int)␤»
18:08 ChoHag Ah so it's just because my variable is sigilless.
18:08 ChoHag So since I'm cargo-culting that, what's the significance of sigilless variables?
18:09 ChoHag I recalled doing 'my \r = foo' from before as a way to keep the return value entirely unaffected, down to the container. Is that the way to do it?
18:09 timotimo ah yes, sigilless variables will do that for you
18:41 lucasb joined #perl6
18:44 lucasb m: say Pair.new
18:44 camelia rakudo-moar 720090: OUTPUT«(Any) => (Mu)␤»
18:44 Sqirrel joined #perl6
18:45 lucasb Would it be better if Pair.new() was an error?
18:45 rurban joined #perl6
18:45 lucasb Also, would it be easier to have a Pair.new($k,$v) constructor too?
18:47 lucasb m: class P is Pair { submethod BUILD {} }; say P.new(:key<a>,:value(1))
18:47 camelia rakudo-moar 720090: OUTPUT«Too many positionals passed; expected 1 argument but got 3␤  in submethod BUILD at /tmp/MIVaQaO4Dl:1␤  in block <unit> at /tmp/MIVaQaO4Dl:1␤␤»
18:49 lucasb ^^ I would like to try fixing these 3 things, if someone can confirm and agrees with me
18:54 nys joined #perl6
19:04 lucasb m: say Pair.new.antipair
19:04 camelia rakudo-moar 720090: OUTPUT«Type check failed in binding $key; expected 'Any' but got 'Mu'␤  in block <unit> at /tmp/ISI3i5C5yc:1␤␤»
19:05 smls I do think having to write   Pair.new(key => ..., value => ...)   has a certain irony to it :P
19:06 lucasb I don't know why key must be Any and value can be Mu. Either both are Mu or both are Any?
19:06 nine lucasb: Pair.new($key, $value); has been tossed around a couple days ago and it was the first thing I tried. I think the idea has merit.
19:06 nine lucasb: I'm not sure what banning Pair.new would buy us though.
19:06 smls yeah, if Date.new can have a positional constructor, why not Pair.new
19:08 smls lucasb: Regarding key and value having different default type constraints, I don't see that as an issue
19:08 smls Hash also has  Str  for keys and  Mu  for values, by default.
19:09 jnthn It's funny we call them sigilless variables, when they can't vary... :)
19:09 jjido joined #perl6
19:10 smls should we call them "lexical constants"?
19:10 lucasb m: my %h; %h<a> = all(1,2,3); say %h; say %h.antipairs  # this is a little funny :)
19:10 camelia rakudo-moar 720090: OUTPUT«a => all(1, 2, 3)␤all(1 => a, 2 => a, 3 => a)␤»
19:12 lucasb sure, with 'my %h{Mu}' it works as I would expect :)
19:12 lucasb oops, *no*, it doesn't work as I would expect
19:13 TimToady jnthn: well, they vary in the sense that any rebindable symbol can vary
19:14 TimToady rebindable-on-reentry, I mean
19:15 ribasushi <jnthn> [(1, 2, 3)] != [1, 2, 3]
19:15 ab5tract_ m: sub new-pair( *@a, :$k, :$v ) { die if ($k || $v) && +@a; +@a ?? ( @a[0] => @a[1] ) !! ( $k => $v ) }; say new-pair( :k('k'), :v('v')); say new-pair( 'k','v' ); say new-pair( :k('nok'), 'v')
19:15 camelia rakudo-moar 720090: OUTPUT«k => v␤k => v␤Died␤  in sub new-pair at /tmp/TOQix5GFz9:1␤  in block <unit> at /tmp/TOQix5GFz9:1␤␤»
19:15 ribasushi out of curiosity what is the difference in the above?
19:15 ab5tract_ (even without mmd ;)
19:17 jnthn ribasushi: Array with one item that's a list of 3 Ints, vs. array of 3 Ints.
19:18 jnthn TimToady: Yes, true. :) I wasn't being especially serious... :)
19:21 ChoHag Seriousness is overrated.
19:21 ab5tract_ I feel like it would make a bit more sense to approach 'Pair.new' as 'pair', which could be a sub implemented much as I just did, with either positional or named parameters, but not both at the same time.
19:22 ChoHag Much as it annoys me when people say its like to me, mostly because it's correct, core/Pair.pm exists.
19:22 ab5tract_ though, come to think of it, 'pair' would just be analogous to the constructor form anyway, if it were to keep with convention?
19:22 ChoHag And at 20 lines it's ripe for the editing.
19:22 TimToady we certainly privilege other constructors, like set()
19:22 ribasushi jnthn: is there a writeup on the basic difference?
19:23 ribasushi or is the latter a basic type?
19:23 TimToady are you talking about [(1,2,3)]?
19:23 ChoHag On a meta note, while you're here TimToady, I think more noise could be made about the easy hackability of perl 6 the language.
19:23 TimToady we'll make more noise after Christmas
19:23 jnthn TimToady: yes
19:24 jnthn TimToady: Did I confuse myself on the difference? :)
19:24 jnthn TimToady: oh dammit, we settled on single item rule, didn't me...
19:24 jnthn *we
19:24 TimToady I was asking ribasushi
19:24 ChoHag Yeah I know I bitch here more and patch/bug-report less than I should, but the code in core/ and Perl6/ looks particularly editable.
19:24 ribasushi TimToady: yes, that
19:24 jnthn TimToady: Yeah, but I think I mighta confused things...
19:25 ab5tract_ ChoHag: one of my absolute must-haves now that I've hacked on Rakudo is being able to code the implementation in the language itself
19:26 ab5tract_ Though of course I would say that.. I'm a Perl hacker, so of course I couldn't hack in the implementation language until Perl got written in Perl ;)
19:26 ChoHag Same.
19:27 mst TimToady: basically, we both saw [(1,2,3)] != [1,2,3], went "eh what huh?!", and came over here to ask, and he was faster
19:27 jnthn mst: It woulda been justifiable, but we ended up not going that way.
19:28 jnthn mst: Note that [(1, 2, 3),] *would* be different.
19:28 ChoHag I'm ignoring list/array oddities until jnthn's hackery is merged.
19:28 ribasushi oh, I didn't realize this is WIP, carry on then
19:28 jnthn ribasushi: Well, the fact it's WIP is why I got confused.
19:28 mst jnthn: trailing comma?
19:28 mst significant?
19:28 jnthn mst: Yes.
19:28 TimToady yes, but we're transitioning to a "one-arg" rule, which is gonna be a little disconcerting to us and everyone else :)
19:28 * mst adjusts the 'python footgun-ometer' one step up
19:28 DrForr WIP it good?
19:29 ChoHag Because the whole thing's Weird As Fuck (which is saying something considering Perl 6 : Perl 5 ~~ Weird : Normal) and it looks like that's going to change.
19:31 jnthn DrForr: Well, hopefully not WIP it back and forth... :)
19:31 ab5tract_ ',' is a list constructor, no?
19:31 * DrForr Devo-lves.
19:31 spider-mario joined #perl6
19:32 jnthn ab5tract_: Correct
19:33 ab5tract_ Then trailing without effect would actually be the unexpected behavior here
19:33 jnthn Indeed.
19:34 jnthn It's totally logical once you understand that.
19:34 ab5tract_ Though I suspect at some point I might not be able to deal and hack up a pragma for trailing commas ('use explicit-list' ?)
19:34 ab5tract_ ;)
19:34 jnthn Well, thing is, if you're writing my @a = 1, 2, 3,; style things, there's no parens needed at all
19:35 jnthn So you don't even get to make the mistake of putting the comma the wrong side of the parens and getting a surprise.
19:35 jnthn As if you're especially likely to do that and not notice it anyways...
19:36 mst this is actually kinda prologish ;)
19:36 mst my @a = 1, 2, 3.
19:36 ab5tract_ jnthn: that is a very good point. the most appropriate of all trailing commas, is the traling comma at the end of a List! :)
19:36 jnthn mst: As I said, it's logical :P
19:37 Guest37893 joined #perl6
19:38 mst jnthn: right up until somebody takes [(1,2),(3,4)] and removes the second element and ends up with [(1,2)] at which point apeiron eats a kitten
19:38 mst jnthn: note that this happens a lot with people editing python tuple constructors and results in much cursing
19:39 ab5tract_ mst: [ ] should already behave as if it had ',' inside it, iirc
19:39 jnthn mst: But you can't have that *and* have [1,2,3] *and* [(1, 2, 3)] be the same thing.
19:40 mst I'm aware. basically you need a keyboard with more sorts of bracket
19:40 ChoHag You mean a unikeyboard?
19:42 ab5tract_ just a sub circumfix:<<$unused-unicode-char>> away
19:42 jnthn mst: Then you end up with more sorts of list-related type, which people will also complain about.
19:42 jnthn mst: The only thing that's a cert is you can't win... :)
19:42 ChoHag Welcome to reality.
19:43 mst jnthn: right, I'm just not entirely sure whether this is the right trade-off
19:43 mst maybe the real answer here is to forbid [(1, 2, 3)] entirely as ambiguous
19:43 mst I mean, nobody would complain about that, right?
19:43 * mst hides
19:44 brrt joined #perl6
19:45 jnthn mst: Well, the argument is for consistency between [...] and my @a = ...;
19:46 smls You could always have a linter that detects such cases.
19:46 ChoHag Consistency, like seriousness, is also overrated.
19:46 ChoHag Else what's the point in irregular verbs?
19:46 mst o/ I'd love to stay here and be normal / but it was always overrated o/
19:47 mst jnthn: yeah, and my thought is if you encourage people to the idea of
19:47 ChoHag Normality's another one.
19:47 mst my @a = (...); is consistent with [...]
19:47 mst then [(1, 2, 3)] is weird and makes no sense and don't do that
19:47 jnthn You don't need the parens in the first one
19:47 ab5tract_ mst: then we might as well code in Perl 5?
19:48 ab5tract_ (I saw that as an undying fan of Perl 5)
19:48 ab5tract_ *say
19:48 mst the *idea* doesn't imply you use the parens all the time
19:48 ChoHag What do different types of bracket *mean* (where mean != do)?
19:48 mst only that you use that as a heuristic
19:49 ChoHag Programming aside, what's their purpose?
19:49 mst jnthn: eh, I can always use a slang to forbid [(1, 2, 3)], can't I :P
19:49 ab5tract_ mst: in a dozen lines or so, I would expect
19:50 mst use grumpy::mst;
19:58 ab5tract_ mst: if you've seen the style that Slang::Tuxic accomodates, you might see that implementing grumpy::mst is a trivial (and by all relative metrics completely sane) feat for Perl 6
19:58 ab5tract_ (said with all respect to [TuxCM]++ :) )
19:58 ChoHag Amusingly/Ironically: Square brackets ([ ]) are used inside of parentheses to denote something subordinate to the subordinate clause.
19:59 ab5tract_ ChoHag: IIUC, () implies 'flatten away' while [] implies 'flattening is only gonna happen explicitly'
19:59 ChoHag "Programming aside"
19:59 ab5tract_ ChoHag: EDOESNOTCOMPUTE ;)
20:00 ChoHag :)
20:00 ab5tract_ ChoHag: if we rephrase that as, what is the linguistic significance of [] vs (), we might be able to /summon TimToady
20:01 ab5tract_ (though there are no guarantees in linguistics, as I understand it)
20:01 [TuxCM] :)
20:02 ChoHag Pratchett put it best, and I can't remember the exact quote, but it's something about using a language formed for the purpose of telling each other where the best fruit is.
20:03 mst [TuxCM]: where would I be best looking for Slang::Tuxic and an example of its use?
20:03 [TuxCM] panda install Slang::Tuxic
20:03 [TuxCM] http://modules.perl6.org <= type "slang" in the search box
20:04 [TuxCM] https://github.com/FROGGS/p6-Slang-Tuxic/
20:04 [TuxCM] http://tux.nl/Talks/CSV6/slang2.html
20:05 [TuxCM] http://localhost:8089/Talks/CSV6/slang.html <= causes for my griefs before I got it my way ( FROGGS++ )
20:05 mst thank you
20:05 ChoHag localhost?
20:05 ChoHag I love that site!
20:06 mst hahahahaha hadn't noticed that last one :D
20:06 [TuxCM] sorry :)
20:06 [TuxCM] just replace with tux.nl
20:06 * [TuxCM] has to go now
20:09 noganex joined #perl6
20:09 darutoko joined #perl6
20:09 colomon_ joined #perl6
20:10 gfldex_ joined #perl6
20:12 Woodi_ joined #perl6
20:12 pmurias joined #perl6
20:17 spider-mario joined #perl6
20:29 diana_olhovik_ joined #perl6
20:29 ChoHag How can I restrict the key and/or value of a Pair in a method Signature?
20:30 ChoHag (..., Pair(what?) :$foo, ...) ?
20:38 RabidGravy "where"
20:40 lizmat m: sub a(:$foo where .key eq "bar") { say $foo }; a :foo(bar=>42)   # ChoHag
20:40 camelia rakudo-moar 720090: OUTPUT«bar => 42␤»
20:40 lizmat m: sub a(:$foo where .key eq "bar") { say $foo }; a :foo(zip=>42)   # ChoHag
20:40 camelia rakudo-moar 720090: OUTPUT«Constraint type check failed for parameter '$foo'␤  in sub a at /tmp/NlgkZoudad:1␤  in block <unit> at /tmp/NlgkZoudad:1␤␤»
20:41 cognominal joined #perl6
20:42 ChoHag Thanks.
20:44 kjs_ joined #perl6
20:46 espadrine joined #perl6
21:04 rurban joined #perl6
21:21 pyrimidine joined #perl6
21:26 beastd joined #perl6
21:26 rurban joined #perl6
21:34 yqt joined #perl6
21:40 telex joined #perl6
21:58 yqt joined #perl6
21:59 TEttinger joined #perl6
21:59 rurban joined #perl6
22:11 skids joined #perl6
22:15 kjs_ joined #perl6
22:18 cognominal joined #perl6
22:20 [Sno] joined #perl6
22:52 Hurricane joined #perl6
22:53 Hurricane Hello, I have a question regarding installation of perl modules: Is there a way to edit the code after it downloaded the package, but before it compiles it?
22:56 skids Hurricane: I belive if you get the mod into a dir there is a panda option to install from dirs.
22:57 Hurricane Ah okay, because I have a module that won't install, so I need to apply this fix before it tries to compile it: https://github.com/tsee/extutils-cppguess/issues/9
22:58 skids Oh, that's perl5.
22:58 skids So you wouldn't be using panda, and might be better off asking on perl5 channels.
22:59 Hurricane Oh okay, sorry I didn't notice the difference, I am pretty new to perl yet
23:01 skids No problem at all.
23:08 AlexDaniel joined #perl6
23:09 jnthn *sigh* Finally, I get to rest. :) Will be back to work on the GLR stuff tomorrow. 'night
23:10 skids o/
23:20 Hurricane left #perl6
23:25 DarthGandalf joined #perl6
23:25 _sri joined #perl6
23:26 mephinet joined #perl6
23:31 baest joined #perl6
23:44 cognominal joined #perl6
23:46 dalek doc: ff84848 | skids++ | lib/Language/5to6.pod:
23:46 dalek doc: Quickly clarify that items use dereferencing under sigil invarience
23:46 dalek doc: review: https://github.com/perl6/doc/commit/ff84848521

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

Perl 6 | Reference Documentation | Rakudo