»ö« Welcome to Perl 6! | perl6.org/ | evalbot usage: 'p6: say 3;' or rakudo:, or /msg camelia p6: ... | irclog: irc.perl6.org or colabti.org/irclogger/irclogger_logs/perl6 | UTF-8 is our friend!
Set by moritz on 22 December 2015.
travis-ci Doc build errored. Will "Coke" Coleda 'Don't emit {}'s around type name 00:16
travis-ci.org/perl6/doc/builds/246910657 github.com/perl6/doc/compare/01a7c...c07f1575dc
travis-ci Doc build errored. Will "Coke" Coleda 'test examples, part of #1387' 00:24
travis-ci.org/perl6/doc/builds/246912082 github.com/perl6/doc/compare/fcc07...53fea13055
travis-ci Doc build passed. Will "Coke" Coleda 'test examples, part of #1387' 00:29
travis-ci.org/perl6/doc/builds/246913089 github.com/perl6/doc/compare/ec53f...c904656500
lookatme morning 00:48
[Coke] hio 00:57
samcv hey [Coke] 01:00
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:01
so each element of $a had each element of $b added to it 01:02
m: my $a = $[[11673, 32, 2], [11697, 32, 2]]; my $b = $[0, 0]; say $a Z $b
camelia (([[11673 32 2] [11697 32 2]] [0 0]))
samcv this at least didn't work
is there a builtin that can do this for me? 01:03
MasterDuke m: my @a = (11673, 32, 2), (11697, 32, 2); my @b = (0, 0); say (@a Z @b).map(*.flat) 01:07
camelia (((11673 32 2) 0) ((11697 32 2) 0))
MasterDuke m: my @a = (11673, 32, 1), (11697, 32, 2); my @b = (8,9); say @a.map({|$_, @b[$++]}) 01:23
camelia ((11673 32 1 8) (11697 32 2 9))
samcv cool. thanks 01:30
not bad
BenGoldberg m: my $foo = "abc"; role Foo { has $.z = 42 }; $foo does Foo; use nqp; dd nqp::bindattr( $foo, Foo, '$!z', 42 ); 01:44
camelia P6opaque: no such attribute '$!z' in type Foo when trying to bind a value
in block <unit> at <tmp> line 1
BenGoldberg wonders what he's doing wrong.
m: my $foo = "abc"; role Foo { has $.z = 42 }; $foo does Foo; use nqp; dd nqp::getattr( $foo, Foo, '$!z' );
camelia P6opaque: no such attribute '$!z' in type Foo when trying to get a value
in block <unit> at <tmp> line 1
perigrin m: my $foo = "abc"; role Foo { has $!z = 42 }; $foo does Foo; use npq; dd nqp::getattr( $foo, Foo, '$!z' ); 01:46
camelia ===SORRY!===
Could not find npq at line 1 in:
/home/camelia/.perl6
/home/camelia/rakudo-m-inst-1/share/perl6/site
/home/camelia/rakudo-m-inst-1/share/perl6/vendor
/home/camelia/rakudo-m-inst-1/share/perl6
CompUnit::Reposit
perigrin m: my $foo = "abc"; role Foo { has $!z = 42 }; $foo does Foo; use nqp; dd nqp::getattr( $foo, Foo, '$!z' );
camelia P6opaque: no such attribute '$!z' in type Foo when trying to get a value
in block <unit> at <tmp> line 1
perigrin needs to mind his p's and q's
BenGoldberg Not Perlishly Q? 01:47
perigrin Not Perigrin's Question
BenGoldberg To have questions is human. To have only perfect questions would be divine. ;) 01:50
perigrin divinity is more about having perfect answers I thought 01:51
well *being* perfect answers
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:54
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:56
MasterDuke the last question: "can entropy be reversed?" - multivax.com/last_question.html 01:58
[Coke] -1 on the theology. 02:02
BenGoldberg Anyway, does anyone know why my nqp:: thingy above didn't work? 02:09
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:13
TEttinger God does a pretty good interpretation of a random number generator 02:15
alternately, impression
Geth doc: 2c823b0e80 | (Will "Coke" Coleda)++ | 2 files
test examples, part of #1387
02:19
doc: 553bdad0aa | (Will "Coke" Coleda)++ | doc/Language/exceptions.pod6
Change "try blocks" heading to just "try"

