»ö« 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.
00:07 Actualeyes left, donaldh left 00:11 konsolebox left 00:12 donaldh joined 00:13 konsolebox joined 00:18 Cabanossi left 00:20 kerframil joined, Cabanossi joined 00:27 wamba left 00:33 konsolebox left 00:34 konsolebox joined 00:40 konsolebox left 00:41 konsolebox joined 00:43 mson left 00:55 aborazmeh joined, aborazmeh left, aborazmeh joined
lookatme o/ 00:58
00:59 markong left 01:02 cpage_ joined 01:06 cdg joined, konsolebox left 01:07 llfourn left 01:08 konsolebox joined 01:09 cdg_ left 01:10 cdg left 01:17 Morfent left 01:20 cdg joined 01:25 cdg left 01:30 sivoais joined 01:33 Cabanossi left 01:35 Cabanossi joined 01:37 konsolebox left 01:38 konsolebox joined 01:43 rouking joined 01:46 rouking left 01:50 konsolebox left 01:53 troys is now known as troys_ 01:54 cdg joined
Herby_ lookatme: \o/ 01:56
01:57 konsolebox joined 01:58 cdg left
AlexDaniel squashable6: next 02:01
squashable6 AlexDaniel, ⚠🍕 Next SQUASHathon in 2 days and ≈7 hours (2017-12-02 UTC-12⌁UTC+14). See github.com/rakudo/rakudo/wiki/Mont...Squash-Day
02:02 AndChat|688961 left 02:04 zakharyas joined 02:12 BenGoldberg joined 02:13 BrianOn99 joined 02:15 mcmillhj joined 02:18 BrianOn99 left 02:19 cpage_ left 02:28 kitsunenokenja left 02:31 cdg joined 02:33 Cabanossi left 02:35 Cabanossi joined, cdg left 02:46 konsolebox left, ilbot3 left 02:48 konsolebox joined
Geth doc: 64121a95f1 | (Jeremy Studer)++ | 3 files
Make eager examples showcase "eager" eval more

