»ö« 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