Perl 6 - the future is here, just unevenly distributed

IRC log for #perl6, 2017-06-26

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:16 travis-ci joined #perl6
00:16 travis-ci Doc build errored. Will "Coke" Coleda 'Don't emit {}'s around type name
00:16 travis-ci https://travis-ci.org/perl6/doc/builds/246910657 https://github.com/perl6/doc/compare/01a7c34f473d...fcc07f1575dc
00:16 travis-ci left #perl6
00:24 travis-ci joined #perl6
00:24 travis-ci Doc build errored. Will "Coke" Coleda 'test examples, part of #1387'
00:24 travis-ci https://travis-ci.org/perl6/doc/builds/246912082 https://github.com/perl6/doc/compare/fcc07f1575dc...ec53fea13055
00:24 travis-ci left #perl6
00:29 travis-ci joined #perl6
00:29 travis-ci Doc build passed. Will "Coke" Coleda 'test examples, part of #1387'
00:29 travis-ci https://travis-ci.org/perl6/doc/builds/246913089 https://github.com/perl6/doc/compare/ec53fea13055...29c904656500
00:29 travis-ci left #perl6
00:42 ChoHag joined #perl6
00:47 lookatme joined #perl6
00:47 lookatme morning
00:48 zapwai joined #perl6
00:57 [Coke] hio
01:00 samcv hey [Coke]
01:01 samcv i need to go from: my $a = (1,2,3), (5,6,6); my $b = (1,0); to: (1,2,3,1), (5,6,6,0)
01:02 samcv so each element of $a had each element of $b added to it
01:02 samcv m: my $a = $[[11673, 32, 2], [11697, 32, 2]]; my $b = $[0, 0]; say $a Z $b
01:02 camelia rakudo-moar e4f335: OUTPUT: «(([[11673 32 2] [11697 32 2]] [0 0]))␤»
01:02 samcv this at least didn't work
01:03 samcv is there a builtin that can do this for me?
01:07 MasterDuke m: my @a = (11673, 32, 2), (11697, 32, 2); my @b = (0, 0); say (@a Z @b).map(*.flat)
01:07 camelia rakudo-moar e4f335: OUTPUT: «(((11673 32 2) 0) ((11697 32 2) 0))␤»
01:23 MasterDuke m: my @a = (11673, 32, 1), (11697, 32, 2); my @b = (8,9); say @a.map({|$_, @b[$++]})
01:23 camelia rakudo-moar e4f335: OUTPUT: «((11673 32 1 8) (11697 32 2 9))␤»
01:30 samcv cool. thanks
01:30 samcv not bad
01:47 BenGoldberg m: my $foo = "abc"; role Foo { has $.z = 42 }; $foo does Foo; use nqp; dd nqp::bindattr( $foo, Foo, '$!z', 42 );
01:47 camelia rakudo-moar e4f335: OUTPUT: «P6opaque: no such attribute '$!z' in type Foo when trying to bind a value␤  in block <unit> at <tmp> line 1␤␤»
01:47 * BenGoldberg wonders what he's doing wrong.
01:47 BenGoldberg m: my $foo = "abc"; role Foo { has $.z = 42 }; $foo does Foo; use nqp; dd nqp::getattr( $foo, Foo, '$!z' );
01:47 camelia rakudo-moar e4f335: OUTPUT: «P6opaque: no such attribute '$!z' in type Foo when trying to get a value␤  in block <unit> at <tmp> line 1␤␤»
01:48 ilbot3 joined #perl6
01:48 Topic for #perl6 is now »ö« Welcome to Perl 6! | https://perl6.org/ | evalbot usage: 'p6: say 3;' or rakudo:,  or /msg camelia p6: ... | irclog: http://irc.perl6.org or http://colabti.org/irclogger/irclogger_logs/perl6 | UTF-8 is our friend!
01:50 BenGoldberg To have questions is human.  To have only perfect questions would be divine. ;)
01:51 perigrin divinity is more about having perfect answers I thought
01:51 perigrin well *being* perfect answers
01:54 BenGoldberg Man was created in god's image.  Assuming we're talking brains, not bodies, then anything man does that's good, god must have done first.
01:56 BenGoldberg I can't know what god's questions might be or have been, but one of them might have been "What happens if I were to say, Let there be light!" (or more generally, "What happens if I do *this*?")
01:58 MasterDuke the last question: "can entropy be reversed?" - http://multivax.com/last_question.html
02:02 [Coke] -1 on the theology.
02:05 sufrostico joined #perl6
02:09 BenGoldberg Anyway, does anyone know why my nqp:: thingy above didn't work?
02:13 BenGoldberg If I'm forced to, I'll fetch Attribute objects from the mop, but using getattr/bindattr would be so much faster for what I want.
02:15 TEttinger God does a pretty good interpretation of a random number generator
02:15 TEttinger alternately, impression
02:16 mr-foobar joined #perl6
02:19 Geth ¦ doc: 2c823b0e80 | (Will "Coke" Coleda)++ | 2 files
02:19 Geth ¦ doc: test examples, part of #1387
02:19 Geth ¦ doc: review: https://github.com/perl6/doc/commit/2c823b0e80
02:19 Geth ¦ doc: 553bdad0aa | (Will "Coke" Coleda)++ | doc/Language/exceptions.pod6
02:19 Geth ¦ doc: Change "try blocks" heading to just "try"
02:19 Geth ¦ doc:
02:19 Geth ¦ doc: Add note about try with a statement.
02:19 Geth ¦ doc:
02:19 Geth ¦ doc: Closed #1284
02:19 Geth ¦ doc: review: https://github.com/perl6/doc/commit/553bdad0aa
02:19 noganex_ joined #perl6
02:28 Cabanossi joined #perl6
02:28 [Coke] \o/ I can finally install npm packages on this machine, which means I can build the docs again.
02:34 [Coke] ... except that somehow I still get the error about self signed certs when doc tries to install a package. :P
02:42 alpha joined #perl6
02:43 Guest59871 left #perl6
02:53 aindilis joined #perl6
02:53 [Coke] .tell samcv node-gyp is borked: https://github.com/nodejs/node-gyp/issues/695#issuecomment-310951976
02:53 yoleaux [Coke]: I'll pass your message to samcv.
02:55 [Coke] so I can run 'npm install ....' whatever, and it works with my cert situation. when it calls out to node-gyp, gyp is ignoring my cafile.
02:57 stmuk_ joined #perl6
02:58 Cabanossi joined #perl6
03:09 travis-ci joined #perl6
03:09 travis-ci Doc build errored. Will "Coke" Coleda 'Change "try blocks" heading to just "try"
03:09 travis-ci https://travis-ci.org/perl6/doc/builds/246937231 https://github.com/perl6/doc/compare/29c904656500...553bdad0aa51
03:09 travis-ci left #perl6
03:11 Cabanossi joined #perl6
03:21 khw joined #perl6
03:25 mr-foobar joined #perl6
03:27 wamba joined #perl6
04:16 mr-foobar joined #perl6
04:24 geekosaur joined #perl6
04:24 Actualeyes joined #perl6
04:42 Cabanossi joined #perl6
04:47 mr-foobar joined #perl6
04:49 curan joined #perl6
05:00 samcv eek [Coke]
05:00 samcv so. this messes up the highlighter i'm guessing?
05:11 Cabanossi joined #perl6
05:21 lowbro joined #perl6
05:21 lowbro joined #perl6
05:41 Cabanossi joined #perl6
05:51 xtreak joined #perl6
06:23 domidumont joined #perl6
06:27 xtreak joined #perl6
06:29 domidumont joined #perl6
06:30 mr-foobar joined #perl6
06:41 Cabanossi joined #perl6
06:55 eliv joined #perl6
07:03 mr-foobar joined #perl6
07:04 wamba joined #perl6
07:10 ufobat joined #perl6
07:11 Cabanossi joined #perl6
07:16 zakharyas joined #perl6
07:28 espadrine joined #perl6
07:32 Actualeyes left #perl6
07:35 abraxxa joined #perl6
07:41 konsolebox joined #perl6
07:42 moritz PSA: I'm currently updating the IRC log server (jessie -> stretch). Loss of availabilty or logging is possible.
07:43 rindolf joined #perl6
07:43 tyil lizmat (or anyone else dealing with the amsterdam p6 conf): unlimited is spelled wrong on the site
07:48 KDr2__ joined #perl6
07:51 dogbert2 joined #perl6
07:53 andrzejku joined #perl6
08:02 ilbot3 joined #perl6
08:02 Topic for #perl6 is now »ö« Welcome to Perl 6! | https://perl6.org/ | evalbot usage: 'p6: say 3;' or rakudo:,  or /msg camelia p6: ... | irclog: http://irc.perl6.org or http://colabti.org/irclogger/irclogger_logs/perl6 | UTF-8 is our friend!
08:03 dakkar joined #perl6
08:03 parv joined #perl6
08:04 jonas1 joined #perl6
08:05 andrzejku hi people :)
08:05 parv hola
08:07 andrzejku are here C++ developers?
08:10 parv don't look at me
08:12 Cabanossi joined #perl6
08:16 andrzejku joined #perl6
08:18 domidumont joined #perl6
08:19 |oLa| joined #perl6
08:30 mr-fooba_ joined #perl6
08:31 wamba joined #perl6
08:37 * zengargoyle skipped learning C++ back when C++ was just a pre-processor that turned 'C++' into plain 'C' code before comiling.
08:44 parv Whhattt? ;-O
08:52 konsolebox joined #perl6
08:52 mr-foobar joined #perl6
09:12 Cabanossi joined #perl6
09:18 mr-foobar joined #perl6
09:18 zengargoyle the early C++ was something like a program called `cfont` IIRC.  you wrote C++ of the era and ran cfont to generate C code which you then compiled normally.
09:22 zengargoyle this was back around the time when the NeXT came out and the other contender was Objective-C, which i thought was a better idea than just C + filtering magic. :)
09:25 parv how does C pre processor fit with cfont history?
09:26 xiaomiao parv: independent
09:26 parv hmm. ok.
09:26 xiaomiao CPP was a part of early C, cfront came a lot later
09:42 Cabanossi joined #perl6
09:50 mr-foobar joined #perl6
10:09 samcv [Coke], so does this affect the highlighter? i'm not sure if highlights depends on node-gyp
10:10 donaldh joined #perl6
10:11 robertle joined #perl6
10:18 nattefrost joined #perl6
10:30 xtreak joined #perl6
10:31 astj joined #perl6
10:34 astj joined #perl6
10:34 astj joined #perl6
10:39 lowbro joined #perl6
10:39 lowbro joined #perl6
10:49 DeadDelta joined #perl6
10:49 mr-foobar joined #perl6
15:07 ilbot3 joined #perl6
15:07 Topic for #perl6 is now »ö« Welcome to Perl 6! | https://perl6.org/ | evalbot usage: 'p6: say 3;' or rakudo:,  or /msg camelia p6: ... | irclog: http://irc.perl6.org or http://colabti.org/irclogger/irclogger_logs/perl6 | UTF-8 is our friend!
15:07 llfourn melezhik: I think you .start the Proc::Asyncs, which returns a promise and await them when you're ready
15:07 moritz joined #perl6
15:07 DeadDelta melezhik: are you restarting the processes or what? I'm not following where the while(True) bit comes in
15:08 melezhik I mean the best sceantio is I don't anything extra. However I am reading this - https://docs.perl6.org/type/Proc::Async and it have an example with - my $promise = $proc.start;  and then await $promise;
15:09 ugexe $promise.then({ $next thing })
15:09 melezhik no I just to run the processes and somehow to know theirs exit code
15:09 melezhik that is it
15:09 DeadDelta melezhik: have you looked at Proc::Q?
15:09 llfourn so just start them and await a list of their promises
15:09 ugexe so await Promises.allof(@promises)
15:09 DeadDelta Man, too many cooks.
15:10 DeadDelta left #perl6
15:10 llfourn ugexe: is allof different to awaiting an array of promises?
15:10 melezhik this one - https://github.com/zoffixznet/perl6-Proc-Q probably seems closer to what I need, will read it deeply, thanks
15:11 moritz Ven``: (re perlgeek.de downtime) turns out the kernel in Debian Stretch names the interfaces quite differently than the one in Debian Jessie
15:11 moritz so all that fancy config for eth0 is for naught
15:12 moritz ... when the thing is now called ens32 or so
15:13 iH2O joined #perl6
15:13 jnthn llfourn: Yes, Promise.allof(...) is just for sequencing, if any of the Promises fail you won't see any errors from them just from await Promise.allof(...)
15:13 jnthn llfourn: While await @promises will give you the errors
15:14 llfourn jnthn: ah k thanks
15:15 melezhik indeed I probably need job queue or scheduller implimentation for lot of tasks ...
15:15 iH2O how can I check if this failed: my Str $f=slurp('myfile')
15:18 llfourn iH2O: if it fails slurp will return a Failure object
15:18 llfourn which will be false if used in Bool contextx
15:19 llfourn and not defined?
15:19 llfourn m: Failure.new.defined.say
15:19 camelia rakudo-moar 62d54c: OUTPUT: «False␤»
15:19 timotimo melezhik: what's wrong with the built-in ThreadPoolScheduler?
15:19 llfourn so with slurp("myfile") -> $content { ... } else { say "failed" } # should do it
15:19 melezhik nothing, I just have not known about it before )))
15:20 melezhik I will gladly use any proper module ...
15:20 llfourn timotimo: I think the task is to schedule processes not threads
15:20 melezhik yeah. it's processes
15:20 timotimo you can "start" little tasks that each spawn a process and wait for it to finish
15:20 hythm joined #perl6
15:21 melezhik an external programms
15:21 timotimo but not under 6.d.PREVIEW, where "await" will let the code immediately grab another of those tasks
15:21 timotimo anyway, doesn't Proc::Q handle what you need?
15:22 melezhik Proc::Q looks like gives me an abstaction I want ...
15:22 melezhik but I need to try it ...
15:22 iH2O why does this always output 'failed', whether myfile exists or not: my $f=slurp('myfile'); if ! $! { note 'failed'}
15:22 llfourn iH2O: $! is only set when you use "try"
15:23 iH2O im new to perl6, and i've not read the exceptions par yes
15:23 iH2O yet
15:23 iH2O *exceptions part yet
15:23 moritz if not defined $f { note "failed" }
15:23 moritz or just use $f as a string
15:23 moritz and if the slurp failed, the usage of the string will throw the exception
15:28 melezhik get an error when try to `zef install Proc::Q` - No compiler available for Perl v6.d.PREVIEW
15:31 llfourn melezhik: what's you perl6 -v
15:31 llfourn your*
15:31 melezhik implementing Perl 6.c.
15:31 llfourn This is Rakudo version 2017.06-13-g6b634a3 #<--- this bit
15:32 melezhik This is Rakudo version 2016.12-256-g62f7027 built on MoarVM version 2016.12-71-g331a6b4
15:33 llfourn that's quite old :)
15:33 melezhik yeah, I see
15:33 melezhik will try upgrade
15:34 llfourn that should do it. Not sure when v6.d.PREVIEW was introduced
15:35 DeadDelta joined #perl6
15:36 seatek joined #perl6
15:36 DeadDelta melezhik: oh, sorry, I totally forgot Proc::Q requires bleeding edge stuff, to avoid bugs. It needs 2017.06 or newer
15:37 wamba joined #perl6
15:37 melezhik ok
15:40 DeadDelta iH2O: IO stuff uses the Failure mechanism, so in general you don't need to do any failure handling. For example, your slurp would auto-fail due to Str type constraint, and without it, it'd fail when you try to stuff with it or sink it. But if you really want to handle it, you could use the `//` or `orelse` operators: my $x = "foo".IO.slurp orelse "Failed because {.exception.message}"; or my Str $x =
15:40 DeadDelta "foo".IO.slurp // "default str"
15:40 DeadDelta or // die "No slurps!"
15:40 DeadDelta huggable: Failure
15:40 huggable DeadDelta, Delayed exception: https://docs.perl6.org/type/Failure
15:40 iH2O thank you, i can use more solutions
15:42 DeadDelta orelse "... ... ".say I meant
15:42 DeadDelta Otherwise it's just a sunk string :)
15:46 melezhik DeadDelta: successfully installed Proc::Q for This is Rakudo version 2017.06-74-g62d54c7 built on MoarVM version 2017.06-13-g7405dfa
15:46 melezhik thanks
15:47 robertle_ joined #perl6
15:48 xtreak joined #perl6
15:49 araujo joined #perl6
15:49 araujo joined #perl6
15:51 Khisanth joined #perl6
15:51 DeadDelta melezhik: OK, but for the record you're using a minimally-tested, random dev commit. For all you know, it could have a bug that deletes all your files. Using releases is much saner.
15:52 melezhik sure, I see
15:52 melezhik I am just taking it for a spin
15:52 DeadDelta If you're building that with rakudobrew, just specify the latest release tag: `rakudobrew build moar 2017.06; rakudobrew switch moar-2017.06; rakudobrew build-zef`
15:53 DeadDelta With latest release tag visible when you run rakudobrew list-available (it's at the bottom, last dated tag)
15:56 alimon joined #perl6
15:58 melezhik switched to the stable version ( moar-2017.06 )
15:58 DeadDelta yey
15:59 DeadDelta huggable: release
15:59 huggable DeadDelta, nothing found
15:59 DeadDelta huggable: release :is: Don't use random dev commits! Build a release. With rakudobrew, run `rakudobrew list-available` to get latest release (it's at the bottom, last date-like tag). Then run, e.g. `rakudobrew build moar 2017.06; rakudobrew switch moar-2017.06; rakudobrew build-zef;`
15:59 huggable DeadDelta, Added release as Don't use random dev commits! Build a release. With rakudobrew, run `rakudobrew list-available` to get latest release (it's at the bottom, last date-like tag). Then run, e.g. `rakudobrew build moar 2017.06; rakudobrew switch moar-2017.06; rakudobrew build-zef;`
15:59 greppable6 joined #perl6
15:59 DeadDelta I'm abandoning my fight against rakudobrew. It's hopeless. Going to get people to use releases instead.
15:59 DeadDelta And to learn to install binaries right
15:59 greppable6 joined #perl6
16:00 DeadDelta huggable: rehash :is: When you built your Perl 6 with rakudobrew, you need to update the shims whenever you install stuff that includes binaries. Run `rakudobrew rehash` to do so.
16:00 huggable DeadDelta, Added rehash as When you built your Perl 6 with rakudobrew, you need to update the shims whenever you install stuff that includes binaries. Run `rakudobrew rehash` to do so.
16:01 wamba joined #perl6
16:08 setty1 joined #perl6
16:08 troys joined #perl6
16:12 Cabanossi joined #perl6
16:26 zapwai joined #perl6
16:26 cdg joined #perl6
16:27 cdg_ joined #perl6
16:42 Cabanossi joined #perl6
16:45 pmurias joined #perl6
16:46 nowan joined #perl6
16:47 greppable6 joined #perl6
17:06 |oLa| joined #perl6
17:11 domidumont joined #perl6
17:12 nullcone joined #perl6
17:21 zacts joined #perl6
17:30 dha joined #perl6
17:35 mr-foobar joined #perl6
17:49 wamba joined #perl6
17:57 Cabanossi joined #perl6
17:58 pilne joined #perl6
18:07 rouking joined #perl6
18:09 mr-foobar joined #perl6
18:09 rouking Hello guys
18:09 rouking What's the correct way to disable key buffering in perl 6? Same as the old way?
18:11 DeadDelta rouking: what's key buffereing?
18:12 DeadDelta Oh, like on terminal.
18:12 DeadDelta Yeah, should be the same, since the buffering is on the terminal
18:14 rouking with $|, right?
18:15 DeadDelta rouking: no, we currently (almost currently) don't do any buffering in Perl 6
18:15 DeadDelta rouking: what are you trying to do? Have a user press a key in terminal and immediatelly read it?
18:15 rouking Yes
18:16 DeadDelta Yeah, just disable buffering in your terminal.
18:16 rouking I'm calling .getc on $*STDIN
18:16 rouking or
18:16 rouking $*IN sorry
18:16 perlpilot rouking: FYI, $| is for *output* buffering, not input.
18:17 rouking Ahh
18:17 rouking right, it has been a while
18:17 DeadDelta In Perl 5, not Perl 6.
18:17 perlpilot yeah, in P5
18:19 perlpilot rouking: If you `perldoc -f getc` and translate the calls to system(), into P6, that should work the same :)
18:19 rouking What I'm doing rn is $*IN.getc
18:20 rouking which works correctly but only once I hit enter
18:20 perlpilot rouking: right, but that needs to be surrounded by some terminal twiddling
18:20 rouking yeah
18:20 rouking I'm wondering how to do the twiddling
18:20 perlpilot rouking: said twiddling is shown in `perldoc -f getc` for P5
18:20 rouking oh okay
18:21 rouking thanks
18:21 itaipu joined #perl6
18:23 rouking Hm. I wonder how I can query whether buffering is enabled or not?
18:23 rouking So I can restore it before control returns to the caller
18:24 DeadDelta rouking: probably. `man stty` lists -a option that lists all current settings
18:24 DeadDelta buggable: eco stty
18:24 buggable DeadDelta, Nothing found
18:24 DeadDelta Really could use a module for this stuff :)
18:24 geekosaur better is -g because it returns something you can invoke stty on to restore it
18:24 DeadDelta Ah, cool
18:25 skids https://rosettacode.org/wiki/Keyboard_input/Obtain_a_Y_or_N_response#Perl_6 https://rosettacode.org/wiki/Keyboard_input/Keypress_check  Second one needs Perl entries.  And if you figure out the restor-current-settings part, the first could use revision.
18:26 geekosaur my $tty = qx{stty -g}; ... system "stty $tty";
18:27 geekosaur er, tat's run not system.
18:27 geekosaur my $tty = qx{stty -g}; ... run "stty $tty";
18:28 DeadDelta run "stty", $tty
18:28 DeadDelta (or `shell`)
18:28 DeadDelta rouking: this works for me: my $save = my $tty = qx{stty -g}; run «stty -icanon eol "\001"»; while ($_ := $*IN.getc) !=== Nil { .say }; run "stty", $save;
18:28 rouking why run and not system?
18:29 DeadDelta Well, "works". CTRL+D seems to stop working
18:29 DeadDelta rouking: because there's no such thing as `system`
18:29 rouking heh
18:29 geekosaur because 'system' was p5-thhink leaking out
18:29 * zengargoyle really wishes a Grammar would only fire actions *after* the whole match has been filalized.  it seems a bit odd to have actions fire multiple times during a parse.
18:29 rouking oh did that change between 5/6
18:29 rouking Righto
18:29 skids Note several perl6 shell-out constructs dont wait for the thing to finish before returning control flow, unless  you ask.
18:29 rouking I may make a nice library for terminal fiddlign then
18:29 DeadDelta rouking: yes, now `run` is the multi-arg `system` and `shell` is the one-arg system
18:30 geekosaur p6 is trying to be less "thin wrapper over Unixy C APIs"
18:30 rouking rn I am just working on some general cli user-interfacing utilities
18:31 DeadDelta zengargoyle: they fire right when the token finished parsing. It's be odd to haul the entire tree all the way to the end to run something :D
18:31 rouking Considered naming it clitools, but the first four letters are a bit questionable :)
18:31 DeadDelta But you can: just stuff codeblocks into, say,  @!queue, and run them all in method TOP { ... }  :)
18:31 rouking went with UITools instead
18:33 DeadDelta .oO( cliweapons )
18:33 DeadDelta .oO( clutils [CLI Utils] )
18:33 perlpilot DeadDelta++ that one is nice.
18:34 mr-foobar joined #perl6
18:34 zengargoyle i think my brain works the other way. :P  it's a shame to build heavy objects that might get destroyed and rebuilt multiple times before it's all over.  i'm guessing lots of class state and a final "do it all in TOP" or something.
18:35 perlpilot zengargoyle: firing all of the actions at once at the end of a parse makes it harder to use the actions to exchange information that may affect the parse :)
18:36 DeadDelta More importantly: harder to make them reusable/pluggable/extendible
18:36 devmikey joined #perl6
18:37 DeadDelta perl6-debugger just mixes its grammar into the main Perl 6 grammar. It doesn't have to know about "do it all in TOP" machinery to do its thing
18:37 AlexDaniel and after all, you can traverse the parse tree anyway if you wish?
18:38 DeadDelta zengargoyle: also why is it creating heavy objects that might get destroyed in the first place? Don't let it successfully parse in such cases
18:38 zengargoyle i think it's probably the ws thing and longest match that's getting me.  too many of my actions can fire multiple times and are not idempotent....
18:39 DeadDelta m: grammar { token TOP { "A" <?{ rand > ½ }> } }.parse: 'A', actions => class { method TOP ($) { say "parsed!" } }
18:39 camelia rakudo-moar 823011: OUTPUT: «parsed!␤»
18:39 DeadDelta m: grammar { token TOP { "A" <?{ rand > ½ }> } }.parse: 'A', actions => class { method TOP ($) { say "parsed!" } }
18:39 camelia rakudo-moar 823011: ( no output )
18:39 DeadDelta Sprinkle in some dynamic vars and you can do things
18:39 zengargoyle my <date> has 14 variations....
18:40 DeadDelta zengargoyle: token quote has a bagillion variations :)
18:40 perlpilot zengargoyle: where is your grammar?
18:40 DeadDelta perlpilot: https://github.com/zengargoyle/p6-Time-Spec-at
18:40 rouking Aha, it is working now. Thanks everyone
18:41 perlpilot danke
18:41 iH2O why does this fail, how can I pass an empty array:
18:41 zengargoyle perlpilot: yeah, there, not sure if i've pushed since adding some proto's in though....
18:41 iH2O m: sub f(Int @i){}; f([])
18:41 camelia rakudo-moar 823011: OUTPUT: «Type check failed in binding to parameter '@i'; expected Positional[Int] but got Array ($[])␤  in sub f at <tmp> line 1␤  in block <unit> at <tmp> line 1␤␤»
18:41 DeadDelta https://github.com/rakudo/rakudo/blob/nom/src/Perl6/Grammar.nqp#L3672-L3696
18:41 DeadDelta iH2O: because you asked for a parametarized array, and passing one that isn't
18:41 DeadDelta m: sub f(Int @i){}; f(Array[Int].new)
18:41 camelia rakudo-moar 823011: ( no output )
18:41 DeadDelta m: sub f(@i where .all ~~ Int){}; f([])
18:42 camelia rakudo-moar 823011: ( no output )
18:42 iH2O oh. good
18:42 DeadDelta m: sub f(@i where .all ~~ Int){}; f([42])
18:42 camelia rakudo-moar 823011: ( no output )
18:42 DeadDelta m: sub f(@i where .all ~~ Int){}; f([])
18:42 camelia rakudo-moar 823011: ( no output )
18:42 DeadDelta m: sub f(@i where .all ~~ Int){}; f(["foo"])
18:42 camelia rakudo-moar 823011: OUTPUT: «Constraint type check failed in binding to parameter '@i'; expected anonymous constraint to be met but got Array ($["foo"])␤  in sub f at <tmp> line 1␤  in block <unit> at <tmp> line 1␤␤»
18:44 DeadDelta Sorry for spam :)
18:44 zengargoyle perlpilot: just pushed to branch 'planc' -- i'm totally going at this in a haphazard way.
18:44 zengargoyle to some extent, playing is more fun than reading docs and thinking. :P
18:44 DeadDelta iH2O: I meant to say (before I got distracted): Int @a means an Array parameterized with Int. Whereas @a where .all ~~ Int means any Array that contains only Int objects
18:45 DeadDelta zengargoyle: you could make your own compiler! Practice with that :)
18:45 perlpilot zengargoyle: yeah, as long as you don't confuse yourself playing :)
18:46 Juerd Hm, I would have expected you could do "@i of Int" there
18:46 zengargoyle and i'm sorta purposly sorta going from the lex and yacc specs and tweaking along the way....
18:46 DeadDelta Juerd: you can.
18:47 DeadDelta zengargoyle: here Day 1 course. Good for grammar stuff: http://edumentab.github.io/rakudo-and-nqp-internals-course/
18:47 Juerd DeadDelta: Not on my box...
18:47 perlpilot m: sub foo(@a of Int) { }
18:47 camelia rakudo-moar 823011: OUTPUT: «5===SORRY!5=== Error while compiling <tmp>␤Cannot resolve caller trait_mod:<of>(Parameter, Int); none of these signatures match:␤    (Mu:U $target, Mu:U $type)␤    (Routine:D $target, Mu:U $type)␤at <tmp>:1␤»
18:47 DeadDelta Ah
18:47 zengargoyle so there's still some crazy "that's how they defined the grammar" things that are less than optimal....
18:47 DeadDelta m: my @i of Int; dd @i
18:47 camelia rakudo-moar 823011: OUTPUT: «Array[Int] @i = Array[Int].new()␤»
18:48 DeadDelta s: &trait_mod<of>
18:49 DeadDelta huh. there's a `is hidden-from-USAGE` trait :)
18:50 AlexDaniel m: sub foo(Int @a) { } # ?
18:50 camelia rakudo-moar 823011: ( no output )
18:50 zengargoyle DeadDelta: pretty sure i read that at some point in the past. nqp scares me. :)
18:50 Juerd AlexDaniel: Valid but doesn't do what most people would probably want it to
18:50 espadrine joined #perl6
18:50 AlexDaniel yup
18:50 perlpilot zengargoyle: don't let it!  That course should make it less so
18:50 DeadDelta Juerd: I would guess it's just an oversight. The variable case is handled by Mu:U, Mu:U candidate, I'm guessing and the parameter one is receiving Parameter:D
18:50 zengargoyle i once wrote the $*data part of the POD6 spec but couldn't figure out how to get it working in the SETTING or whatnot.
18:50 Juerd AlexDaniel: And the thing everyone's looking for doesn't have nice error messages :|
18:51 DeadDelta zengargoyle: funny, I like it more than normal Perl 6 now. It's so neat and structured. Set 2-spec indent in your editor and it's just so, pleasant-looking
18:52 zengargoyle too much boxing/unboxing weird NQP things just trying to bind a hash to a $*global-thingy.
18:52 Juerd For that matter, deparsing simple anonymous constraints would be nice. I wonder if simple deparsing exists yet.
18:52 DeadDelta Juerd: which thing that is about?
18:52 Juerd DeadDelta: where .all ~~ Int results in error messages referring to an anonymous constraint, as opposed to something awesome about integers.
18:52 DeadDelta Ah
18:53 DeadDelta Juerd: well, there's Subset::Helper for that
18:53 DeadDelta Juerd: the other side of that coin is error messages leaking sensitive info. Which I believe we now shrugged off and done anyone in some error message or warning
18:54 TEttinger joined #perl6
18:54 Juerd DeadDelta: All error messages may leak sensitive info.
18:54 DeadDelta Not all
18:54 Juerd DeadDelta: Many
18:55 rouking Hm
18:55 DeadDelta Juerd: like what?
18:55 Juerd DeadDelta: For example, which methods exist
18:55 DeadDelta Juerd: that's not at all what I'm talking about
18:55 rouking Is there any way to restore stty options in the same format as they are given in stty -g?
18:56 Juerd DeadDelta: What were you referring to then?
18:56 DeadDelta m: my $credit-card where /\d+\-\d+/ = "444444444"
18:56 camelia rakudo-moar 823011: OUTPUT: «Type check failed in assignment to $credit-card; expected <anon> but got Str ("444444444")␤  in block <unit> at <tmp> line 1␤␤»
18:56 DeadDelta ^ having actual credit card number spammed in some world-accessible error log for example
18:56 Juerd DeadDelta: Well, looks like the sensitive data is already in the error message, while the useful data (the regex) is not :)
18:56 DeadDelta rouking: my last code example had that.
18:57 DeadDelta rouking: my $save = qx/stty -g/; ... do your stuff...;  run "stty", $save
18:57 rouking Doesn't work for me
18:57 Juerd DeadDelta: I have ideas about tainting data and lazy interpolation as a means for solving multiple security issues, but I don't have a clear mind, or the time, to write a proposal :(
18:57 DeadDelta Weird. No idea then
18:57 rouking stty just says its an invalid argument
18:58 DeadDelta rouking: what does $save contain? And does it work if you give that string to stty manually?
18:58 zengargoyle i think i need a way to explode a DateTime|Date objec into a hash or something so i can go back and forth and twiddle bits in some places and use DateTime|Date smarts in other places.
18:58 DeadDelta m: dd DateTime.now.Capture
18:58 camelia rakudo-moar 823011: OUTPUT: «\(:day(26), :daycount(57930), :formatter(Callable), :hour(20), :minute(58), :month(6), :second(33.6400952339172e0), :timezone(7200), :year(2017))␤»
18:58 DeadDelta m: dd DateTime.now.Capture.Hash
18:58 camelia rakudo-moar 823011: OUTPUT: «{:day(26), :daycount(57930), :formatter(Callable), :hour(20), :minute(58), :month(6), :second(37.600133895874e0), :timezone(7200), :year(2017)}␤»
18:59 zengargoyle it's hard when '+ 1 week' might fire multiple times during a parse.
18:59 geekosaur 'Invalid argument' might also mean the syscall is failing. I don't see that one much but if you are using Windows or Bash-on-Windows then you might see it
19:01 DeadDelta zengargoyle: FWIW, we have .later method you could call
19:01 DeadDelta m: DateTime.now.later(:week).say
19:01 camelia rakudo-moar 823011: OUTPUT: «2017-07-03T21:01:28.676745+02:00␤»
19:01 DeadDelta m: DateTime.now.later(:42weeks).say
19:01 camelia rakudo-moar 823011: OUTPUT: «2018-04-16T21:01:34.446391+02:00␤»
19:01 * DeadDelta &
19:05 zengargoyle and graar i have so not internalized creating lists or seq or items or pairs or hashes and turning them into names arguments to a funcion call. :/
19:07 setty1 joined #perl6
19:07 zengargoyle i sorta miss func(@args) or func(%opt) at the moment.
19:07 rba_ joined #perl6
19:08 espadrine joined #perl6
19:15 wamba joined #perl6
19:15 rba__ joined #perl6
19:15 DeadDelta Read up on Capture
19:15 DeadDelta huggable: Capture
19:15 huggable DeadDelta, Argument list suitable for passing to a Signature: https://docs.perl6.org/type/Capture
19:16 DeadDelta Make some classes with their own Captures. Play around, then it should click
19:17 DeadDelta m: class Foo { method Capture(--> Capture()) { <a b c>, :42foo } }; sub ($ (@, :$foo)) { dd "Foo is $foo" }(Foo.new)
19:17 camelia rakudo-moar 823011: OUTPUT: «"Foo is 42"␤»
19:20 DeadDelta I guess that's not really it. Never mind :)
19:23 DeadDelta I don't get why `my %h = :42a; -> :$a {}(|%h)` works when &prefix:<|> does x.Slip, but `my %h = :42a; -> :$a {}(%h.Slip)` doesn't
19:23 DeadDelta What's doing the magic?
19:23 geekosaur special case in the grammar, iirc
19:24 geekosaur %h.Slip is just an expression (and an escape hatch for when you wanted to pass a bunch of Pairs without them being turned into named params)
19:25 DeadDelta Seems to be just passed as a slip
19:25 DeadDelta m: my %h = :42a, :42b; -> $a, $b { dd $a }(%h.Slip)
19:25 camelia rakudo-moar 823011: OUTPUT: «Too few positionals passed; expected 2 arguments but got 1␤  in block <unit> at <tmp> line 1␤␤»
19:25 DeadDelta m: my %h = :42a, :42b; -> $a { dd $a }(%h.Slip)
19:25 camelia rakudo-moar 823011: OUTPUT: «Slip $a = $(slip(:a(42), :b(42)))␤»
19:26 iH2O left #perl6
19:34 jnthn DeadDelta: | inside of an argument list is handled specially by the compiler, where it means "flatten these things into the argument list"
19:34 jnthn In that case prefix:<|> isn't even called
19:35 jnthn In fact, it wasn't until the GLR that prefix:<|> outside of an arg list was given a meaning
19:35 DeadDelta Thanks. Yeah, I just spotted it: https://github.com/rakudo/rakudo/blob/nom/src/Perl6/Actions.nqp#L6195-L6208
19:36 DeadDelta m: use nqp; my %h = :42a, :42b; %h does role { method FLATTENABLE_HASH { nqp::hash } };  -> :$meow { dd [ $meow ] }(|%h)
19:36 camelia rakudo-moar 823011: OUTPUT: «[Mu]␤»
19:36 DeadDelta Cool. You can cheat the "unexpected argument passed" thing :)
19:37 DeadDelta m: use nqp; my %h = :42a, :42b; %h does role { method FLATTENABLE_HASH { my $h := nqp::hash; nqp::bindkey($h, "meow", 42); $h } };  -> :$meow { dd [ $meow ] }(|%h)
19:37 camelia rakudo-moar 823011: OUTPUT: «[42]␤»
19:37 DeadDelta \o/ I've beat the system
19:37 DeadDelta Actually, I can do one better...
19:38 * jnthn wonders if he needs to point out that this is decidedly in "implementation detail" territory :)
19:38 DeadDelta nah :)
19:40 DeadDelta m: use nqp; my %h = :42a, :42b; %h does role { method FLATTENABLE_HASH { nqp::hash }; method  FLATTENABLE_LIST { my $l := nqp::list; nqp::push($l, $_) for self; $l } };  -> $a, $b { dd [ $a, $b ] }(|%h)
19:40 camelia rakudo-moar 823011: OUTPUT: «[:a(42), :b(42)]␤»
19:40 DeadDelta haha :D a hash that slips in as positional pairs instead of named args :D
19:43 moritz what could possibly go wrong :-)
19:43 DeadDelta :)
19:45 [Coke] (2-space indent) you monster.
19:46 * lizmat starts on the P6W
19:46 timotimo i used 2-space indent for python code for a long long time
19:48 moritz .oO( long long time monster )
19:53 Alikzus joined #perl6
19:54 sufrostico joined #perl6
20:02 mr-foobar joined #perl6
20:13 cpage_ joined #perl6
20:13 [Coke] ... we need a t-shirt that has "size_t XL;" on it.
20:14 [Coke] (e.g.)
20:14 timotimo shirt_t?
20:16 bjz joined #perl6
20:27 bjz_ joined #perl6
20:27 zengargoyle heh... so i have 'my $x= $/<HYPHENDATE>.made; dd $x; make $x;' and 'my $x= $/<DOTTEDDATE>.made; dd $x; make $x;' -- both display "Hash $x = ${:day(1), :month(1), :year(2017)}" as expected....
20:28 zengargoyle the first: "
20:28 zengargoyle the first: "ok 2 - hyphendate 2017-01-01", the second: "Invalid Date string '01.01.2017'; use yyyy-mm-dd instead"
20:29 cpage_ joined #perl6
20:30 zengargoyle both hit: 'make DateTime.new: |$/<timespec>.made;'
20:33 DeadDelta sounds like in second case it's making the string, not the hash
20:33 bjz joined #perl6
20:34 DeadDelta And your assumption both display as Hash is incorrect. Something get crossed that by the time it gets to timespec it's not a hash
20:34 zengargoyle HYPHENDATE and DOTTEDDATE both make: make { year => +$/<year>, month => +$/<month>, day => +$/<day> }
20:34 mr-foobar joined #perl6
20:34 DeadDelta What's the link to code, again?
20:34 cpage_ joined #perl6
20:36 DeadDelta m: DateTime.new: %(:year)
20:36 camelia rakudo-moar 823011: OUTPUT: «Cannot resolve caller new(DateTime: Hash); none of these signatures match:␤    (DateTime $: \y, \mo, \d, \h, \mi, \s, :$timezone = 0, :&formatter, *%_)␤    (DateTime $: :$year!, :$month = 1, :$day = 1, :$hour = 0, :$minute = 0, :$second = 0, :$timezo…»
20:36 DeadDelta There's no DateTime.new candidate that takes a Hash
20:36 zengargoyle github.com:zengargoyle/p6-Time-Spec-at.git -- branch 'pland'
20:36 ufobat joined #perl6
20:37 DeadDelta I suspext in both cases it's still a string
20:38 timotimo fun data point: without spesh, the profiler can work
20:38 DeadDelta chatlogs are ded again
20:38 DeadDelta and can't copy-paste off weechat on my phone boooo
20:40 devmikey joined #perl6
20:40 DeadDelta ah you slipping the hash, never mind
20:41 zengargoyle DeadDelta: np, i seriously just tried to make HYPENDATE and DOTTEDDATE do a make { hash of year/month/day } and then just pass that up as directly as possible.
20:41 vendethiel joined #perl6
20:42 DeadDelta And that still has the problem?
20:42 zengargoyle and make a DateTime at the end.  one works, the other doesn't and seems to be a string....
20:43 zengargoyle hyphen works, dotted dies and has failure about 'Invalid Date string '01.01.2017'; use yyyy-mm-dd instead'  -- i have no clue where the string is coming from.....
20:45 zengargoyle and the 'dd' of the thing that gets 'make' in <date> is identical....
20:45 DeadDelta Nothing jumps out by reading the code. If you're still having this issue when I get home in ~20m, I'll clone and find it :)
20:46 DeadDelta Oh, there's Grammar::Tracer you could use to see what it's doing
20:46 DeadDelta buggable: Grammar::Debugger
20:46 DeadDelta buggable: eco Grammar::Debugger
20:46 buggable DeadDelta, Grammar::Debugger 'Simple tracing and debugging support for Perl 6 grammars': https://github.com/jnthn/grammar-debugger
20:46 Ven joined #perl6
20:46 DeadDelta ^included in that distro
20:47 zengargoyle DeadDelta++ i'll leave it alone, close to my & time.
20:47 DeadDelta k :)
20:47 * zengargoyle a dd/print debugger with a inotivy running tests at every write sort of person. :P
20:48 zengargoyle but man try the debugger's if they're working again.
20:52 DeadDelta perl6-debug-m works on like 20 commits past latest release. The grammar debuuger should work fine
20:53 timotimo i believe that at least the grammar tracer can change how regexes match or not
20:57 Ven_ joined #perl6
20:58 casdr joined #perl6
20:58 bjz_ joined #perl6
21:10 mcmillhj_ joined #perl6
21:10 dwarring joined #perl6
21:17 mcmillhj joined #perl6
21:17 andrzejku__ joined #perl6
21:18 DeadDelta hm, I'm guessing zef misteriouslyt stopping without error after "Filtering" stage is the proc issue
21:19 DeadDelta Same issue as that person who was having travis issues, except happened locally
21:19 DeadDelta re-running zef install Test::META worked
21:19 DeadDelta zengargoyle: you gonna hate yourself :D
21:20 DeadDelta .tell zengargoyle the issue isn't actually with your grammar/actions, but with the Date you're creating in the test. You need to use proper format on line 42: https://github.com/zengargoyle/p6-Time-Spec-at/blob/pland/t/04-action.t#L42
21:20 yoleaux DeadDelta: I'll pass your message to zengargoyle.
21:20 zengargoyle if i re-order the tests they fail in different ways.
21:20 yoleaux 21:20Z <DeadDelta> zengargoyle: the issue isn't actually with your grammar/actions, but with the Date you're creating in the test. You need to use proper format on line 42: https://github.com/zengargoyle/p6-Time-Spec-at/blob/pland/t/04-action.t#L42
21:23 DeadDelta None fail for me after i fix the Date.new() in the test
21:24 * DeadDelta depars to feat on a home-made T-bone steak
21:24 zengargoyle lol -- me hates myself.
21:34 mr-foobar joined #perl6
21:34 zengargoyle DeadDelta++ -- me crawls into bed at 14:31 and 36℃
21:35 cpage_ joined #perl6
22:06 avalenn joined #perl6
22:18 vendethiel- joined #perl6
22:18 mcmillhj joined #perl6
22:26 |oLa| joined #perl6
22:27 Cabanossi joined #perl6
22:34 mcmillhj joined #perl6
22:36 lizmat and another Perl 6 Weekly hits the Net: https://p6weekly.wordpress.com/2017/06/26/2017-26-half-way-there/
22:37 dogbert2 joined #perl6
22:46 bjz joined #perl6
22:47 DeadDelta lizmat++ good weekly
22:48 DeadDelta And wow, tons of blogs/videos by names I don't recognize.... Looks like P6 is growing
22:49 timotimo actually, not many of the videos seem to mention perl6 at all
22:49 lizmat well, some of them mention Perl 6 a bit
22:49 timotimo clearly i must travel to the next conference and have a talk of my own
22:50 DeadDelta timotimo++ yes, you should
22:50 mcmillhj joined #perl6
22:51 lizmat https://youtu.be/VbObDEH-jKY?t=1460   # Perl 6 part of Error handling across languages
22:51 timotimo ah, nice!
22:52 DeadDelta ouch... it mentions resume :}
22:52 DeadDelta I think that's gone now
22:52 DeadDelta m: say X::AdHoc.can: "resume"
22:52 camelia rakudo-moar 823011: OUTPUT: «(resume)␤»
22:53 DeadDelta m: say X::AdHoc.can: "resumable"
22:53 camelia rakudo-moar 823011: OUTPUT: «()␤»
22:53 DeadDelta mc: say X::AdHoc.can: "resumable"
22:53 committable6 DeadDelta, ¦2015.12: «(resumable)»
22:53 DeadDelta Ah, that's what's gone.
22:53 DeadDelta I wish Failures got more spotlight, but, hey. That was pretty good \o/
22:54 timotimo my opinion on Failure has flipped and flopped at least once in each direction
22:54 DeadDelta What does that mean?
22:54 timotimo i started out thinking they were cool, then i started thinking they're horrible, then i thought they were cool again
22:54 timotimo maybe i went back and forth another time?
22:55 DeadDelta Heh
22:55 DeadDelta I never thought they were "cool". I always though, "nice, I don't have to type freakin' `try` all over the damn place"
22:55 DeadDelta I think people who winge about Failures expect them to be more magical than they really are.
22:56 DeadDelta They're just exceptions you can handle with conditionals. No more.
22:56 timotimo mhm
22:56 DeadDelta well, slightly more in that they don't explode right away; only when you touch them
22:56 timotimo is brock wilcox actually on the irc sometimes/rightnow?
22:57 timotimo oh that's awwaiid
22:58 DeadDelta \o
22:58 DeadDelta left #perl6
22:58 timotimo aha, the thing i wanted to point out was just then answered in the video, too
22:58 kyan joined #perl6
22:59 lizmat good night, #perl6!
23:00 timotimo awwaiid: in the slide on "operators as methods" you have to put an & in front of the infix, prefix, postfix words
23:00 timotimo but the .:<++> syntax was new to me. neat.
23:00 timotimo also, here's an ugly internal error:
23:00 timotimo m: say 10.&:<++>
23:00 camelia rakudo-moar 823011: OUTPUT: «===SORRY!===␤This type (QAST::WVal) does not support positional operations␤»
23:02 timotimo that was a fun little talk
23:02 timotimo i would have loved for it to be 10 minutes instead of 5 so there would have been a few more words on the later slides
23:02 timotimo (i also tend to put too many slides into my presentations)
23:03 mr-foobar joined #perl6
23:06 mcmillhj joined #perl6
23:20 TEttinger joined #perl6
23:26 mcmillhj joined #perl6
23:28 cdg joined #perl6
23:36 mr-foobar joined #perl6
23:37 awwaiid joined #perl6
23:42 skids joined #perl6
23:44 mcmillhj joined #perl6
23:48 awwaiid joined #perl6
23:53 awwaiid joined #perl6
23:57 Cabanossi joined #perl6

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

Perl 6 | Reference Documentation | Rakudo