The existing examples did not really showcase the "eagerness" of the evaluation.
02:49
02:53 pilne left, stmuk left 02:57 ilbot3 joined, ChanServ sets mode: +v ilbot3 03:03 konsolebox left 03:04 ufobat_ joined 03:05 konsolebox joined, klapperl left 03:07 ufobat left 03:08 travis-ci joined
travis-ci Doc build failed. Jeremy Studer 'Make eager examples showcase "eager" eval more 03:08
travis-ci.org/perl6/doc/builds/308770157 github.com/perl6/doc/compare/dcb56...121a95f1f0
03:08 travis-ci left
buggable [travis build above] ☠ Did not recognize some failures. Check results manually. 03:09
03:13 uhmhe joined 03:18 Cabanossi left 03:20 Cabanossi joined, stmuk joined 03:24 cpage_ joined 03:37 Herby__ joined 03:40 mcmillhj left 03:41 konsolebox left 03:43 konsolebox joined 03:45 cdg joined 03:47 Cabanossi left 03:48 konsolebox left 03:49 konsolebox joined 03:50 Cabanossi joined 03:55 konsolebox left, konsolebox joined 04:04 konsolebox left 04:07 konsolebox joined 04:16 troys_ is now known as troys, releasable6 left, releasable6 joined, ChanServ sets mode: +v releasable6 04:17 Cabanossi left, konsolebox left 04:18 konsolebox joined 04:19 Cabanossi joined 04:23 wamba joined 04:27 Actualeyes joined 04:29 sivoais left 04:30 sivoais joined 04:34 llfourn joined 04:35 epony left
Herby__ exit 04:36
whoops!
04:36 Herby__ left 04:39 sivoais left 04:40 Herby_ left, sivoais joined 04:43 cdg left 04:53 uhmhe left 04:58 konsolebox left, aindilis joined 04:59 konsolebox joined 05:04 konsolebox left 05:05 konsolebox joined 05:10 konsolebox left 05:14 troys is now known as troys_ 05:15 kerframil left 05:16 kerframil joined 05:17 konsolebox joined 05:25 aborazmeh left 05:29 astronavt joined 05:32 wamba left 05:33 aborazmeh joined, aborazmeh left, aborazmeh joined, wander joined
wander afternoon #perl6 05:34
Recently I attempt to understand how our re-dispatching system works, and learned many of it by reading the blog ↓ 05:37
rakudo.party/post/Perl6-But-Heres-...with-Maybe
however, some questions still remain
the main is, "how to decide who is the next candidate?" 05:38
I know some examples and how they work (github.com/perl6/doc/issues/1689), but is there a complete rule how it choose the next candidate? 05:39
AlexDaniel that's not just about nextsame and friends, the same order is used when you just call something (I think) 05:40
another piece of the puzzle: docs.perl6.org/type/Routine#Trait_is_default 05:41
generally stuff with stricter signatures has higher priority, but I don't know what are these rules exactly 05:43
05:44 aborazmeh left
AlexDaniel relevant code: github.com/perl6/nqp/blob/8c3aedcc...ne.nqp#L59 05:44
wander huh, what it comes to external-defined functions, we can use "which is more narrow". But how about when it intersects with class inherit? 05:45
see the interesting example 05:46
gist.github.com/W4anD0eR96/0121e30...24018ef163
AlexDaniel eval: gist.githubusercontent.com/W4anD0e...ispatch.p6 05:47
evalable6 AlexDaniel, Successfully fetched the code from the provided URL.
b.f.i
a.f.i
b.f.a
a.f.a
perlbot AlexDaniel: ===SORRY!=== Error while compiling /tmp/PVevymQFrX Confused at /tmp/PVevymQFrX:1 ------> https:⏏//gist.githubusercontent.com/W4anD0eR96/ expecting any of: colon pair [Exited 1]
AlexDaniel simcop2387: can it react on something different?
wander: actually that's probably not the right piece of code, but that's all my sleepy mind can find at the moment :) 05:48
wander what does "not the right piece of code" mean? User is not recommended to write code like this? 05:50
05:50 troys_ is now known as troys, b2gills left 05:52 mcmillhj joined
lookatme m: class A { multi method b() { say "A"; }; }; class B is A { multi method b() { nextsame; }; }; say B.new.^lookup("b").candidates>>.signature; B.new.b 05:52
camelia ((A $: *%_) (B $: *%_))
A
AlexDaniel wander: I'm talking about the link to nqp sources 05:53
wander see, sorry for misunderstanding 05:54
05:56 mcmillhj left
lookatme m: class A { method b() { say "A"; }; }; class B is A { method b() { nextsame; }; }; say B.new.^lookup("b").candidates>>.signature; B.new.b 05:58
camelia ((B $: *%_))
A
06:08 konsolebox left 06:09 cpage_ left, konsolebox joined
wander re-dispatching is a sub-topic of multi-dispatching, i think 06:11
TimToady any dispatcher can re-dispatch, so what 'nextsame' et al. mean depends on the current dispatcher (and they can be nested) 06:12
06:12 khw left 06:13 b2gills joined 06:14 itaylor57 left
TimToady one could be in the single-dispatcher, the multi-dispatcher, and the wrap dispatcher all at the same time 06:14
if you don't like the current dispatcher anymore, you can say 'lastcall' to throw it away, and the 'nextsame' will talk to the next innermost dispatcher 06:15
06:16 itaylor57 joined 06:19 troys left 06:21 mson joined 06:27 itaylor57 left 06:30 itaylor57 joined 06:32 epony joined, konsolebox left 06:33 konsolebox joined 06:37 robertle_ joined 06:38 konsolebox left 06:40 robertle left, konsolebox joined 06:42 darutoko joined 06:43 cdg joined
wander I'm supposed to learn what dispatcher is, looks interesting :-) 06:46
06:48 cdg left 06:51 wander left 06:52 wander joined 06:53 dayangkun joined
wander how about "single-dispatcher"? and in which dispatch the example intersecting re-dispatching with class inherit is 06:53
06:54 konsolebox left 06:55 konsolebox joined
TimToady those are the same; the class dispatcher finds a single method in a class, but within that class you might have the method defined as several multi methods, so that would turn around and use the multi-dispatcher inside the normal class dispatcher 06:57
and since methods are routines, one of those could have had .wrap called on it, maybe for Aspect Oriented Programming, so that dispatcher might also come into play 06:58
07:03 dayangkun left
wander emmmmm..got something. So how can we explain this example(gist.github.com/W4anD0eR96/0121e30...018ef163)? I tried to do that but end with losing myself. 07:04
07:05 dayangkun joined
wander Here is no wrapper dispatch. As you mention a new concept "class dispatcher", how does it communicates with multi-dispatcher? 07:06
It calls 'b.f.i' at first, which looks well; the next is a.f.i, huh, no problem; then it back to b.f.a, which messes up logic 07:09
u-ou what is dispatch in programming
I mean, what does the word mean in programming context 07:10
BenGoldberg In general, dispatch in programming means a lookup table of some sort which is keyed by a name, with functions as values. 07:11
u-ou ok 07:12
wander Preamble `sub f(Int) { ... }; sub f(Any) { ... };`, then calls `f(42)`. dispatch is to choose which one to be called, for example. 07:13
BenGoldberg If you hear "multi dispatch", usuaully that means that each value from the lookup table is, instead of a single function, a list of functions... typically with different signatures. Like wander's example ^
TimToady there is only one single-method dispatch there, which goes to an anonymouse proto method that is generated around the most general multi method 07:14
the purpose of that proto is to dispatch to all the multis within its scope, which in this case is all four of them 07:15
07:15 faraco joined, faraco left, faraco joined
wander u-ou: my lexical example miss `multi` 07:15
TimToady so the ordering you see is merely picking based on which parameter types are closer to the actual argument type, and which parameter types are more generic
B is more specific than A, and Int is more specific than Any 07:16
if you only want to redispatch to the multis in a given class, you can provide an explicit proto that can see only those multi methods 07:17
07:19 konsolebox left
TimToady without that, the autogenerated proto will see all the multis from the object's class, as well as any parent classes of that class 07:19
07:21 sena_kun joined
TimToady the rules in a grammar dispatch by exactly the same visibility rules, but use yet another dispatcher that is smart about LTM (longest token matching), so it calls the methods in order of how much they match 07:21
07:21 geospeck joined
TimToady this is all pluggable underneath, so you could write your own dispatcher too, but we don't advertise that heavily :) 07:22
but basically, this is how we unify methods and functions and such; everything is a function, but a method is merely a function that happens to be called by a method dispatcher via the class hierarchy 07:25
07:25 dayangkun left 07:26 konsolebox joined
TimToady bed & 07:26
lookatme good night 07:27
07:28 domidumont joined
u-ou night :) 07:28
07:28 dayangkun joined
wander I tried adding 'proto' and saw the difference. Now I could explain the very example, in fact I have four multi method whose signatures are (B, Int), (A, Int), (B, Any) and (A, Any). They are flatten so can be sorted from narrow to wide. 07:29
could I write my own dispatcher directly? sounds cool. or it means I can manipulate dispatcher by adding proto properly 07:30
07:31 klapperl joined, BrianOn99 joined
wander good night, thanks a lot for your explanation :) 07:32
07:33 BenGoldberg left, domidumont left 07:34 domidumont joined 07:36 BrianOn99 left 07:37 abraxxa joined 07:42 espadrine left 07:52 faraco left 07:54 konsolebox left 07:56 konsolebox joined 08:01 konsolebox left 08:02 konsolebox joined
buggable New CPAN upload: PDF-Font-0.0.1.tar.gz by WARRINGD cpan.metacpan.org/authors/id/W/WA/...0.1.tar.gz 08:03
08:05 itaylor57 left 08:07 konsolebox left 08:08 konsolebox joined 08:09 dayangkun left 08:10 dayangkun joined, wamba joined 08:16 cpage_ joined 08:17 dayangkun left, cdg joined 08:18 dayangkun joined 08:21 cdg left 08:22 cpage_ left 08:26 cpage_ joined 08:28 philomath joined 08:31 mson left, dayangkun left 08:37 wander left 08:40 dayangkun joined 08:41 philomath left, konsolebox left 08:47 Cabanossi left 08:49 Cabanossi joined 08:50 raiph left 08:52 konsolebox joined, wander joined
wander suggest fixing this issue as soon as possible(github.com/perl6/doc/issues/1692) 08:55
08:57 konsolebox left
wander I cannot work it out because everything goes well locally. It has nothing to do with our commit, maybe. 08:57
08:59 kerframil left, domidumont left, konsolebox joined, domidumont joined 09:01 dayangkun left 09:04 cdg joined 09:09 cdg left 09:12 cgfbee left 09:13 lowbro joined, lowbro left, lowbro joined, scimon joined 09:15 Actualeyes left, wander left 09:16 Cabanossi left 09:18 konsolebox left, konsolebox joined 09:19 Cabanossi joined 09:28 wander joined 09:31 cschwenz joined, cschwenz left 09:32 dakkar joined 09:52 mcmillhj joined 09:53 konsolebox left 09:56 konsolebox joined, mcmillhj left 09:59 gregf_ joined 10:01 cgfbee joined 10:05 konsolebox left 10:07 konsolebox joined 10:17 konsolebox left 10:18 Cabanossi left 10:19 konsolebox joined, Cabanossi joined 10:26 evalable6 left, evalable6 joined 10:34 eater left, eater joined 10:35 eater left, eater joined 10:36 eater left, zakharyas left 10:41 rindolf joined 10:43 eater joined 10:45 philomath joined 10:50 TEttinger left, wamba left 10:51 astj left 11:00 wamba joined 11:02 domidumont left 11:06 Aaronepower joined 11:07 konsolebox left, konsolebox joined 11:10 markong joined, Aaronepower left 11:13 cschwenz joined 11:17 Cabanossi left 11:18 cschwenz left 11:19 Cabanossi joined
DrForr I'd forgotten how well perl symbols and LaTeX don't play together. 11:24
11:27 geospeck left 11:33 BrianOn99 joined 11:37 BrianOn99 left 11:38 konsolebox left 11:43 konsolebox joined 11:51 astronavt left 11:53 philomath left 11:55 koto joined 11:56 sena_kun left 12:00 koto left 12:04 eliasr joined 12:06 cdg joined 12:11 cdg left 12:17 Cabanossi left
wander .ask TimToady could you please reply this(irclog.perlgeek.de/perl6/2017-11-29#i_15506760) when you're free? I'm quite curious. thanks. 12:18
yoleaux wander: I'll pass your message to TimToady.
12:19 Zoffix joined, Cabanossi joined
Zoffix What was it that aren't closures? classes/roles or methods too? 12:21
wander huh? 12:23
Zoffix Yeah, I think it's just classe/roles; methods do close over class body but not stuff beyond 12:25
12:25 cdg joined
DrForr Ah, wrong package, forgot. 12:27
Zoffix man, can't look at AST on this dumb phone :(
12:29 cdg left
Zoffix jnthn: you around? What was it that aren't closures? Methods aren't closures? Was just looking at the Proxy examples here and see methods closing over a variable; is that fine? docs.perl6.org/type/Proxy 12:30
12:38 geospeck joined, wamba left
Zoffix m: my ($m, $s) = do { my $x = 42; my method { $x }, { $x = $^v } }; $s(100); say $m($) 12:38
camelia 100
Zoffix shrugs
Methods ain't closures based on this: github.com/rakudo/rakudo/commit/23...50ec570b9d 12:43
But I don't understand how above example works if they're not and also whether the Proxy example is goo
12:47 Cabanossi left
Zoffix wander: "latest version" is what exactly? 12:48
To me it means latest Rakudo release, to some, latest Star release, to others, the HEAD commit when you wrote that Issue
12:49 Cabanossi joined
Zoffix That's for D#1692 12:49
synopsebot D#1692 [open]: github.com/perl6/doc/issues/1692 [build] Build fail strange
Zoffix Gotta be rakudo issue. Latest pod changes, likely 12:50
wander as mention"latest version", I mean the latest perl6/doc version(at that time, 81de65a ). 12:51
ok, let me pull the latest Rakudo and try it again 12:52
Zoffix Ah, I thought you meant latest rakudo version 12:53
Zoffix & 12:54
12:54 Zoffix left
wander :P 12:54
12:56 pmurias joined
pmurias hi 12:57
jnthn .tell Zoffix Anonymous methods actually are closures. The thing that makes things "not a closure" is when they are installed somewhere at compile time. A type has a single meta-object with a single method table. 13:03
yoleaux jnthn: I'll pass your message to Zoffix.
Altreus What is the ($) for in zoffix's bot example? 13:05
13:12 astj joined 13:18 astj left, Cabanossi left 13:19 Cabanossi joined 13:22 dasfagggdhkjh joined, sergot joined
dasfagggdhkjh Altreus: $m has a Callable in it, the $m() calls it, and the $ is a anonymous state variable that in this case just serves to provide a dummy value for a routine that expects one positional argument. docs.perl6.org/language/variables#...$_Variable 13:24
13:24 dasfagggdhkjh left 13:26 wamba joined 13:35 BrianOn99 joined, bloatable6 left, bloatable6 joined
perlawhirl is there any reason why argless .classify() shouldn't just classify against the value? 13:37
m: say <A A A A B B B C C D>.classify({ $_ })
camelia {A => [A A A A], B => [B B B], C => [C C], D => [D]}
perlawhirl m: say <A A A A B B B C C D>.classify(*)
camelia Doesn't make sense to classify with itself
in block <unit> at <tmp> line 1
perlawhirl it does tho
m: say <A A A A B B B C C D>.classify() # :(
camelia Must specify something to classify with, a Callable, Hash or List
in block <unit> at <tmp> line 1
13:39 BrianOn99 left
timotimo zoffix, it's very problematic to show methods being passed to the proxy constructor; you can't use $!foo syntax in there without making things explode rather violently in most cases 13:45
m: class test { has $.something; has $!foo; method getfoo is rw { Proxy.new(FETCH => method() { $!foo }; STORE => method($n) { $!foo = $n } } }; test.new.getfoo = 99 13:46
camelia 5===SORRY!5=== Error while compiling <tmp>
Unable to parse expression in argument list; couldn't find final ')' (corresponding starter was at line 1)
at <tmp>:1
------> 3tfoo is rw { Proxy.new(FETCH => method()7⏏5 { $!foo }; STORE => me…
timotimo m: class test { has $.something; has $!foo; method getfoo is rw { Proxy.new(FETCH => method () { $!foo }; STORE => method ($n) { $!foo = $n }) } }; test.new.getfoo = 99
camelia Unexpected named argument 'FETCH' passed
in method getfoo at <tmp> line 1
in block <unit> at <tmp> line 1
timotimo m: class test { has $.something; has $!foo; method getfoo is rw { Proxy.new(FETCH => method () { $!foo }, STORE => method ($n) { $!foo = $n }) } }; test.new.getfoo = 99
camelia Cannot assign to an immutable value
in method <anon> at <tmp> line 1
in block <unit> at <tmp> line 1
timotimo m: class test { has $.something; has $.blah; has $.flob; has $!foo; method getfoo is rw { Proxy.new(FETCH => method () { $!foo }, STORE => method ($n) { $!foo = $n }) } }; test.new.getfoo = 99
camelia P6opaque: no such attribute '$!foo' on type test in a Proxy when trying to get a value
in method <anon> at <tmp> line 1
in block <unit> at <tmp> line 1
13:47 konsolebox left 13:48 konsolebox joined, Cabanossi left 13:49 Cabanossi joined
Altreus Is it because it was declared as a method so it expects a $self? 13:56
13:57 wamba left
timotimo it's a little more tricky than that 13:58
when code for $!foo is generated it'll look around itself to the innermost class definition
that lets it know what type to put into the generated code
but STORE and FETCH are called on the proxy object
so there's code to grab (or set) attribute $!foo in a test object, but the object the method is called on isn't a test at all 13:59
m: class test { has $.something; has $.blah; has $.flob; has $!foo; method getfoo is rw { Proxy.new(FETCH => sub ($p) { $!foo }, STORE => sub ($p, $n) { $!foo = $n }) } }; test.new.getfoo = 99
camelia ( no output )
timotimo here it closes over "self" from the "getfoo" method, which is the test object 14:00
14:00 domidumont joined
timotimo so now the type of the innermost class definition and the object stored in "self" match up and everything's good 14:00
m: class test { has $.something; has $.blah; has $.flob; has $!foo; method getfoo is rw { Proxy.new(FETCH => sub (\self:) { $!foo }, STORE => sub (\self: $n) { $!foo = $n }) } }; test.new.getfoo = 99 14:01
camelia 5===SORRY!5=== Error while compiling <tmp>
Can only use the : invocant marker in the signature for a method
at <tmp>:1
------> 3o is rw { Proxy.new(FETCH => sub (\self:7⏏5) { $!foo }, STORE => sub (\self: $n) {
timotimo ah, ok
if that were legal syntax, it would have blown up again
Geth doc: f4426c44cf | (Alex Chen)++ | 4 files
Try to make build OK
14:01 Zoffix joined
Zoffix timotimo: what I don't get is why is it taking methods in the first place? 14:02
14:02 cdg joined
Zoffix This seems a lot less clunky to use: my $x := do { my @stuff; Proxy.new: :STORE{ @stuff.push: $_ }, :FETCH{ @stuff.join: "|" } }; 14:03
And is in fact what I first wrote this morning until it gave me wrong results and I realized it's passing the proxy object as the first values
14:04 cdg left, cdg joined
Zoffix Or better yet: my $x := Proxy.new: { my @stuff; :STORE{ @stuff.push: $_ }, :FETCH{ @stuff.join: "|" } }; 14:05
Especially if you say it's very problematic to show methods; well, if we don't then we have some explanation to do about why first arg is a dud 14:07
moritz i guess we'd have to add a new API
the old one has annoyed me at times, too 14:08
Proxy.new is in somewhat whitespread use in the ecosystem
Zoffix I can imagine. 14:09
Gonna hack up a Proxee module some time this week and experiment with a few things
moritz moritz@hack:~/p6/perl6-all-modules$ git grep -wlF Proxy.new|cut -d/ -f 1-3|sort -u|wc -l
42
42 different distributions use it
Zoffix m: say WHY "Life, the Universe and Everything": 14:10
camelia 42
Zoffix Coincidence? I think NOT! 14:11
:)
14:12 cdg_ joined
wander github.com/rakudo/rakudo/blob/1c38...Str.pm#L21 14:13
Zoffix s: "Life, the Universe and Everything", 'WHY', \() 14:14
SourceBaby Zoffix, Sauce is at github.com/rakudo/rakudo/blob/4fca...Str.pm#L21
wander IIRC moritz picked it up once :P 14:15
14:15 cdg left, sena_kun joined
Zoffix I was showing off my cool bot :P 14:16
wander so it is
cool to me too
Zoffix eco: Sourcery 14:17
buggable Zoffix, CoreHackers::Sourcery 'Helper for showing actual source code locations of core subs and methods': github.com/zoffixznet/perl6-CoreHa...s-Sourcery
Zoffix Uses this module
14:17 Zoffix left 14:21 sena_kun left 14:22 sena_kun joined 14:26 nebuchadnezzar left 14:29 travis-ci joined
travis-ci Doc build passed. Alex Chen 'Try to make build OK' 14:29
travis-ci.org/perl6/doc/builds/308983984 github.com/perl6/doc/compare/64121...426c44cfb7
14:29 travis-ci left
wander lucky :P 14:30
14:30 Util joined
moritz the more you practice, the more luck you have 14:33
Geth doc: 10a5e8a4a6 | (Alex Chen)++ | doc/Language/functions.pod6
Collect sub MAIN into routine
14:37
synopsebot Link: doc.perl6.org/language/functions
Altreus timotimo: but zoffix's original example didn't actually use a class, which is what made me wonder 14:39
so I guess the reason the call to $m needed a solo $ is that it was declared as a method and therefore needs an invocant?
14:41 wamba joined
timotimo what code are you refering to? 14:43
14:44 bdmatatu joined 14:45 philomath joined 14:56 nebuchadnezzar joined 15:02 Cabanossi left 15:04 wamba left, Cabanossi joined, Actualeyes joined 15:07 konsolebox left 15:08 konsolebox joined 15:16 Zoffix joined
Zoffix Is there any significant difference between `my &foo := {;}` and `my &foo = {;}`? I can see the latter gives true for nqp::iscont, but is there any difference for regular users? 15:17
15:17 konsolebox left 15:20 konsolebox joined
moritz not really 15:20
m: my &foo := {;}; &foo = {;}; say 'alive' 15:21
camelia Cannot modify an immutable Block (-> ;; $_? is raw { #...)
in block <unit> at <tmp> line 1
moritz Zoffix: ^^ that's the most important difference, I think
Zoffix Oh right. moritz++ 15:22
15:31 geospeck left 15:45 Zoffix left
abraxxa is there a way to tell zef to install all requirements of a perl6 script? 15:46
[Coke] zef install --deps-only . 15:49
... but that's more for a project with a META6.json file
15:51 azawawi joined
azawawi hi 15:51
Altreus timotimo: zoffix did this: «my ($m, $s) = do { my $x = 42; my method { $x }, { $x = $^v } }; $s(100); say $m($)» 15:53
$m is declared as a method but isn't run on an object 15:54
so I guess that's what the $ is for
azawawi m: grammar G { rule TOP { ^ <e> $}; rule e { <e> "+" <e> | "a" | "b" | "c" } }; say G.parse('a+c');
15:55 astj joined
camelia (timeout) 15:55
azawawi how do i remove recursion (timeout) from that grammar?
what's a better way to write: grammar G { rule TOP { ^ <e> $}; rule e { <e> "+" <e> | "a" | "b" | "c" } }; say G.parse('a+c');
15:57 rgrau joined
jast in formal terms this is called left recursion and an easy way to get rid of it is to split the rule in two, e.g.: rule e { <term> "+" <e> | <term> }; rule term { "a" | "b" | "c" }; 15:59
DrForr Looks like you want to do mathematics. I'd look at github.com/drforr/perl6-Grammar-Co.../Infix.pm6 but I'm a bit biased :)
15:59 astj left
azawawi jast: cool thx 16:01
jast: im a bit rusty on compiler stuff :)
jast I was very, very interested in it for a couple of years, a lot of it has stuck :) 16:02
azawawi jast: left recursion elimination right?
jast yep
azawawi cool
the thing is if you read docs.perl6.org/language/grammars, you dont find any mention of left recursion elimination 16:03
jast right
TimToady we should at least detect it and complain
jast in *principle* it's not necessary to eliminate left recursion in grammars, it just happens to be necessary if the underlying parsing engine uses top-down parsing (e.g. LL(k) parsers)
azawawi TimToady: I totally agree 16:04
it happened to me here... github.com/azawawi/perl6-inline-go...ar.pm6#L58 16:05
jast I kind of like packrat parsers with PEG instead of standard grammars, but those do take some getting used to
azawawi also perl6 is not complaining of undefined rules until they're actually used. This is good and bad while developing/debugging a grammar 16:06
TimToady the other way to fix it is the way Perl 6's grammar does, install some kind of bottom-up parser in a layer-cake
16:06 troys joined
TimToady p6 just throws an operator precedence parser in under the name EXPR 16:06
jast yeah, that would work for pretty much everything you'd ever want to parse, except maybe natural languages :-) 16:07
azawawi btw what type of parsing are perl6 grammars actually doing (behind the scenes)?
jast I can guess, but I have to leave anyway so I'll let someone more knowledgeable answer 16:08
TimToady it's just PEG, but not packrat 16:09
azawawi en.wikipedia.org/wiki/Parsing_expr...on_grammar right? 16:10
jast packrat doesn't inherently solve left recursion issues anyway, it needs some extra treatment
TimToady the power comes from the fact that it writes lexers for you, so you never need to write your own 16:11
p6 grammmars, I mean
and it automatically calculates longest token matching across all the rules that can be a prefix at that spot
azawawi TimToady: thanks 16:13
Looking at sample grammar test code github.com/albastev/Grammar-Modeli...ause.t#L11 , it seems :rule parameter in Grammar.parse is not being used (or known) to perl6 community. 16:16
or it may have been introduced recently
Another problem cross-platform found... go does not generate shared library (DLL) on windows... sigh 16:17
so no Inline::Go or "Let's Go" for windows :) 16:18
Error message: "-buildmode=c-shared not supported on windows/amd64" since Go 1.5 when that feature was introduced...
DrForr Doesn't play well with others?
El_Che azawawi: what about the gcc compiler? 16:19
16:19 mcmillhj joined
azawawi DrForr: it is funny given how good is its support on windows 16:19
azawawi buildmode=c-archive 16:20
El_Che azawawi: stackoverflow.com/questions/405734...ith-go-1-7 <-- a two step solution?
16:21 philomath left
azawawi El_Che: cool thanks ... will try it now 16:23
El_Che azawawi: for the record, every Go programmer that I talked to told me to keep away of C-go :) 16:28
azawawi El_Che: :) 16:29
El_Che I am only exagerating slightly
:)
[Coke] m: use Telemetry :COLUMNS; 16:30
camelia 5===SORRY!5=== Error while compiling <tmp>
Error while importing from 'Telemetry': no such tag 'COLUMNS'
at <tmp>:1
------> 3use Telemetry :COLUMNS7⏏5;
16:42 pmurias left 16:44 pmurias joined 16:46 khw joined 16:49 Zoffix joined
Zoffix Altreus: yeah, it's for the invocant. In the `$foo.method(...)` it gets passed as the first arg, so if you got that Method object in a variable, you need to stick the invocant as the first arg, or use the methodop syntax with that variable: 16:50
m: my $meth := my method n { self.uc.say }; "meow".$meth; "foos".&n; &n('bars'); $meth('bdasdas')
camelia MEOW
FOOS
BARS
BDASDAS
Altreus perl5-y 16:51
azawawi El_Che: it is a go for windows Inline::Go. Thanks :)
Altreus I guess the main difference is that it's in self and not $^a or whatever
Zoffix Yeah
Altreus is that the entire purpose of `method`?
Zoffix Probably
Also, `method`s inside classes will get installed as methods, but `sub`s won't 16:52
Altreus so much to learn :( 16:55
Zoffix You don't need to learn everything in one go :) 16:56
DrForr scrambles around for peanuts to throw.
16:57 abraxxa left
Zoffix wonders how many ways to call a method we got 16:58
wander azawawi:
Zoffix I'm gonna guess: 40
wander m: grammar G { rule TOP { ^ <e>+ % '+' $}; rule e { "a" | "b" | "c" } }; say G.parse('a+c');
camelia 「a+c」
e => 「a」
e => 「c」
Zoffix No, 80
wander for this special case, I think ^ is elegant enough 16:59
and yes, left recursion is common, we should discuss it in doc.
SmokeMachine Zoffix: is there a list with each way?
wander TimToady: could you please reply this(irclog.perlgeek.de/perl6/2017-11-29#i_15506760) when you're free? I'm quite curious. thanks. 17:00
Zoffix SmokeMachine: I'm making one :)
SmokeMachine :)
wander AlexDaniel: please take a look at this(irclog.perlgeek.de/perl6/2017-11-2...15507634), seems yoleaux doesn't work correctly 17:01
SmokeMachine Zoffix: Id love to see that list... :)
17:01 mniip joined
azawawi what about also warnings on non-existing rules? is perl6 lazy on this case? since i didnt encounter while developing the inline::go grammar until it was used. 17:01
El_Che azawawi: glad to be a useful lurker :) 17:02
jnthn azawawi: They're just method calls, and the missing methods could be provided by a subclass, for example 17:03
SmokeMachine m: grammar G {token TOP {<a>}}
camelia ( no output )
SmokeMachine m: grammar G {token TOP {<a>}}; G.parse: "bla"
camelia No such method 'a' for invocant of type 'G'. Did you mean 'at'?
in regex TOP at <tmp> line 1
in block <unit> at <tmp> line 1
azawawi jnthn: ah ok.
Zoffix wander: by the way, jnthn may know more about your overriding dispatcher question 17:04
jnthn Overriding dispatcher? :)
Zoffix :)
jnthn understands the words but not the meaning ;)
Zoffix "<wander> could I write my own dispatcher directly? sounds cool. or it means I can manipulate dispatcher by adding proto properly" 17:05
m: multi x(Int) { say "here" }; multi x (Any) { say "there" }; x 42
camelia here
Zoffix I guess the question is, is there a way to change the way that dispatches and, say, prefer an `Any` candidate over all the rest 17:06
jnthn Hmm
Not *easily*, but of course all things are possible with sufficient evil
Of note, mixing a role into a proto that overrides the !find_best_dispatchee method probably works out 17:07
17:07 luiz_lha joined
jnthn The multi-dispatch algo is written in NQP code 17:07
Zoffix neat
jnthn The only reason it goes fast is because it then sticks resolutions it does into a multi-dispatch cache the VM can do fast lookups in 17:08
Zoffix m: my @a = <uc>; "foo".@a
camelia Invocant of method 'CALL-ME' must be a type object of type 'List', not an object instance of type 'Array'. Did you forget a 'multi'?
in block <unit> at <tmp> line 1
Zoffix This form is mentioned in Synopses but isn't implemented. Cuts down on my list :) 17:09
( design.perl6.org/S12.html#Fancy_method_calls )
wander thanks. now I know there is `!find_best_dispatchee`
for the whole story, at first I lost in this code snip(gist.github.com/W4anD0eR96/0121e30...4018ef163) 17:11
then TimToady explained it(irclog.perlgeek.de/perl6/2017-11-2...15506557), where he mentioned terms 'single-dispatcher', 'multi-dispatcher' and 'class-dispatcher'
still I don't have good understanding about there dispatcher, maybe I can explain why choosing a very candidate to dispatch(which is more narrow), but 'single-' and 'class-' look confusing to me 17:12
for what zoffix recurred to, that is because TimToady said one can write his own dispatcher, which I'm curious about, emmm, just curious 17:14
jnthn stackoverflow.com/questions/450472...3#45123753 17:15
I wrote that once to explain the semantics
Zoffix huggable: dispatch :is: stackoverflow.com/questions/450472...3#45123753 17:16
huggable Zoffix, Added dispatch as stackoverflow.com/questions/450472...3#45123753
17:17 luiz_lha left, lowbro left
Altreus Zoffix: yes I do Q_Q 17:17
anything I don't know when I write code is going to be code I write again later :P 17:18
Zoffix Well, my original guess was spot on... I'm hopping I missed some form that double the amount of variants to 80.
m: gist.github.com/zoffixznet/919f75c...5bc9434176
camelia Saw 40 different ways to call a method
Zoffix SmokeMachine: ^ you were wondering
There's also a few ways mentioned in the Syn but aren't implemented :) 17:19
m: "foo".$$$$$$$("".^lookup: "uc").say
camelia FOO
Zoffix And if you accept this as a separate variant, then the number is infinite :) 17:20
SmokeMachine :D
wander jnthn: thanks. let me read the answer. 17:23
17:25 scimon left, uheue joined 17:27 pmurias left
TimToady Zoffix: there's also arguably function composition 17:27
Zoffix :D
TimToady also .= mebbe 17:29
simcop2387 AlexDaniel: yea i can make it not react to eval there. i'll do that today
Zoffix o 17:30
17:30 Zoffix left
buggable New CPAN upload: PDF-Font-0.0.2.tar.gz by WARRINGD cpan.metacpan.org/authors/id/W/WA/...0.2.tar.gz 17:33
17:35 dakkar left
TimToady .tell Zoffix yer also missing the 'meow $o:' form, which definitely belongs in your list 17:35
yoleaux TimToady: I'll pass your message to Zoffix.
17:36 BrianOn99 joined
moritz you can also cheat and use the MOP in various ways 17:38
.^find_method, .^method_table<uc>
AlexDaniel squashable6: next 17:40
yoleaux 13:03Z <tbrowder> AlexDaniel: ref pod tests and lines with ws at end: only way i know how to guarantee retaining the ws is to generate the test file via the test harness somehow. any other ideas?
squashable6 AlexDaniel, ⚠🍕 Next SQUASHathon in 1 day and ≈16 hours (2017-12-02 UTC-12⌁UTC+14). See github.com/rakudo/rakudo/wiki/Mont...Squash-Day
AlexDaniel tbrowder: yea, that's a good idea I think
17:40 BrianOn99 left 17:42 wamba joined 17:46 konsolebox left 17:49 Cabanossi left, Cabanossi joined 17:52 konsolebox joined
wander AlexDaniel: please take a look at this(irclog.perlgeek.de/perl6/2017-11-2...15507634), seems yoleaux doesn't work correctly 17:55
AlexDaniel wander: mmm, why? 17:56
wander yoleaux says 'wander: I'll pass your message to TimToady.', but it didn't pass it, did it? 17:57
AlexDaniel I think you can send a private message to yoleaux
and it'll reply to you with messages
AlexDaniel` .ask AlexDaniel test pm 17:58
yoleaux AlexDaniel`: I'll pass your message to AlexDaniel.
AlexDaniel there
:)
azawawi El_Che: it is ugly but works :) github.com/azawawi/perl6-inline-go...Go.pm6#L30
El_Che++ 17:59
Inline::Go passes tests on my windows machine :) 18:01
18:10 astj joined
timotimo i wonder when larry will introduce us to the rest of the gang: larry wany, larry wone, and larry wnone? 18:11
18:15 astj left
El_Che azawawi: so the idea is to write go code that is compiled but the modules and callable from the perl code? 18:16
18:17 troys is now known as troys_ 18:20 itaylor57 joined
azawawi El_Che: yup that's the ultimate goal 18:22
El_Che: it is actually two-in-one... Grammar + Execution at the end hopefully
El_Che azawawi: and libraries? go get in the background? 18:23
or do you count on a vendor directory?
azawawi to tell you truth i havent thought about it yet :)
El_Che hehe 18:24
azawawi the builtin go packages are good enough so far :) golang.org/pkg/ 18:25
El_Che azawawi: dep is getting there being the official tool, so a dep managed directory could be a requirement 18:26
18:26 lizmat joined
azawawi github.com/golang/dep ? 18:26
El_Che yep 18:28
because golang dependency management is terrible, there are meany third party tools to manage them. 18:29
dep has the input of many of these third party authors 18:30
I use it, no probs so far :)
18:31 domidumont left
El_Che the stars it has should give some assurance :) 18:32
18:34 Ven`` joined
simcop2387 eval: say "Hello World" 18:36
evalable6 Hello World
18:38 darutoko left
simcop2387 perlbot: eval: say "Hello World" 18:40
perlbot simcop2387: Hello World
simcop2387 rkeval: say "Hello World"
perlbot simcop2387: Hello World
simcop2387 perlbot: theonion
perlbot simcop2387: Tips For Holiday Shopping On A Budget www.theonion.com/tips-for-holiday-...1820841649
simcop2387 ok good. all working as expected now. AlexDaniel, it'll now respond to eval: only if you address it, but will also work with rkeval (rakudo eval) without being addressed. bleval (perl5 blead), and eval5.X (for other perl 5 versions if wanted). i think i also forgot to mention it supports every perl version, from 1 to 5.26+blead. so eval1: eval2: eval3: etc 18:42
AlexDaniel cool, although not quite sure why would we possibly need that here :) 18:43
(perl5 evals I mean) 18:44
simcop2387 compare code? dunno. :) 18:45
though if anybody here worked with lwall way way way back in the day and had access to (and can get it still) I'd love a copy of perl 0 to put on the bot :) 18:46
AlexDaniel around here we try to compare perl5 with perl 6 as much as we compare perl 6 with ruby, python or whatever… :) 18:47
fwiw I'd love a universal eval bot for all languages
18:47 Cabanossi left
simcop2387 that's kind of what the bot has morphed into, it's got rbeval (ruby) and jseval (node). now that i did the massive rewrite to the sandbox for it, i'll probably add python (mostly for the pastebin, it's a pita for oneliners). and a few others. 18:48
AlexDaniel rbeval puts 42
rbeval: puts 42
perlbot AlexDaniel: [Died SIGSYS (Illegal Syscall)]
TimToady eval: put 42 18:49
evalable6 42
TimToady rkeval: put 42
perlbot TimToady: 42
simcop2387 ah yes that was one of the things i did this rewrite for, upgraded ruby and it broken. give me a moment i need to allow the getrandom syscall
18:49 Cabanossi joined
ilmari ceval: int main (void) { return 42; } 18:49
;( 18:50
AlexDaniel jseval: console.log('Hello');
perlbot AlexDaniel: Hello
AlexDaniel cool
simcop2387 AlexDaniel: ruby fixed
AlexDaniel rbeval: puts 42
perlbot AlexDaniel: 42
azawawi El_Che: cool thx for info
simcop2387 ilmari: yea i need to figure out how i want to handle C, it's more easily dangerous since i've got to sandbox the compiler and the program 18:51
ilmari tcc has an -run option
simcop2387 there's a lot more execve() calls that i can't defend (i basically have to open it up entirely if i want gcc)
oh neat, i was going to look at tcc but wasn't sure how well it supports newer c standards 18:52
and i kind of want a c++eval too but that's more difficult.
TimToady rkeval: say dir(".")».basename
perlbot TimToady: (key.pem README.md hello.txt elib lib married.fwp cert.pem single.fwp template.angular example.html M1qEyehFsH)
TimToady rkeval: say dir("..")».basename 18:53
perlbot TimToady: (dev eval home perl5 langs bin usr lib lib64 tmp)
ilmari simcop2387: I just thecked with strace tcc -run doens't need to write anything 18:54
Ven`` TimToady: hi. wanted to know if you had had time to upload the materials of your talk?
simcop2387 ilmari: writing's not a problem, it's gcc doing execve for linking and such that was. tcc -run looks great
18:54 unicodable6 left 18:55 unicodable6 joined, statisfiable6 left, nativecallable6 left
TimToady Ven``: you mean all the pictures? there was no text... 18:55
18:55 coverable6 left, statisfiable6 joined, nativecallable6 joined, ChanServ sets mode: +v statisfiable6, ChanServ sets mode: +v nativecallable6, coverable6 joined
TimToady there wasn't even a title :) 18:55
simcop2387 perlbot: bleval: open(my $fh, ">/tmp/foo") or die "Can't write $!"; print $fh "Hello world"x100; close($fh);
perlbot simcop2387: 1
AlexDaniel benchable6: uptime 18:56
benchable6 AlexDaniel, 1 day, 1 hour, 13 minutes, and 17 seconds, 1101.556MB maxrss. This is Rakudo version 2017.10-215-g85105077a built on MoarVM version 2017.10-86-g89fae17a6 implementing Perl 6.c.
AlexDaniel geez over 1000 MB…
TimToady rkeval: print slurp '/tmp/foo' 18:57
perlbot TimToady: Failed to open file /tmp/foo: No such file or directory in block <unit> at /tmp/WZCnGJ_IzF line 1 [Exited 1]
simcop2387 TimToady: each eval gets its own container, and they're destroyed after exit
TimToady cool
simcop2387 yea a lot of my changes to my eval setup was to reduce memory usage (allowing secure reading from disk, etc.) most evals only take <30mb now.
timotimo AlexDaniel: i can try that locally; that's in the whateverable repo? 19:03
AlexDaniel timotimo: yes, I can give you some intstructions. Maybe on #whateverable 19:04
19:04 azawawi left
rindolf simcop2387: good job 19:06
19:08 gambatte64 joined
Geth ecosystem: d84103c91e | (Ahmad M. Zawawi)++ (committed using GitHub Web editor) | META.list
Move Inline::Go to CPAN :)
19:09
19:10 wander left, kyan joined 19:12 gambatte64 left 19:13 mson joined, nativecallable6 left, coverable6 left, evalable6 left
buggable New CPAN upload: Go-Inline-0.0.2.tar.gz by AZAWAWI cpan.metacpan.org/authors/id/A/AZ/...0.2.tar.gz 19:13
New CPAN upload: Inline-Go-0.0.2.tar.gz by AZAWAWI cpan.metacpan.org/authors/id/A/AZ/...0.2.tar.gz
19:14 setty1 joined, evalable6 joined, ChanServ sets mode: +v evalable6 19:15 cdg_ left
masak m: say <A A A A B B B C C D>.classify(*) 19:38
camelia Doesn't make sense to classify with itself
in block <unit> at <tmp> line 1
masak m: say <A A A A B B B C C D>.classify()
camelia Must specify something to classify with, a Callable, Hash or List
in block <unit> at <tmp> line 1
masak perlawhirl: I agree with you one or both of those could work. 19:39
moritz m: say <A A A A B B B C C D>.classify({$_}) 19:41
camelia {A => [A A A A], B => [B B B], C => [C C], D => [D]}
[Coke] tcleval: puts 42
if you're self-classifying... why are you doing that? 19:43
m: say <A A A A B B B C C D>.Bag<A>; # seems more useful than getting a list of 4 As 19:44
camelia 4
[Coke] I agree that if you make it do something, that's probably the best thing to make it do, though. 19:45
masak [Coke]: "why would you ever want to do [a thing that even remotely makes sense]?" usually doesn't hold up as a counterargument in the Perl world :P 19:47
19:47 Cabanossi left
masak "you oughtn't want that in the first place" is more of a Python argument 19:47
[Coke] masak: you're reading waaaay too much into my question
Apologies for any tone issues on my part. I'm curious why someone would want that particular usage of classify, even explicitly. 19:49
19:49 Cabanossi joined
masak that's fine, as long as we keep separate the curious question itself and its role as a counterargument 19:50
apologies for going into overdrive defending a use case I don't fully understand either :P 19:51
perlpilot m: say <A A A A B B B C C D>.classify(*.Str);
camelia {A => [A A A A], B => [B B B], C => [C C], D => [D]}
perlpilot m: say <A A A A B B B C C D>.classify(*.Str).Bag;
camelia Bag(A(4), B(3), C(2), D)
perlpilot (just a couple of suggestions for the thing that no one seems to understand ;-) 19:52
masak but I think the error message "Doesn't make sense to classify with itself" could easily just be replaced by logic which carries out the thing
I don't really see why .classify should be the judge of what makes sense or not
perlpilot masak: +1
(except under the auspices of type constraints) 19:53
masak it "makes sense" at least in the sense that it's clear what it *should* do if it weren't complaining so much! :P
19:56 geospeck joined 19:57 geospeck left 20:00 reportable6 left 20:01 reportable6 joined
TimToady classification by type might be a more reasonable default 20:02
that is, after all, what classification means :) 20:03
20:04 |oLa| joined
[Coke] m: say ('A', 'b', e, π, .1, 4).classify(*.WHAT) 20:06
camelia Doesn't make sense to classify with itself
in block <unit> at <tmp> line 1
TimToady m: say <a 1 2.3 4+1i 1/2 3 4 z>.classify: {.WHAT.^name}
camelia {ComplexStr => [4+1i], IntStr => [1 3 4], RatStr => [2.3 1/2], Str => [a z]}
TimToady m: say <a 1 2.3 4+1i 1/2 3 4 z>.classify: {.WHAT} 20:07
camelia Use of uninitialized value of type ComplexStr in string context.
Methods .^name, .perl, .gist, or .say can be used to stringify it to something meaningful.
{(ComplexStr) => [4+1i], (RatStr) => [2.3 1/2], (IntStr) => [1 3 4], (Str) => [a z]}
in…
[Coke] was tryign to avoid the *Str variants.
TimToady looks like ComplexStr is doing it rwong 20:08
m: say (ComplexStr => 42)
camelia ComplexStr => 42
[Coke] misses having Readline for the REPL. :(
TimToady hmm 20:09
m: quietly say <a 1 2.3 4+1i 1/2 3 4 z>.classify: {.WHAT}
camelia {(RatStr) => [2.3 1/2], (IntStr) => [1 3 4], (ComplexStr) => [4+1i], (Str) => [a z]}
[Coke] DrForr: Do you have a mac? 20:10
20:11 TEttinger joined
TimToady m: say <a 1 2.3 4+1i 1/2 3 4 z>.classify: {Any} 20:11
camelia {(Any) => [a 1 2.3 4+1i 1/2 3 4 z]}
TimToady m: say <a 1 2.3 4+1i 1/2 3 4 z>.classify: {RatStr}
camelia {(RatStr) => [a 1 2.3 4+1i 1/2 3 4 z]}
TimToady m: say <a 1 2.3 4+1i 1/2 3 4 z>.classify: {ComplexStr}
camelia {(ComplexStr) => [a 1 2.3 4+1i 1/2 3 4 z]}
20:12 domidumont joined
TimToady m: say <a 1 2.3 4+1i 1/2 3 4 z>.classify: {(ComplexStr,RatStr).pick} 20:12
camelia Use of uninitialized value of type ComplexStr in string context.
Methods .^name, .perl, .gist, or .say can be used to stringify it to something meaningful.
{(RatStr) => [2.3 1/2 3], (ComplexStr) => [a 1 4+1i 4 z]}
in block <unit> at <tmp> line…
TimToady m: say <a 1 2.3 4+1i 1/2 3 4 z>.classify: {(IntStr,RatStr).pick}
camelia Use of uninitialized value of type IntStr in string context.
Methods .^name, .perl, .gist, or .say can be used to stringify it to something meaningful.
{(RatStr) => [a 1 4+1i 1/2 3 z], (IntStr) => [2.3 4]}
in block <unit> at <tmp> line 1
Use…
TimToady ,, 20:13
m: say <a 1 2.3 4+1i 1/2 3 4 z>.classify: {(IntStr,RatStr).pick}
camelia Use of uninitialized value of type IntStr in string context.
Methods .^name, .perl, .gist, or .say can be used to stringify it to something meaningful.
{(RatStr) => [2.3 1/2 3 4 z], (IntStr) => [a 1 4+1i]}
in block <unit> at <tmp> line 1
Use…
TimToady looks like it's in the rendering, since it's always the one that's sorted first
m: say <a 1 2.3 4+1i 1/2 3 4 z>.classify({.WHAT}).perl 20:14
camelia Use of uninitialized value of type RatStr in string context.
Methods .^name, .perl, .gist, or .say can be used to stringify it to something meaningful.
(my Any %{Any} = (RatStr) => $[RatStr.new(2.3, "2.3"), RatStr.new(0.5, "1/2")], (Str) => $["a",…
TimToady m: quietly say <a 1 2.3 4+1i 1/2 3 4 z>.classify({.WHAT}).perl 20:15
camelia (my Any %{Any} = (ComplexStr) => $[ComplexStr.new(<4+1i>, "4+1i")], (Str) => $["a", "z"], (RatStr) => $[RatStr.new(2.3, "2.3"), RatStr.new(0.5, "1/2")], (IntStr) => $[IntStr.new(1, "1"), IntStr.new(3, "3"), IntStr.new(4, "4")])
20:19 mcmillhj left 20:22 domidumont left 20:25 bdmatatu left 20:30 kerframil joined 20:32 s0me0n3-unkn0wn joined 20:33 patrickz joined 20:34 evalable6 left, evalable6 joined 20:35 s0me0ne-unkn0wn left 20:36 geospeck joined
patrickz Hey! I'm trying out cro with TLS. I'm using `cro stub` to initialize a project. `curl localhost:20000 -vvv` fails with an "NSS error -5938 (PR_END_OF_FILE_ERROR)". Does anyone have an idea where to look? 20:39
timotimo patrickz: how did you set up a private key for the ssl stuff? 20:40
patrickz I didn't... 20:41
timotimo maybe that error comes from no private key existing or something
patrickz There is a RESOURCES/fake-tls/ folder with three .pem files. I thought cro set up a working TLS environment... 20:42
perlpilot patrickz: it might be a curl problem. (at least I think I've heard of this with curl before) 20:44
timotimo oh, hmm 20:45
patrickz firefox fails just as well. Hm...
20:46 mcmillhj joined, evalable6 left, evalable6 joined, ChanServ sets mode: +v evalable6
AlexDaniel m: say 42; say 43 20:46
camelia 42
43
AlexDaniel eval: say 42; say 43
evalable6 42
43
tony-o m: 'tmp'.IO.dir.perl.say;
camelia Failure.new(exception => X::IO::Dir.new(path => "/home/camelia/tmp", os-error => "Failed to open dir: 2"), backtrace => Backtrace.new)
20:47 Cabanossi left, MasterDuke joined
jnthn patrickz: Try curl -k 20:48
tony-o m: '/tmp/xyz'.IO.spurt('hello'); '/tmp/xyz'.IO.modified.base(8).say; '/tmp/xyz'.IO.modified.DateTime.posix.base(8).say; 20:49
camelia 13207616572.10423124
13207616525
20:49 Cabanossi joined
tony-o is there a rounding reason those two don't somewhat agree^ ? 20:50
perlpilot tony-o: leap seconds would be my guess 20:54
(but 40-some-odd seconds does sound like a bit much)
timotimo m: say time - now 20:56
camelia -37.1266353130341
timotimo m: say [min] (time - now) xx 100
camelia -37.0678160190582
timotimo m: say [min] (time - now) xx 1000
camelia -37.579318523407
timotimo too fast %)
m: say [min] (time - now) xx 100_000
camelia Too many arguments in flattening array.
in block <unit> at <tmp> line 1
20:57
timotimo d'oh
patrickz jnthn: did that, gives the same result. That's the full output of `curl -kvvv` : gist.github.com/patzim/1549ad2b8d2...9aaca31da2
timotimo m: say reduce((time - now) xx 100_000, * min *)
camelia Cannot resolve caller reduce(Seq, WhateverCode); none of these signatures match:
(&with, + is raw)
in block <unit> at <tmp> line 1
timotimo m: say ((time - now) xx 100_000).reduce(&[min]) 20:58
camelia Too many arguments in flattening array.
in block <unit> at <tmp> line 1
timotimo m: say ((time - now) xx 100_000).reduce(* min *)
camelia -37.9999985694885
timotimo can i just say that "+ is raw" looks weird
20:59 unicodable6_ joined 21:00 unicodable6_ left 21:03 troys_ is now known as troys 21:06 Zoffix joined
Zoffix . 21:06
yoleaux 17:35Z <TimToady> Zoffix: yer also missing the 'meow $o:' form, which definitely belongs in your list
21:06 wamba left
Zoffix Added :) up to 43 ways no and I think I missed some safecall forms :) An Advent article is itching to be written :) 21:06
21:07 espadrine joined
Zoffix And on that topic.... what's the actual usecase for wanting to use `.+` method call? 21:07
21:08 cdg joined
Zoffix s/no/now/ 21:08
gfldex m: multi f(Int $i){ return .Str }; multi f(Num $i){ return .Str }; 42.&+f 21:12
camelia 5===SORRY!5=== Error while compiling <tmp>
Calling f() will never work with any of these multi signatures:
(Int $i)
(Num $i)
at <tmp>:1
------> 3}; multi f(Num $i){ return .Str }; 42.&+7⏏5f
s0me0n3-unkn0wn patrickz: Try to reproduce with HTTP::Server::Ogre. If the problem persists, it's some low level stuff with certificates/keys in IO::Socket::Async::SSL, which is common to Cro and HTTP::Server::Ogre. If the problem is gone, it's some problem initializing Cro, probably
gfldex m: multi f(Int $i){ return $i.Str }; multi f(Num $i){ return $i.Str }; 42.+&f
camelia ( no output )
Geth mu: 91762f3c70 | (Zoffix Znet)++ (committed using GitHub Web editor) | misc/perl6advent-2017/schedule
Add "There's a Madness to My Method" to list
21:13
21:13 bdmatatu joined
gfldex m: multi f(Str(Int) $i){ return $i.Str }; multi f(Str(Num) $i){ return $i.Str }; dd 42.+&f 21:13
camelia ("42",)
21:14 cdg_ joined
Zoffix gfldex: I know what it does, but I don't know why I'd want to do that 21:14
gfldex Zoffix: I'm quite sure at some point somebody will come up with a really clever use case. I'm also quite sure that somebody wont be me. :-> 21:15
Zoffix heh 21:16
jnthn patrickz: Hm, no idea. Haven't seen that before. I'd expect it to need -k to work, but to then work.
patrickz jnthn: I'll look into it further, given it also fails on my RPi (on which I haven't tried yet, and which is where I need it...) 21:17
tony-o that would be useful in tar for padding base 8 numbers ..
21:17 cdg left
jnthn patrickz: I presume a curl of some other HTTPS service works? 21:18
I'm guessing yes but
* Initializing NSS with certpath: sql:/etc/pki/nssdb
* NSS error -5938 (PR_END_OF_FILE_ERROR)
I'm wondering what end of file it reached...
My guess is "socket was closed unexpectedly"
Zoffix tony-o: the method call? Got a code example I could steal? 21:20
tony-o working on a tar pp module rn, give me a few and i'll post it 21:21
patrickz I tried it with wireshark, and there it looked like clean connection shutdown. I don't have much raw connection reading skills though...
tony-o trying to figure out how to get the file owner name
Zoffix \o/
21:23 mson left, evalable6 left
patrickz jnthn: That's what it looks in wireshark: >[SYN] <[SYN,ACK] >[ACK] >[PSH, ACK] <[ACK] <[FIN, ACK] >[FIN,ACK] <[ACK] 21:25
21:27 uheue left 21:28 Ven joined, Ven is now known as Guest67933
geospeck is there any way to get the method's signature? for example if I know the methods name and I want to see what params accepts 21:29
21:29 astronavt joined
gfldex geospeck: see: docs.perl6.org/type/Method#(Code)_..._signature 21:29
Zoffix m: "".^lookup('split').candidates>>.signature.say 21:30
camelia ((Str:D $: Regex:D $pat, $limit is copy = Inf;; :$v is copy, :$k, :$kv, :$p, :$skip-empty, *%_) (Str:D $: Cool $match;; :$v is copy, :$k, :$kv, :$p, :$skip-empty, *%_) (Str:D $: Cool $match, $limit is copy = Inf;; :$v is copy, :$k, :$kv, :$p, :$skip-e…
geospeck yep, that works, thanks guys! 21:32
tony-o m: sub r (Str $x, Int $y) { }; say &r.signature.params.perl;
camelia (Str $x, Int $y)
patrickz is off to bed.
Thanks so far everyone! 21:33
tony-o m: sub r (Str $x, Int $y) { }; say &r.signature.params.perl; say &r.^name
camelia (Str $x, Int $y)
Sub
tony-o oop
21:33 patrickz left
tony-o m: sub r (Str $x, Int $y) { }; say &r.signature.params.perl; say &r.^name 21:33
camelia (Str $x, Int $y)
Sub
tony-o m: sub r (Str $x, Int $y) { }; say &r.signature.params.perl; say &r.name
camelia (Str $x, Int $y)
r
geospeck > "".^lookup('say').candidates>>.signature.say
((Mu $: *%_))
> &say.signature
(| is raw)
why is different?
21:34 bdmatatu left
geospeck or | == *%_ 21:34
Zoffix geospeck: without candidates you get the proto
tony-o ^ 21:35
geospeck oh I see
Zoffix no, | is a capture, *%_ is a named param slurpy
geospeck thanks Zoffix!
Zoffix geospeck: above you're looking up different routines though. .^lookup is a metamethod, so you're looking up method 'say' on Str object, whereas the second call gives you the &say subroutin 21:37
e
21:38 BrianOn99 joined
geospeck I think I need the second one 21:38
21:40 stmuk_ joined
tony-o Zoffix: you know of a way to get the uname from the uid in pp6 or nqp ?? 21:41
21:42 stmuk left 21:43 BrianOn99 left, kitsunenokenja joined
Zoffix tony-o: no idea what those are 21:46
21:48 mcmillhj left, geospeck left 21:49 someuser left
perlpilot tony-o: you mean uid, uname as "user id" and "user name"? If so, you may need to use NativeCall to get at the getpwuid() routine 21:49
21:50 astronavt left, astronavt joined 21:51 astronavt left
tony-o ah 21:53
perlpilot: have you used that in windows at all? is that comp?
perlpilot oh, no. I don't generally use Windows. 21:57
tony-o perlpilot: ty!
perlpilot I'd guess that there's some other routine that you'd use though.
Zoffix calls it a day
But I'll check the backlog for any ideas for examples of the `.+` methodcall op tomorrow
perlpilot maybe look to Perl 5 and the Win32 namespace to see what's done there?
perigrin There should be a POSIX call for that I think and win32 has been vaguely POSIX complient for a while 21:58
perhaps not 21:59
21:59 evalable6 joined
perigrin I may be vastly overesitmating posix 21:59
21:59 niceperl joined 22:00 bisectable6 left, committable6 left, bisectable6 joined, ChanServ sets mode: +v bisectable6, committable6 joined
perlpilot looks like getpwuid() is in POSIX, so ... maybe? 22:01
tony-o: where did you get the uid in the first place?
22:02 Cabanossi left 22:04 Cabanossi joined
AlexDaniel squashable6: next 22:09
squashable6 AlexDaniel, ⚠🍕 Next SQUASHathon in 1 day and ≈11 hours (2017-12-02 UTC-12⌁UTC+14). See github.com/rakudo/rakudo/wiki/Mont...Squash-Day
22:10 bloatable6 left 22:11 astj joined
s0me0n3-unkn0wn patrickz: I initialized cro stub and after that 22:11
patrickz: # HELLO_HOST=localhost HELLO_PORT=20000 HELLO_TLS_KEY=/etc/ssl/private/ssl-cert-snakeoil.key HELLO_TLS_CERT=/etc/ssl/certs/ssl-cert-snakeoil.pem perl6 -Ilib service.p6
22:11 titsuki joined
s0me0n3-unkn0wn patrickz: (As root, to gain access to /etc/ssal/private; paths are standard Ubuntu certificate/key generated when system is installed) 22:12
patrickz: After that, I can access localhost:20000 with curl 22:13
22:13 titsuki_ left 22:14 jeromelanteri left 22:15 astj left, Ven joined 22:16 Ven is now known as Guest70676, Guest67933 left 22:23 rindolf left
japhb s0me0n3-unkn0wn: But the fake-tls key/cert didn't work for you? 22:23
tony-o perlpilot:
m: use nqp; my $io = '/tmp/xyz'.IO; $io.spurt('test'); nqp::stat($io.absolute, 10); 22:24
camelia ( no output )
tony-o m: use nqp; my $io = '/tmp/xyz'.IO; $io.spurt('test'); nqp::stat($io.absolute, 10).say;
camelia 1012
tony-o m: use nqp; my $io = '/tmp/xyz'.IO; $io.spurt('test'); nqp::stat($io.absolute, 11).say; #gid 22:25
camelia 100
s0me0n3-unkn0wn japhb: It didn't, should it? %?RESOURCES<fake-tls/server-key.pem> gives Nil to me 22:26
22:27 jeromelanteri joined
japhb s0me0n3-unkn0wn: Does the file exist? I wonder if there's just a bug in finding it. 22:28
22:29 evalable6 left, evalable6 joined 22:30 bisectable6 left, committable6 left, bisectable6 joined, ChanServ sets mode: +v bisectable6, committable6 joined, ChanServ sets mode: +v committable6
s0me0n3-unkn0wn japhb: How do I know if %?RESOURCES<fake-tls/server-key.pem> is Nil? Sorry, I'm not to good in P6 resources yet 22:35
22:35 margeas joined 22:36 markong left 22:41 konsolebox left 22:43 konsolebox joined 22:46 setty1 left
s0me0n3-unkn0wn japhb: Well, I found out that %?RESOURCES is also Nil :) 22:47
timotimo that could happen when you don't have a META6.json perhaps? 22:48
tyil if it doesnt appear in the META6.json's resources key, it'll be Nil afaik
or if the file doesn't exist in the resources dir
japhb Should be set up here in the sub template: github.com/croservices/cro/blob/ma...#L205-L207 22:49
tyil also, there's no :exists available on %?RESOURCES to check whether a file is set in the resources, I have looked at possibly adding that, but couldn't think up of a clean way to do it 22:50
s0me0n3-unkn0wn It does exit in filesystem and in META6.json but it is uppercase in filesystem and lowercase in META6.json, I don't know it that matters
tyil I think that will matter, as filesystems are usually case sensitive 22:51
s0me0n3-unkn0wn Mine ext4 is case-sensitive definitely :)
22:51 troys is now known as troys_
SmokeMachine m: use Test; my (@even,@odd); lives-ok { (:@even, :@odd) := classify { $_ % 2 ?? "odd" !! "even" }, 1,2,3,4}, "Can bind result list of classify"; 22:54
camelia 5===SORRY!5=== Error while compiling <tmp>
Cannot use bind operator with this left-hand side
at <tmp>:1
------> 3y { $_ % 2 ?? "odd" !! "even" }, 1,2,3,47⏏5}, "Can bind result list of classify";
expecting any of:
postfi…
SmokeMachine m: use Test; my (@even,@odd); lives-ok { (:@even, :@odd) := classify { $_ % 2 ?? 'odd' !! 'even' }, 1,2,3,4}, 'Can bind result list of classify'; 22:56
camelia 5===SORRY!5=== Error while compiling <tmp>
Cannot use bind operator with this left-hand side
at <tmp>:1
------> 3y { $_ % 2 ?? 'odd' !! 'even' }, 1,2,3,47⏏5}, 'Can bind result list of classify';
expecting any of:
postfi…
SmokeMachine github.com/perl6/roast/blob/fca87f...sify.t#L50
22:59 evalable6 left, evalable6 joined 23:00 bisectable6 left, committable6 left, bisectable6 joined, committable6 joined
AlexDaniel propdump: Ⅹ 23:05
unicodable6 AlexDaniel, gist.github.com/9b75baef6d702454d6...3d47e28358
23:12 sena_kun left 23:15 donaldh left, donaldh_ joined, Guest70676 left 23:16 donaldh_ is now known as donaldh 23:25 huf left 23:28 kyan left 23:29 troys_ is now known as troys, evalable6 left, evalable6 joined 23:30 bisectable6 left, committable6 left, bisectable6 joined, committable6 joined, ChanServ sets mode: +v committable6 23:52 llfourn left 23:55 cdg_ left 23:56 cdg joined 23:58 pilne joined 23:59 evalable6 left, evalable6 joined