Add note about try with a statement.
Closed #1284
[Coke] \o/ I can finally install npm packages on this machine, which means I can build the docs again. 02:28
... except that somehow I still get the error about self signed certs when doc tries to install a package. :P 02:34
[Coke] .tell samcv node-gyp is borked: github.com/nodejs/node-gyp/issues/...-310951976 02:53
yoleaux [Coke]: I'll pass your message to samcv.
[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:55
travis-ci Doc build errored. Will "Coke" Coleda 'Change "try blocks" heading to just "try" 03:09
travis-ci.org/perl6/doc/builds/246937231 github.com/perl6/doc/compare/29c90...3bdad0aa51
samcv eek [Coke] 05:00
so. this messes up the highlighter i'm guessing?
moritz PSA: I'm currently updating the IRC log server (jessie -> stretch). Loss of availabilty or logging is possible. 07:42
tyil lizmat (or anyone else dealing with the amsterdam p6 conf): unlimited is spelled wrong on the site 07:43
andrzejku hi people :) 08:05
parv hola
andrzejku are here C++ developers? 08:07
parv don't look at me 08:10
zengargoyle skipped learning C++ back when C++ was just a pre-processor that turned 'C++' into plain 'C' code before comiling. 08:37
parv Whhattt? ;-O 08:44
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:18
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:22
parv how does C pre processor fit with cfont history? 09:25
xiaomiao parv: independent 09:26
parv hmm. ok.
xiaomiao CPP was a part of early C, cfront came a lot later
samcv [Coke], so does this affect the highlighter? i'm not sure if highlights depends on node-gyp 10:09
DeadDelta Jesus. A guy dug up my legal name from a TPF document from March and used it to list an article I wrote... As opposed to just using the name on the article, which appears like 3 times. 11:17
Maybe I'm in witness protection program. Go play Colombo elsewhere. ugh 11:18
lizmat DeadDelta: fwiw, I try to use real names in P6W unless I know the authors are really against it 11:25
I know you are very much against it
timotimo quite 11:27
DeadDelta The one time you used my "real" name on PW6 it wasn't even my real name. The only place it appears on is the TPF post and an old book I wrote. It'd take some effort to find it. For once, I wish people were lazier 11:30
DeadDelta doesn't understand why humans are so obsessed with identifying other humans. :/ 11:31
Need to invent decentralized identities driven by blockchain :) 11:32
jast sounds like something the PGP web of trust could deal with 11:35
zengargoyle giggles... is on the p6 contributer list twice from an accidental git commit from $WORK machine. 11:37
timotimo is that something keybase is trying to do? 11:39
zengargoyle doesn't really care beyond $WORK email is no longer a thing.
DeadDelta dunno, but the first thing it does when I visit its site is try to have me install an app or register online without a shred of info on wtf it is :) 11:41
jast I think keybase is a de-decentralized web of trust 11:42
DeadDelta with "HEY. GET A JOB!" at the bottom lol
Dunno how keybase would make it possible to commit to github 11:43
Well. I mean that'd be one of my goals. To commit anonymously. 11:44
jast well, there *is* some kind of signature chaining to maybe validate all of the changes. but no, I don't think you're going to get any github-ness out of it...
zengargoyle it just takes to much work and tooling and is such a PITA to do. you could publish a ssh public key signed with a PGP that's trusted by whatever chain of authority. then that ssh key could be added based on the fact that there's a PGP signed version that is trusted. and you could submit TFP grant requests just by signing with that trusted PGP, but somebody somewhere still has to know where to send 11:51
the check. 11:52
we sorta did this with eduroam and shibboleth for wireless access across .edu realms. sure, somebody somewhere could look up your 'username' but by and large the 3rd parties have no idea who you are. 11:54
[Coke] samcv: yes, 'make init-highlights' dies with the gyp error. I'm trying to see if I can find a solution.
samcv ugh 11:55
thank you
[Coke] ... dammit. someone very kindly commented on the ticket about an env var, which I *swear* I used yesterday; re-tried it today, works fine. 12:08
[Coke] perl6 htmlify.p6 --parallel=1 -> segv 12:20
2017.06-45-g86e7b2bd2
samcv: so, to be clear, the node-gyp stuff is resolved now, sorry for the scare. 12:22
samcv cool. you going to add that ENV to the makefile?
[Coke] no, it's for my config only 12:23
I only need it to interact with corporate certs.
samcv ah ok
i think we should make the doc build not build highlights so it will actually finish 12:24
well i tried to enable caching and it probably helped. but still it's not completing
zengargoyle so... i have this: say so Time::Spec::at::Grammar::At.parse( "1969-12-08"); --> True 12:27
zengargoyle and this: say so Time::Spec::at::Grammar::At.parse( "1969-12-08", actions => Time::Spec::at::Actions::AtActions.new(:$now) ); --> *fails* Too many positionals passed; expected 1 argument but got 2 12:28
but the test before is: $match = Time::Spec::at::Grammar::At.parse( "teatime", actions => Time::Spec::at::Actions::AtActions.new(:$now) ).made; --> *works fine* 12:29
because actions doesn't have a 'date' method devined yet. :) 12:31
zengargoyle somehow AtActions::date (missing) is getting passed on to the 'date' function??? 12:32
seems like matching a 'rule date {}' in a grammar when parsed with AtAction should only try to be finding AtAction::date and failing (or skipping since no defined action) but instead is hitting some other 'date' definition and croaking. 12:35
zengargoyle if i put a 'method date ($/) {}' in AtActions, it doesn't croak. (it doesn't work yet, but it doesn't croak). 12:37
DeadDelta zengargoyle: your Actions class is Any and is Mu, so it'd get all of their methods; though I don't recall having a "date" method in it
m: say class {}.^methods(:all)».name.grep(/:i date/)
camelia ()
DeadDelta Perhaps, it's inheriting from something else? 12:38
zengargoyle gist.github.com/1c63e3e91d19920da5...69cbab2d9a
DeadDelta: eell, no explicit inheritance. Grammar is just a bare grammar and AtActions is just a bare clase with no fancy inheritance. 12:40
DeadDelta zengargoyle: prove it 12:41
zengargoyle class AtActions { 12:42
where am i inheriging a 'date' method that Grammar.parse would find?
DeadDelta Dunno, I haven't seen your code. 12:43
zengargoyle the 'rule date {}' in grammar should try an AtAction::date and nothing else.
DeadDelta heh 12:44
zengargoyle github.com:zengargoyle/p6-Time-Spec-at.git -- date-bork branch 12:50
DeadDelta zengargoyle: you have an attribute called date: "has Date $.date is rw = Date.new( $!now );" 12:50
And without a defined method it's trying to call the default accessor 12:51
zengargoyle oh frak.
DeadDelta :)
zengargoyle and i even haven't used it yet. ....
DeadDelta++ for me being stupid
reino4477 hey, can I use an alias when I'm "use LongModuleName "? 13:46
reino4477 something like "use LongModuleName as name1"? 13:47
jnthn The typical way is just to constant name1 = LongModuleName;
melezhik HI. How can I run parallel proccesses in Perl6 and handle the exit code of the processes launched ? 13:48
reino4477 use LongModuleName;
name1 = LongModuleName;
like this? 13:49
llfourn melezhik: checkout Proc::Async
melezhik llfourn: thanks 13:50
DeadDelta reino4477: constant name1 = LongModuleName
huggable: Proc::Async
huggable DeadDelta, Running process (asynchronous interface): docs.perl6.org/type/Proc::Async
reino4477 DeadDelta: and what did I say?
DeadDelta buggable: eco Proc::Q 13:51
buggable DeadDelta, Proc::Q 'Queue up and run a herd of Procs': github.com/zoffixznet/perl6-Proc-Q
DeadDelta reino4477: you didn't have `constant`
reino4477 ahhh
DeadDelta Another satisfied customer! 13:52
NEXT!
melezhik Also I need to create simple daemonized programm, any sugesstions? 13:57
DeadDelta Unsure 14:03
buggable: eco UNIX::Daemonize
buggable DeadDelta, UNIX::Daemonize 'configurable daemonizing tool written in Perl 6': github.com/hipek8/p6-UNIX-Daemonize 14:04
Ven Hi
DeadDelta Maybe give that a spin? ^
DeadDelta Hi 14:04
Ven`` .ask moritz It seems perlgeek.de is down, just in case you didn't get a thousand reports about it before :) 14:06
yoleaux Ven``: I'll pass your message to moritz.
DeadDelta Ven``: it's being upgraded to new debian 14:07
zengargoyle hrm, i'm thinking i need more class state in my Actions, too many things are mutations which can be hit multiple times during the parse. 14:15
it's no good when TOMORROW gets hit twice. :P 14:18
[Coke] [doc segv] updated to nom-HEAD avoided that segv. 14:20
zengargoyle is there an easy way to tell which alternation in a rule was the one that matched?
zengargoyle guesses something like $<this>=[...] | $<that>=[...] and looking for this/that... tomorrow's quest i guess. 14:22
DeadDelta zengargoyle: you could use proto regexes 14:25
docs.perl6.org/language/grammars#Protoregexes 14:26
melezhik buggable: thanks for infromation 14:53
zengargoyle DeadDelta: i'll read up on that. i *think* the examples i saw always used <sym> in the body to match the same string as the definition, i guess maybe the body of the regex doesn't have to be <sym>... 14:56
DeadDelta zengargoyle: no, <sym> is just a convenience
zengargoyle i guess i'll go and read the many docs i have available and start a 'planC' branch :) 14:57
most of the doc pages on Grammar stuff mostly use <sym> in the examples... i guess it's the most common case. 14:58
zengargoyle i haven't looks at the synpses in a while. 14:58
DeadDelta That's just to show that you can use it 14:59
m: grammar { proto token TOP {*}; token TOP:sym<foo> { A }; token TOP:sym<bar> { B } }.parse: actions => class { method TOP:sym<foo> ($) { say "tis an A!" }; method TOP:sym<bar> ($) { say "tis a B!" } }, "A"
camelia tis an A!
DeadDelta m: grammar { proto token TOP {*}; token TOP:sym<foo> { A }; token TOP:sym<bar> { B } }.parse: actions => class { method TOP:sym<foo> ($) { say "tis an A!" }; method TOP:sym<bar> ($) { say "tis a B!" } }, "B"
camelia tis a B!
DeadDelta It doesn't care what you're matching inside
zengargoyle yeah, cool. :) maybe git history of my attempt will provide amusement. 15:00
zengargoyle there's a bunch of re-doing things when starting from just copy-paste of lex and yacc specs still to be donw. 15:00
zengargoyle figures by the time it works i'll know something. 15:02
zengargoyle i'll probably go back and branch from 'the grammar parses' and factor things down a bit. 15:03
melezhik I need an example. Say I have a bunch of processes which are independed and which I run asynchronosuly , in parallel . so the main program is endless cycle to run such a processes while (True) { my $p = Proc::Async.new(...) }; so the question is where should I handle processes wait? 15:04
zengargoyle luckily i have quite a few tests to keep working.
moritz melezhik: do you even have to manually wait for processes? 15:06
yoleaux 14:06Z <Ven``> moritz: It seems perlgeek.de is down, just in case you didn't get a thousand reports about it before :)
moritz I kinda expect rakudo to do it for you
llfourn melezhik: I think you .start the Proc::Asyncs, which returns a promise and await them when you're ready 15:07
DeadDelta melezhik: are you restarting the processes or what? I'm not following where the while(True) bit comes in 15:07
melezhik I mean the best sceantio is I don't anything extra. However I am reading this - docs.perl6.org/type/Proc::Async and it have an example with - my $promise = $proc.start; and then await $promise; 15:08
ugexe $promise.then({ $next thing }) 15:09
melezhik no I just to run the processes and somehow to know theirs exit code
that is it
DeadDelta melezhik: have you looked at Proc::Q?
llfourn so just start them and await a list of their promises
ugexe so await Promises.allof(@promises)
DeadDelta Man, too many cooks.
llfourn ugexe: is allof different to awaiting an array of promises? 15:10
melezhik this one - github.com/zoffixznet/perl6-Proc-Q probably seems closer to what I need, will read it deeply, thanks
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
so all that fancy config for eth0 is for naught
... when the thing is now called ens32 or so 15:12
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
llfourn: While await @promises will give you the errors
llfourn jnthn: ah k thanks 15:14
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')
llfourn iH2O: if it fails slurp will return a Failure object 15:17
which will be false if used in Bool contextx 15:18
and not defined?
m: Failure.new.defined.say 15:19
camelia False
timotimo melezhik: what's wrong with the built-in ThreadPoolScheduler?
llfourn so with slurp("myfile") -> $content { ... } else { say "failed" } # should do it
melezhik nothing, I just have not known about it before )))
I will gladly use any proper module ... 15:20
llfourn timotimo: I think the task is to schedule processes not threads
melezhik yeah. it's processes
timotimo you can "start" little tasks that each spawn a process and wait for it to finish
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
anyway, doesn't Proc::Q handle what you need?
melezhik Proc::Q looks like gives me an abstaction I want ... 15:22
but I need to try it ...
iH2O why does this always output 'failed', whether myfile exists or not: my $f=slurp('myfile'); if ! $! { note 'failed'}
llfourn iH2O: $! is only set when you use "try"
iH2O im new to perl6, and i've not read the exceptions par yes 15:23
yet
*exceptions part yet
moritz if not defined $f { note "failed" }
or just use $f as a string
and if the slurp failed, the usage of the string will throw the exception
melezhik get an error when try to `zef install Proc::Q` - No compiler available for Perl v6.d.PREVIEW 15:28
llfourn melezhik: what's you perl6 -v 15:31
your*
melezhik implementing Perl 6.c.
llfourn This is Rakudo version 2017.06-13-g6b634a3 #<--- this bit
melezhik This is Rakudo version 2016.12-256-g62f7027 built on MoarVM version 2016.12-71-g331a6b4 15:32
llfourn that's quite old :) 15:33
melezhik yeah, I see
will try upgrade
llfourn that should do it. Not sure when v6.d.PREVIEW was introduced 15:34
DeadDelta melezhik: oh, sorry, I totally forgot Proc::Q requires bleeding edge stuff, to avoid bugs. It needs 2017.06 or newer 15:36
melezhik ok 15:37
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
"foo".IO.slurp // "default str"
or // die "No slurps!"
huggable: Failure
huggable DeadDelta, Delayed exception: docs.perl6.org/type/Failure
iH2O thank you, i can use more solutions
DeadDelta orelse "... ... ".say I meant 15:42
Otherwise it's just a sunk string :)
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
thanks
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:51
melezhik sure, I see 15:52
I am just taking it for a spin
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`
With latest release tag visible when you run rakudobrew list-available (it's at the bottom, last dated tag) 15:53
melezhik switched to the stable version ( moar-2017.06 ) 15:58
DeadDelta yey
huggable: release
huggable DeadDelta, nothing found
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;`
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;`
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
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.
rouking Hello guys 18:09
What's the correct way to disable key buffering in perl 6? Same as the old way?
DeadDelta rouking: what's key buffereing? 18:11
Oh, like on terminal. 18:12
Yeah, should be the same, since the buffering is on the terminal
rouking with $|, right? 18:14
DeadDelta rouking: no, we currently (almost currently) don't do any buffering in Perl 6 18:15
rouking: what are you trying to do? Have a user press a key in terminal and immediatelly read it?
rouking Yes
DeadDelta Yeah, just disable buffering in your terminal. 18:16
rouking I'm calling .getc on $*STDIN
or
$*IN sorry
perlpilot rouking: FYI, $| is for *output* buffering, not input.
rouking Ahh 18:17
right, it has been a while
DeadDelta In Perl 5, not Perl 6.
perlpilot yeah, in P5
rouking: If you `perldoc -f getc` and translate the calls to system(), into P6, that should work the same :) 18:18
rouking What I'm doing rn is $*IN.getc 18:19
which works correctly but only once I hit enter 18:20
perlpilot rouking: right, but that needs to be surrounded by some terminal twiddling
rouking yeah
I'm wondering how to do the twiddling
perlpilot rouking: said twiddling is shown in `perldoc -f getc` for P5
rouking oh okay
thanks 18:21
rouking Hm. I wonder how I can query whether buffering is enabled or not? 18:23
So I can restore it before control returns to the caller
DeadDelta rouking: probably. `man stty` lists -a option that lists all current settings 18:24
buggable: eco stty
buggable DeadDelta, Nothing found
DeadDelta Really could use a module for this stuff :)
geekosaur better is -g because it returns something you can invoke stty on to restore it
DeadDelta Ah, cool
skids rosettacode.org/wiki/Keyboard_inpu...nse#Perl_6 rosettacode.org/wiki/Keyboard_inpu...ress_check Second one needs Perl entries. And if you figure out the restor-current-settings part, the first could use revision. 18:25
geekosaur my $tty = qx{stty -g}; ... system "stty $tty"; 18:26
er, tat's run not system. 18:27
my $tty = qx{stty -g}; ... run "stty $tty";
DeadDelta run "stty", $tty 18:28
(or `shell`)
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;
rouking why run and not system?
DeadDelta Well, "works". CTRL+D seems to stop working
rouking: because there's no such thing as `system` 18:29
rouking heh
geekosaur because 'system' was p5-thhink leaking out
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.
rouking oh did that change between 5/6
Righto
skids Note several perl6 shell-out constructs dont wait for the thing to finish before returning control flow, unless you ask.
rouking I may make a nice library for terminal fiddlign then
DeadDelta rouking: yes, now `run` is the multi-arg `system` and `shell` is the one-arg system
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:30
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 :)
DeadDelta But you can: just stuff codeblocks into, say, @!queue, and run them all in method TOP { ... } :)
rouking went with UITools instead
DeadDelta
.oO( cliweapons )
18:32
.oO( clutils [CLI Utils] )
18:33
perlpilot DeadDelta++ that one is nice.
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:34
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:35
DeadDelta More importantly: harder to make them reusable/pluggable/extendible 18:36
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?
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....
DeadDelta m: grammar { token TOP { "A" <?{ rand > ½ }> } }.parse: 'A', actions => class { method TOP ($) { say "parsed!" } } 18:39
camelia parsed!
DeadDelta m: grammar { token TOP { "A" <?{ rand > ½ }> } }.parse: 'A', actions => class { method TOP ($) { say "parsed!" } }
camelia ( no output )
DeadDelta Sprinkle in some dynamic vars and you can do things
zengargoyle my <date> has 14 variations....
DeadDelta zengargoyle: token quote has a bagillion variations :) 18:40
perlpilot zengargoyle: where is your grammar?
DeadDelta perlpilot: github.com/zengargoyle/p6-Time-Spec-at
rouking Aha, it is working now. Thanks everyone
perlpilot danke 18:41
iH2O why does this fail, how can I pass an empty array:
zengargoyle perlpilot: yeah, there, not sure if i've pushed since adding some proto's in though....
iH2O m: sub f(Int @i){}; f([])
camelia 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
DeadDelta github.com/rakudo/rakudo/blob/nom/...3672-L3696
iH2O: because you asked for a parametarized array, and passing one that isn't
m: sub f(Int @i){}; f(Array[Int].new)
camelia ( no output )
DeadDelta m: sub f(@i where .all ~~ Int){}; f([])
camelia ( no output )
iH2O oh. good 18:42
DeadDelta m: sub f(@i where .all ~~ Int){}; f([42])
camelia ( no output )
DeadDelta m: sub f(@i where .all ~~ Int){}; f([])
camelia ( no output )
DeadDelta m: sub f(@i where .all ~~ Int){}; f(["foo"])
camelia 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
DeadDelta Sorry for spam :) 18:44
zengargoyle perlpilot: just pushed to branch 'planc' -- i'm totally going at this in a haphazard way.
to some extent, playing is more fun than reading docs and thinking. :P
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
zengargoyle: you could make your own compiler! Practice with that :) 18:45
perlpilot zengargoyle: yeah, as long as you don't confuse yourself playing :)
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....
DeadDelta Juerd: you can.
zengargoyle: here Day 1 course. Good for grammar stuff: edumentab.github.io/rakudo-and-nqp-...ls-course/ 18:47
Juerd DeadDelta: Not on my box...
perlpilot m: sub foo(@a of Int) { }
camelia 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
DeadDelta Ah
zengargoyle so there's still some crazy "that's how they defined the grammar" things that are less than optimal....
DeadDelta m: my @i of Int; dd @i
camelia Array[Int] @i = Array[Int].new()
DeadDelta s: &trait_mod<of> 18:48
huh. there's a `is hidden-from-USAGE` trait :) 18:49
AlexDaniel m: sub foo(Int @a) { } # ?
camelia ( no output )
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
AlexDaniel yup 18:50
perlpilot zengargoyle: don't let it! That course should make it less so
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
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.
Juerd AlexDaniel: And the thing everyone's looking for doesn't have nice error messages :|
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:51
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.
DeadDelta Juerd: which thing that is about?
Juerd DeadDelta: where .all ~~ Int results in error messages referring to an anonymous constraint, as opposed to something awesome about integers.
DeadDelta Ah
Juerd: well, there's Subset::Helper for that 18:53
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
Juerd DeadDelta: All error messages may leak sensitive info. 18:54
DeadDelta Not all
Juerd DeadDelta: Many
rouking Hm 18:55
DeadDelta Juerd: like what?
Juerd DeadDelta: For example, which methods exist
DeadDelta Juerd: that's not at all what I'm talking about
rouking Is there any way to restore stty options in the same format as they are given in stty -g?
Juerd DeadDelta: What were you referring to then?
DeadDelta m: my $credit-card where /\d+\-\d+/ = "444444444"
camelia Type check failed in assignment to $credit-card; expected <anon> but got Str ("444444444")
in block <unit> at <tmp> line 1
DeadDelta ^ having actual credit card number spammed in some world-accessible error log for example
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.
rouking: my $save = qx/stty -g/; ... do your stuff...; run "stty", $save 18:57
rouking Doesn't work for me
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 :(
DeadDelta Weird. No idea then
rouking stty just says its an invalid argument
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.
DeadDelta m: dd DateTime.now.Capture
camelia \(:day(26), :daycount(57930), :formatter(Callable), :hour(20), :minute(58), :month(6), :second(33.6400952339172e0), :timezone(7200), :year(2017))
DeadDelta m: dd DateTime.now.Capture.Hash
camelia {:day(26), :daycount(57930), :formatter(Callable), :hour(20), :minute(58), :month(6), :second(37.600133895874e0), :timezone(7200), :year(2017)}
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
DeadDelta zengargoyle: FWIW, we have .later method you could call 19:01
m: DateTime.now.later(:week).say
camelia 2017-07-03T21:01:28.676745+02:00
DeadDelta m: DateTime.now.later(:42weeks).say
camelia 2018-04-16T21:01:34.446391+02:00
DeadDelta &
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:05
zengargoyle i sorta miss func(@args) or func(%opt) at the moment. 19:07
DeadDelta Read up on Capture 19:15
huggable: Capture
huggable DeadDelta, Argument list suitable for passing to a Signature: docs.perl6.org/type/Capture
DeadDelta Make some classes with their own Captures. Play around, then it should click 19:16
m: class Foo { method Capture(--> Capture()) { <a b c>, :42foo } }; sub ($ (@, :$foo)) { dd "Foo is $foo" }(Foo.new) 19:17
camelia "Foo is 42"
DeadDelta I guess that's not really it. Never mind :) 19:20
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:22
What's doing the magic? 19:23
geekosaur special case in the grammar, iirc 19:23
%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:24
DeadDelta Seems to be just passed as a slip 19:25
m: my %h = :42a, :42b; -> $a, $b { dd $a }(%h.Slip)
camelia Too few positionals passed; expected 2 arguments but got 1
in block <unit> at <tmp> line 1
DeadDelta m: my %h = :42a, :42b; -> $a { dd $a }(%h.Slip)
camelia Slip $a = $(slip(:a(42), :b(42)))
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
In that case prefix:<|> isn't even called
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: github.com/rakudo/rakudo/blob/nom/...6195-L6208
m: use nqp; my %h = :42a, :42b; %h does role { method FLATTENABLE_HASH { nqp::hash } }; -> :$meow { dd [ $meow ] }(|%h) 19:36
camelia [Mu]
DeadDelta Cool. You can cheat the "unexpected argument passed" thing :)
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 [42]
DeadDelta \o/ I've beat the system
Actually, I can do one better...
jnthn wonders if he needs to point out that this is decidedly in "implementation detail" territory :) 19:38
DeadDelta nah :)
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 [:a(42), :b(42)]
DeadDelta haha :D a hash that slips in as positional pairs instead of named args :D
moritz what could possibly go wrong :-) 19:43
DeadDelta :)
[Coke] (2-space indent) you monster. 19:45
lizmat starts on the P6W 19:46
timotimo i used 2-space indent for python code for a long long time
moritz
.oO( long long time monster )
19:48
[Coke] ... we need a t-shirt that has "size_t XL;" on it. 20:13
(e.g.) 20:14
timotimo shirt_t?
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:27
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:28
zengargoyle both hit: 'make DateTime.new: |$/<timespec>.made;' 20:30
DeadDelta sounds like in second case it's making the string, not the hash 20:33
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> }
DeadDelta What's the link to code, again? 20:34
DeadDelta m: DateTime.new: %(:year) 20:36
camelia 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…
DeadDelta There's no DateTime.new candidate that takes a Hash
zengargoyle github.com:zengargoyle/p6-Time-Spec-at.git -- branch 'pland'
DeadDelta I suspext in both cases it's still a string 20:37
timotimo fun data point: without spesh, the profiler can work 20:38
DeadDelta chatlogs are ded again
and can't copy-paste off weechat on my phone boooo
DeadDelta ah you slipping the hash, never mind 20:40
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
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....
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:43
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 :)
Oh, there's Grammar::Tracer you could use to see what it's doing 20:46
buggable: Grammar::Debugger
buggable: eco Grammar::Debugger
buggable DeadDelta, Grammar::Debugger 'Simple tracing and debugging support for Perl 6 grammars': github.com/jnthn/grammar-debugger
DeadDelta ^included in that distro 20:46
zengargoyle DeadDelta++ i'll leave it alone, close to my & time. 20:47
DeadDelta k :)
zengargoyle a dd/print debugger with a inotivy running tests at every write sort of person. :P 20:47
but man try the debugger's if they're working again. 20:48
DeadDelta perl6-debug-m works on like 20 commits past latest release. The grammar debuuger should work fine 20:52
timotimo i believe that at least the grammar tracer can change how regexes match or not 20:53
DeadDelta hm, I'm guessing zef misteriouslyt stopping without error after "Filtering" stage is the proc issue 21:18
Same issue as that person who was having travis issues, except happened locally 21:19
re-running zef install Test::META worked
zengargoyle: you gonna hate yourself :D
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: github.com/zengargoyle/p6-Time-Spe...tion.t#L42 21:20
yoleaux DeadDelta: I'll pass your message to zengargoyle.
zengargoyle if i re-order the tests they fail in different ways.
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: github.com/zengargoyle/p6-Time-Spe...tion.t#L42
DeadDelta None fail for me after i fix the Date.new() in the test 21:23
DeadDelta depars to feat on a home-made T-bone steak 21:24
zengargoyle lol -- me hates myself.
zengargoyle DeadDelta++ -- me crawls into bed at 14:31 and 36℃ 21:34
lizmat and another Perl 6 Weekly hits the Net: p6weekly.wordpress.com/2017/06/26/...way-there/ 22:36
DeadDelta lizmat++ good weekly 22:47
And wow, tons of blogs/videos by names I don't recognize.... Looks like P6 is growing 22:48
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
timotimo clearly i must travel to the next conference and have a talk of my own
DeadDelta timotimo++ yes, you should 22:50
lizmat youtu.be/VbObDEH-jKY?t=1460 # Perl 6 part of Error handling across languages 22:51
timotimo ah, nice!
DeadDelta ouch... it mentions resume :} 22:52
I think that's gone now
m: say X::AdHoc.can: "resume"
camelia (resume)
DeadDelta m: say X::AdHoc.can: "resumable" 22:53
camelia ()
DeadDelta mc: say X::AdHoc.can: "resumable"
committable6 DeadDelta, ¦2015.12: «(resumable)»
DeadDelta Ah, that's what's gone.
I wish Failures got more spotlight, but, hey. That was pretty good \o/
timotimo my opinion on Failure has flipped and flopped at least once in each direction 22:54
DeadDelta What does that mean?
timotimo i started out thinking they were cool, then i started thinking they're horrible, then i thought they were cool again
maybe i went back and forth another time?
DeadDelta Heh 22:55
I never thought they were "cool". I always though, "nice, I don't have to type freakin' `try` all over the damn place"
DeadDelta I think people who winge about Failures expect them to be more magical than they really are. 22:55
DeadDelta They're just exceptions you can handle with conditionals. No more. 22:56
timotimo mhm
DeadDelta well, slightly more in that they don't explode right away; only when you touch them
timotimo is brock wilcox actually on the irc sometimes/rightnow?
oh that's awwaiid 22:57
DeadDelta \o 22:58
timotimo aha, the thing i wanted to point out was just then answered in the video, too 22:58
lizmat good night, #perl6! 22:59
timotimo awwaiid: in the slide on "operators as methods" you have to put an & in front of the infix, prefix, postfix words 23:00
but the .:<++> syntax was new to me. neat.
also, here's an ugly internal error:
m: say 10.&:<++>
camelia ===SORRY!===
This type (QAST::WVal) does not support positional operations
timotimo that was a fun little talk 23:02
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
timotimo (i also tend to put too many slides into my presentations) 23:02