»ö« Welcome to Perl 6! | perl6.org/ | evalbot usage: 'perl6: say 3;' or rakudo:, niecza:, std:, or /msg camelia perl6: ... | irclog: irc.perl6.org/ | UTF-8 is our friend! Set by diakopter on 14 April 2013. |
|||
adu | maybe it's not fixed | 00:27 | |
00:36
thou joined
00:40
rindolf joined
00:45
adu left
00:46
hlin_laptop joined
|
|||
lue | rn: my @a = [1,2],[3,4]; say @a[0;0]; | 01:13 | |
camelia | niecza v24-37-gf9c8fc2: OUTPUT«1» | ||
..rakudo 71ea14: OUTPUT«WARNINGS:Useless use of constant integer 0 in sink context (line 1)1 2» | |||
01:29
thou left
01:31
dayangkun joined
01:38
FROGGS__ joined
01:40
FROGGS_ left
01:56
berekuk left
02:22
lustlife joined
02:31
frdmn joined
02:39
orafu left,
orafu joined
02:50
rindolf left
04:01
toddr joined
04:02
Ben_Goldberg left
04:04
toddr_ left
|
|||
gtodd | m: my @a = [1,2],[3,4]; say @a[0;0]; | 04:15 | |
geekosaur | it's not "m", its "rn" (r, n; also "nr" will work, I think) | 04:18 | |
04:19
kaare_ joined,
saxx joined
|
|||
geekosaur | (you can also toss in 'p' to try it in pugs as well as rakudo and niecza, although at this point pugs is pretty far behind the others) | 04:19 | |
lue | .oO(Keming strikes again!) |
04:22 | |
geekosaur | they look remarkably similar in the font I use, actually; I had to select it to verify | ||
gtodd | ha | 04:23 | |
are: my @a = [1,2],[3,4]; say @a[0;0]; | |||
doh! | |||
autospellcheck | |||
r: my @a = [1,2],[3,4]; say @a[0;0]; | 04:24 | ||
camelia | rakudo 71ea14: OUTPUT«WARNINGS:Useless use of constant integer 0 in sink context (line 1)1 2» | ||
gtodd | n: my @a = [1,2],[3,4]; say @a[0;0]; | ||
camelia | niecza v24-37-gf9c8fc2: OUTPUT«1» | ||
04:24
Psyche^ joined
|
|||
lue | looks to me like [0;0] is interpreted as a list of statements as opposed to a semicolon list like it should | 04:25 | |
TimToady | yes, rakudo doesn't implement slice syntax yet | ||
n: my @a = [1,2],[3,4]; say @a[1;*-1] | |||
camelia | niecza v24-37-gf9c8fc2: OUTPUT«4» | ||
TimToady | well, multi-dim syntax really | 04:26 | |
lue | S09 has always been a weak point in rakudo :/ | 04:27 | |
04:28
Patterner left,
Psyche^ is now known as Patterner
|
|||
TimToady | it probably wouldn't be too hard to at least do that, given rakudo already has ** binding | 04:29 | |
06:17
SamuraiJack joined
06:28
saxx left
06:39
adu joined
06:50
fgomez left
|
|||
adu | jnthn: are you awake yet? | 07:11 | |
it's not Str that's broken, it's try-CATCH that's broken | 07:12 | ||
nqp: try { nqp::die("hello"); CATCH { say("# ERROR: $_"); } } | |||
camelia | nqp: OUTPUT«# ERROR: hello» | ||
adu | nqp-jvm: try { nqp::die("hello"); CATCH { say("# ERROR: $_"); } } | ||
camelia | nqp-jvm: OUTPUT«Exception in thread "main" Exception: java.lang.NoClassDefFoundError thrown from the UncaughtExceptionHandler in thread "main"» | ||
labster | adu: jnthn isn't usually awake until about 2am | 07:18 | |
adu | labster: well it's 3:20am for me | 07:19 | |
labster: what timezone are you? | |||
FROGGS__ | it is 9:19 a.m. at jnthn place | ||
labster | California. 12:20 here | ||
adu | so 11 jnthn-time | ||
labster | \o FROGGS__ | ||
FROGGS__ | morning | 07:20 | |
07:20
FROGGS__ is now known as FROGGS
|
|||
adu | good morning | 07:20 | |
jnthn sent me on a wild goose chase :) | |||
FROGGS | adu: well, tracking it down to try+catch is good, you just need to fix that instead :P | 07:21 | |
adu | I have no idea where CATCH is implemented | ||
FROGGS | well, grep for CATCH? | ||
labster | that's what I tend to do. | 07:22 | |
FROGGS | it should be in the Actions and should produce some AST, maybe has its own op | ||
and then you have to see how this op/AST is handled | |||
i.e. to what it compiles to | 07:23 | ||
adu | but nqp-jvm t/nqp/44-try-catch.t passes | ||
hmm | |||
FROGGS | weird | ||
maybe this try/catch isnt available at that time? | 07:24 | ||
adu | I'm going to add some more test cases | 07:26 | |
I really don't understand this test file | 07:29 | ||
try and catch are never used together | |||
I see try blocks in some test cases | |||
and I see CATCH handlers in other test cases | 07:30 | ||
labster | sounds like an excellent idea, adu. | ||
Well, all of the fun stuff like IO::Path::Win32 is finally working in the core. | |||
adu | but I mean every language I know of requires try is paired with catch | 07:31 | |
FROGGS | nqp-jvm: try { nqp::die("hello") } | ||
camelia | nqp-jvm: ( no output ) | ||
adu | and I think that anyone migrating from those languages is going to use both try & catch without thinking about it | ||
FROGGS | nqp-jvm: CATCH { say($_); } | ||
camelia | nqp-jvm: ( no output ) | 07:32 | |
FROGGS | I am a bit curious about that java.lang.NoClassDefFoundError | ||
labster | > IO::Path::Win32.new("C:\\foo\\bar\\").parent # yields IO::Path::Win32<C:\foo> | ||
FROGGS | labster++ | 07:33 | |
that's is a great plus for rakudo | |||
adu | t/qregex/01-qregex.t uses both try and CATCH, which is (I believe) why it's failing | 07:34 | |
why is CATCH uppercase? | 07:41 | ||
labster | it's a builtin block, like LAST or BEGIN | 07:44 | |
I'm not entirely sure how to go about the testing for IO::Path, though. The backend is all in IO::Spec now, which is ironically not specced. | 07:46 | ||
adu | sounds awk-inspired | ||
labster | I think I might need to add it into the spec, but I'm not sure. | 07:47 | |
adu: who got awk in my perl? | 07:48 | ||
adu | probably the designer | 07:49 | |
are module, class, grammar blocks? | 07:50 | ||
FROGGS | adu: CATCH is like a phaser, and all phasers are uc | 07:52 | |
labster | ah yes, phaser was the word | ||
r: my $g = anon grammar foo { }; say $g ~~ Block; | 07:54 | ||
camelia | rakudo 71ea14: OUTPUT«False» | ||
labster | I guess not. | ||
adu | r: my $g = anon grammar foo { }; say $g ~~ CompUnit; | ||
camelia | rakudo 71ea14: OUTPUT«===SORRY!===Undeclared name: CompUnit used at line 1» | ||
FROGGS | labster: does it matter that the backend isnt specced? if the "frontend" is specced then this must work as described | ||
adu: these are packages | 07:55 | ||
adu | r: my $g = anon grammar foo { }; say $g ~~ Package; | ||
camelia | rakudo 71ea14: OUTPUT«===SORRY!===Undeclared name: Package used at line 1» | ||
FROGGS | grammar is more like a class then a module though | ||
adu | r: my $g = anon grammar foo { }; say $g ~~ Module; | ||
camelia | rakudo 71ea14: OUTPUT«===SORRY!===Undeclared name: Module used at line 1» | ||
labster | I suppose so, but all of the tests are written for File::Spec already :P | 07:56 | |
adu | labster: how can you use Block? | ||
labster | r: use Block; | ||
camelia | rakudo 71ea14: OUTPUT«===SORRY!===Could not find Block in any of: /home/p6eval/nom-inst/lib/parrot/5.2.0-devel/languages/perl6/site/lib, /home/p6eval/nom-inst/lib/parrot/5.2.0-devel/languages/perl6/vendor/lib, /home/p6eval/nom-inst/lib/parrot/5.2.0-devel/languages/perl6/lib, /home/p6ev… | ||
FROGGS | adu: what do you mean by "use a block" ? | ||
adu | r: my $g = anon grammar foo { }; say $g ~~ Block; | ||
camelia | rakudo 71ea14: OUTPUT«False» | ||
adu | like that | 07:57 | |
FROGGS | r: my $g = anon grammar foo { }; g.parse( "abc" ) | ||
camelia | rakudo 71ea14: OUTPUT«===SORRY!===Undeclared routine: g used at line 1» | ||
FROGGS | r: my $g = anon grammar foo { }; $g.parse( "abc" ) | ||
labster | r: my $g := { say 'hi there'; } ; say $g ~~ Block; | ||
camelia | rakudo 71ea14: OUTPUT«No such method 'TOP' for invocant of type 'foo' in method parse at src/gen/CORE.setting:11162 in block at /tmp/sNBmcz3njr:1» | ||
rakudo 71ea14: OUTPUT«True» | |||
adu | my question stemed from the use of Block as some builtin type, but I can't find any builtin type for packages | 07:58 | |
labster | r: my $g := { say 'hi there'; } ; say $g ~~ Block; $g(); | ||
camelia | rakudo 71ea14: OUTPUT«Truehi there» | ||
FROGGS | r: my $g := { say 'hi there'; }; $g() | ||
camelia | rakudo 71ea14: OUTPUT«hi there» | ||
FROGGS | right | ||
07:58
drbean left
|
|||
FROGGS | adu: my $g = anon grammar foo { }; creates an anon object of grammar (like class) foo | 07:59 | |
so it isnt a block, it is an object | |||
so you can call methods on it, like parse | |||
adu | r: my $g = anon grammar foo { }; say $g ~~ Mu; | 08:00 | |
camelia | rakudo 71ea14: OUTPUT«True» | ||
adu | yey it's a Mu | ||
08:00
drbean joined,
rindolf joined
|
|||
FROGGS | if you have a real block, you have to call it, like $g(), you will see that in the AST often... ( :op('call'), $block ) | 08:00 | |
adu: doc.perl6.org/images/type-graph-Cool.png | 08:02 | ||
it doesnt tell you much that it is Mu | 08:03 | ||
adu | I know it stands for "most undefined" | ||
what's Cool? | 08:04 | ||
FROGGS | I guess doc.perl6.org can tell you more about that then I can :/ | 08:05 | |
adu | ah, Cool is the supertype for magic conversions | 08:07 | |
08:08
Chillance joined
|
|||
labster | Mu stands for 無. | 08:12 | |
08:13
sciurius joined
08:22
crab2313 joined
|
|||
cognominal | in nqp, what is the equivalent of : %h<+> := &int-ctor; It say First child of a 'bind' op must be a QAST::Var | 08:29 | |
what is the nqp:: pseudo function I should use? | |||
diakopter | %h{'+'} | 08:30 | |
sorear | nqp: my %h; %h<+> := 2; | ||
camelia | nqp: ( no output ) | ||
sorear | nqp: my %h; %h{'+'} := 2; | ||
camelia | nqp: ( no output ) | ||
sorear | nqp: my %h; say(3) := 2; | ||
camelia | nqp: OUTPUT«Error while compiling block : Error while compiling op bind (source text: ":="): First child of a 'bind' op must be a QAST::Varcurrent instr.: '' pc 48819 (src/stage2/QAST.pir:17874) (src/stage2/QAST.nqp:2988)» | ||
sorear | cognominal: that ought to work... | 08:31 | |
cognominal | nqp: class A { my %h; %h{'+'} := 1 } | 08:32 | |
camelia | nqp: ( no output ) | ||
08:33
crab2313 left
|
|||
cognominal | nqp: class A { my %h; %h{'+'} := -> $_ { $_ } } | 08:34 | |
camelia | nqp: ( no output ) | ||
dalek | : 1b8439e | (Tobias Leich)++ | / (2 files): fixed q, qq and friends |
08:40 | |
masak | antenoon, #perl6 | 08:44 | |
08:44
tgt joined
08:46
adu left
|
|||
FROGGS | hi masak | 08:50 | |
08:53
betterworld joined,
berekuk joined
08:55
berekuk left,
berekuk joined
|
|||
lizmat | good post morpheus, #perl6 | 08:56 | |
masak | and what a morpheus it was! | 08:57 | |
FROGGS | ? | ||
hi lizmat | |||
masak | FROGGS: "...is the god of dreams." en.wikipedia.org/wiki/Morpheus_(mythology) | 08:58 | |
FROGGS | ahhh, yeah, of course | ||
09:08
spider-mario joined
09:11
dayangkun left
09:14
kaare__ joined
09:15
kaare_ left
|
|||
lizmat wonders where .WHAT is really specced | 09:17 | ||
S06:2275 | 09:18 | ||
diakopter | at one point it described it as macro-y | ||
lizmat | actually: S12:2275 | 09:19 | |
2289: "These are all actually macros, not true operators or methods." | 09:20 | ||
diakopter | yes | 09:22 | |
09:22
sad joined,
sad left
|
|||
lizmat | rn: { say $^x + $^x }(5) | 09:23 | |
diakopter | I bet you search the clogs for WHAT and macro using google you can find more context | ||
camelia | rakudo 71ea14, niecza v24-37-gf9c8fc2: OUTPUT«10» | ||
FROGGS | std: use v5; require q(./test.pl) # :o( | ||
camelia | std 86b102f: OUTPUT«===SORRY!===Unable to parse parenthesized expression at /tmp/elsoYIAf1n line 1:------> use v5; require q⏏(./test.pl) # :o(Couldn't find final ')'; gave up at /tmp/elsoYIAf1n line 1:------> use v5; require q(⏏./t… | ||
lizmat | would it make sense to add a pattern like "{ say $^x + $^x }(5)" as one of the examples at S04:693 ? | 09:26 | |
masak | lizmat: yes, think so. | 09:27 | |
lizmat: re "These are all actually macros" -- I've yet to see exactly *how* they are macros. in some places in and outside the spec, "they are macros" means "they get special treatment during compilation, and have thunk-like behavior". | 09:28 | ||
lizmat | I thought so, as macros aren't really implemented yet, right | 09:29 | |
? | |||
diakopter | marco | ||
lizmat | but if macro's would have been implemented, would they be macro's? Or still something else? | 09:30 | |
dalek | pan style="color: #395be5">perl6-examples: b3c75b3 | (L. Grondin)++ | rosalind/mmch-grondilu.pl: rename mmch |
||
09:31
kaare__ left
|
|||
diakopter | iirc, they were speculated as macros at the very beginning of designing 6model | 09:31 | |
dalek | : 8dcbdfa | (Tobias Leich)++ | / (2 files): we can haz summary! |
||
pan style="color: #395be5">perl6-examples: d5f05a4 | (L. Grondin)++ | rosalind/grondilu-mmch.pl: remove grondilu-mmch |
|||
diakopter | I think the reasoning was so that the compiler could generate the right "WHAT" for things like primitive types | 09:32 | |
dalek | ecs: 3acfeda | (Brent Laabs)++ | S32-setting-library/IO.pod: update IO::Path and IO::FileTests, OS-specific IO::Path::* rm $.path from filetests and define modified/changed/created/accessed add IO::Path::Unix, IO::Path::Win32, IO::Path::Cygwin |
||
diakopter | and exotic other things | ||
09:33
tgt left
|
|||
lizmat | masak: +It's not an error to pass parameters to such a block either: | 09:37 | |
+ | |||
+ { say $^x + $^x }(5); | |||
+ | |||
masak | looks good. | 09:38 | |
FROGGS | { say $^x + $^x }(5, 6); # but they must be used | ||
r: { say $^x + $^x }(5, 6); # but they must be used | |||
camelia | rakudo 71ea14: OUTPUT«Too many positional parameters passed; got 2 but expected 1 in block at /tmp/STO4LxS8Ya:1» | ||
masak | r: macro twice($stmt) { quasi { {{{$stmt}}}; {{{$stmt}}}; } }; twice say "OH HAI" | 09:39 | |
camelia | rakudo 71ea14: OUTPUT«OH HAIOH HAI» | ||
masak | lizmat: macros are implemented, and work. | ||
lizmat: they're incomplete, and still buggy, but they're there. | |||
diakopter | they do some things, but not all the things | ||
masak | lizmat: to the extent *I* understand what macros are, I don't understand how .WHAT is a macro. | ||
lizmat | hehe… okokok :-) | 09:40 | |
I guess "aren't really implemented yet" was a gross overstatement | |||
my apologies | |||
FROGGS: good point | |||
masak | as a lazy git, I'm insulted! :P | ||
09:41
tgt joined
|
|||
masak | lizmat: srsly though, no worries. my point was more that we *do* have some understanding of macros already. | 09:41 | |
lizmat: but the terminology in general, and the use of the term "macro" in particular, are sometimes very confusing. | |||
lizmat | FROGGS: but isn't that a more general issue? | 09:42 | |
masak: s/These are all actually macros/These actually all behave like macros/ ? | |||
FROGGS | lizmat: yes, but it was a bit surprising to me when I first come to that | 09:43 | |
lizmat | ack | ||
09:44
berekuk left
|
|||
masak | lizmat: I'd actually prefer if we left the word "macro" alone for that meaning. | 09:44 | |
lizmat: something like "These all actucally have BEGIN-time semantics" seems to capture it just as well. | 09:45 | ||
(no-one goes around calling BEGIN {} a "macro", do they) :) | |||
diakopter | agree ^^ "something like.." | ||
masak | while we're on the topic, I think it's ridiculous to call infix:<&&> a "macro". | 09:47 | |
lizmat | well, the chapter "Introspection" at S12:2271 will need some rewriting then, as the word "macro" occurs a lot in there | ||
masak | it's just a short-circuiting operator. if we start to call short-circuiting operators "macros", it's not because we understand macros well, it's because we understand short-circuiting operators badly :) | 09:48 | |
lizmat | I will keep that in mind when starting to grok S12 | 09:50 | |
meanwhile: masak/Froggs: +But as always, you must use them all: | |||
+ | |||
+ # Syntax error: Too many positional parameters passed | |||
+ { say $^x + $^x }(5,6); | |||
+ | |||
masak | "These are all actually macros, not true operators or methods." -- this sentence reveals another confusion. "macro" and "(true) operator" are orthogonal concepts. | 09:51 | |
r: say Macro.^mro | |||
camelia | rakudo 71ea14: OUTPUT«(Macro) (Routine) (Block) (Code) (Any) (Mu)» | ||
masak | r: say Sub.^mro | ||
camelia | rakudo 71ea14: OUTPUT«(Sub) (Routine) (Block) (Code) (Any) (Mu)» | ||
masak | r: say &infix:<+>.^name | ||
camelia | rakudo 71ea14: OUTPUT«Sub+{<anon>}+{Precedence}» | ||
lizmat likes introspection | |||
masak | macros are routines. operators are subs are routines. | ||
macros can be operators. | 09:52 | ||
(hm, in which case they'd not be subs, but still routines) :) | |||
r: macro infix:<!+!>($a, $b) { quasi { 42 } }; say 4 !+! 2 | |||
camelia | rakudo 71ea14: OUTPUT«42» | ||
masak | r: macro infix:<!+!>($a, $b) { quasi { 42 } }; say &infix:<!+!>.^name | ||
camelia | rakudo 71ea14: OUTPUT«Macro+{Precedence}» | 09:53 | |
masak | r: macro infix:<!+!>($a, $b) { quasi { 42 } }; say &infix:<!+!>.^mro | ||
camelia | rakudo 71ea14: OUTPUT«(Macro+{Precedence}) (Macro) (Routine) (Block) (Code) (Any) (Mu)» | ||
masak had personally missed that '+{Precedence}' part | |||
interesting. | |||
cognominal | In the doc, except in the macro section, macro seems to mean, "it looks like a method or a function but it is implemented otherwise" | 09:54 | |
masak | yeah. which is a pity. | 09:58 | |
(because macros are fairly well-defined.) | |||
macros are routines that execute as soon as their argument list has been parsed. they accept ASTs or program strings as paramters, and they emit ASTs or program strings. | 10:00 | ||
10:00
berekuk joined
|
|||
dalek | ecs: 432411a | (Elizabeth Mattijsen)++ | S04-control.pod: Additional examples in "Statement-level bare blocks" |
10:01 | |
cognominal | masak: but I interpret that, maybe wrongly, as "they should have been written as macro, if macro were available at the time it was written." | 10:03 | |
masak | yes, and my point is that that's not true. | 10:05 | |
or if that's true, the mechanism by which it is true eludes me. | |||
in some sense it feels like the burden of proof rests on the one claiming that .WHAT is a macro, to show an example implementation of it. because I don't see it. | 10:06 | ||
diakopter | masak: my point above was that if the compiler knows the variable or expression results in a value of native type, then it can't have a 6model .WHAT method called on it, per se... if the compiler is treating it as a more ethereal "variable"/"memory location" and not a scalar container (if it's able to assume as such for optimization purposes) | 10:07 | |
... so the macro would generate the thing that returned the right type for that primitive type | 10:08 | ||
I suspect that was the motivation between the handwavey macroization | |||
er, *behind | 10:09 | ||
lizmat | rn: my $a="WHAT"; say { 1 }.$a | 10:10 | |
camelia | rakudo 71ea14: OUTPUT«No such method 'postcircumfix:<( )>' for invocant of type 'Str' in block at /tmp/i_vlrVN1ld:1» | ||
..niecza v24-37-gf9c8fc2: OUTPUT«Unhandled exception: Unable to resolve method postcircumfix:<( )> in type Str at /tmp/a2r78Stc2A line 1 (mainline @ 4)  at /home/p6eval/niecza/lib/CORE.setting line 4299 (ANON @ 3)  at /home/p6eval/niecza/lib/CORE.setting line 4300 (module-CORE @ 583… | |||
lizmat | according to spec, this should work. Which also means to me that .WHAT is *not* a macro | ||
as this would be purely runtime, no? | 10:11 | ||
diakopter | well there was always going to be a WHAT method behind the scenes anyway on things that could have methods | 10:12 | |
lizmat | rn: my $a="say"; { 1 }.$a | 10:14 | |
camelia | niecza v24-37-gf9c8fc2: OUTPUT«Unhandled exception: Unable to resolve method postcircumfix:<( )> in type Str at /tmp/zm2lCnveie line 1 (mainline @ 4)  at /home/p6eval/niecza/lib/CORE.setting line 4299 (ANON @ 3)  at /home/p6eval/niecza/lib/CORE.setting line 4300 (module-CORE @ 583… | ||
..rakudo 71ea14: OUTPUT«No such method 'postcircumfix:<( )>' for invocant of type 'Str' in block at /tmp/mrZvm7Q8cW:1» | |||
lizmat | rn: { 1 }.say | 10:15 | |
camelia | niecza v24-37-gf9c8fc2: OUTPUT«{ ... }» | ||
..rakudo 71ea14: OUTPUT«Block.new()» | |||
10:16
SamuraiJack left
|
|||
lizmat | brb | 10:16 | |
FROGGS | hmmm, should be easy to fix that | 10:21 | |
rn: { 1 }."say" | |||
camelia | niecza v24-37-gf9c8fc2: OUTPUT«===SORRY!===Unsupported use of . to concatenate strings or to call a quoted method; in Perl 6 please use ~ to concatenate, or if you meant to call a quoted method, please supply the required parentheses at /tmp/EUU2bnMD48 line 1 (EOF):… | ||
..rakudo 71ea14: OUTPUT«===SORRY!===Quoted method name requires parenthesized arguments. If you meant to concatenate two strings, use '~'.at /tmp/2w4O_MZmDP:1------> { 1 }."say"⏏<EOL>» | |||
10:25
hlin_laptop left
|
|||
lizmat | rn: say { 1 }.WHAT; my $a="WHAT"; eval "say { 1 }.$a" | 10:25 | |
camelia | rakudo 71ea14, niecza v24-37-gf9c8fc2: OUTPUT«(Block)(Int)» | ||
diakopter | heh. | ||
lizmat | even shorter: | 10:26 | |
say { 1 }.WHAT; eval "say { 1 }.WHAT" | |||
rn: say { 1 }.WHAT; eval "say { 1 }.WHAT" | |||
camelia | rakudo 71ea14, niecza v24-37-gf9c8fc2: OUTPUT«(Block)(Int)» | ||
lizmat | rn: say { 1 }.WHAT; eval 'say { 1 }.WHAT' | 10:27 | |
camelia | rakudo 71ea14, niecza v24-37-gf9c8fc2: OUTPUT«(Block)(Block)» | ||
lizmat | aha, interpolation, of course… :-) | ||
jnthn | Afternoon, #perl6 | ||
lizmat | jnthn++ ! | 10:28 | |
dalek | : 866a4aa | (Tobias Leich)++ | / (2 files): this should fix: require q("./test.pl") |
10:29 | |
jnthn | .WHAT is compiled go a low-level operation of the implementation's choosing. Same with .HOW. They aren't methods. | ||
FROGGS | hi jnthn | 10:30 | |
jnthn | They're handled inside of the compiler. Some may say that makes them macros. I don't care if you call them magical unicorn sugar puffs. | ||
o/ FROGGS, lizmat | |||
lizmat | ah, the infamous musp's ! | 10:31 | |
10:31
berekuk left
|
|||
jnthn | I suspect if the spec says "macro" about them it doesn't literally mean the CORE.setting has a macro WHAT or so. | 10:31 | |
lizmat | jnthn: but they also exist as runtime method, no? | ||
jnthn | No. | ||
Not at the moment, anyway. We could add them as methods but you'd barely reach them. | 10:32 | ||
lizmat | so anything like: $a="WHAT", { 1 }.$a would never work? | ||
jnthn | Well, that means "WHAT"({ 1 }) which means you're trying to invoke a string :) | ||
lizmat | (the spec seems to imply that they would) | ||
10:33
woosley left
|
|||
jnthn | $a = "WHAT"; { 1 }."$a"() could work if we did also put method WHAT etc. somewhere. | 10:33 | |
Where does it say they should work, ooc? | |||
If they do then they'll be method WHAT() { self.WHAT } :) | |||
lizmat | then I guess S12:2298 is in error | 10:34 | |
jnthn | looking | ||
10:35
tgt left
|
|||
jnthn | lizmat: That bit of S12 is talking about how to bypass the fact that .WHAT and friends are treated specially. | 10:35 | |
But I think that: | |||
And if you don't know the method name in advance, you'd be using the | |||
variable form anyway: | |||
$obj.$somemeth | |||
...could be clarified as: | |||
10:36
tgt joined
|
|||
jnthn | $obj."$somemethname"() # where $somemethname is a method name | 10:36 | |
$obj.$somemeth # where $somemeth is a method object | |||
Or so | |||
diakopter | rn: my $a="WHAT"; say { 1 }."$a"() | 10:37 | |
lizmat | hmmm… ok | ||
camelia | niecza v24-37-gf9c8fc2: OUTPUT«Unhandled exception: Unable to resolve method WHAT in type Block at /tmp/0lhf4RSQLo line 1 (mainline @ 4)  at /home/p6eval/niecza/lib/CORE.setting line 4299 (ANON @ 3)  at /home/p6eval/niecza/lib/CORE.setting line 4300 (module-CORE @ 583)  at /home… | ||
..rakudo 71ea14: OUTPUT«No such method 'WHAT' for invocant of type 'Block' in block at /tmp/slbEKeSkqY:1» | |||
lizmat | I had it shorter: | ||
rn: say { 1 }."WHAT"() | |||
camelia | niecza v24-37-gf9c8fc2: OUTPUT«Unhandled exception: Unable to resolve method WHAT in type Block at /tmp/blKnrV91Km line 1 (mainline @ 3)  at /home/p6eval/niecza/lib/CORE.setting line 4299 (ANON @ 3)  at /home/p6eval/niecza/lib/CORE.setting line 4300 (module-CORE @ 583)  at /home… | ||
..rakudo 71ea14: OUTPUT«No such method 'WHAT' for invocant of type 'Block' in block at /tmp/kMyWKBb4_u:1» | |||
grondilu | rn: say join ",", (my @)[0] = [^2], [<foo bar>] | 10:38 | |
camelia | rakudo 71ea14, niecza v24-37-gf9c8fc2: OUTPUT«0 1 foo bar» | ||
lizmat wonders how to create a method object | |||
grondilu was expecting "0 1,foo bar" | 10:39 | ||
rn: say join ",", [^2], [<foo bar>] | |||
camelia | rakudo 71ea14, niecza v24-37-gf9c8fc2: OUTPUT«0 1,foo bar» | ||
grondilu | see? | ||
diakopter | r: say (our method foo() { }).WHAT | ||
camelia | rakudo 71ea14: OUTPUT«(Method)» | ||
lizmat | rn: my $a= method { }; say $a.WHAT | ||
ack | |||
camelia | rakudo 71ea14, niecza v24-37-gf9c8fc2: OUTPUT«(Method)» | ||
diakopter | r: say (our method foo() { }).name | 10:40 | |
camelia | rakudo 71ea14: OUTPUT«foo» | ||
jnthn | r: say Int.^find_method('abs').WHAT.say | ||
camelia | rakudo 71ea14: OUTPUT«(Method)True» | ||
jnthn | hm, I said too much... | 10:41 | |
FROGGS | uhh, good that we arn't mafiosos :P | 10:42 | |
lizmat | for now I'll suggest this change to S12: | ||
- $obj.$somemeth | |||
+ $obj."$methodname"() | |||
+ | |||
+or: | |||
+ | |||
+ $obj.$methodobject | |||
jnthn | Speak for yourself | ||
grondilu | perl6 flattens too much. Everytime I try to use lists of arrays, I get troubles :( | ||
jnthn | uh, wait, I mean... :) | ||
FROGGS | hehe | ||
jnthn | lizmat: +1 | ||
lizmat | actually, also: | 10:43 | |
- $obj."WHERE" | |||
+ $obj."WHERE"() | |||
right? | |||
jnthn | Yes, pretty sure the () are mandatory | ||
std: my $obj; $obj."WHERE" | |||
camelia | std 86b102f: OUTPUT«===SORRY!===Unsupported use of . to concatenate strings or to call a quoted method; in Perl 6 please use ~ to concatenate, or if you meant to call a quoted method, please supply the required parentheses at /tmp/aMvLxZvcte line 1:------> my $o… | ||
jnthn | r: my $obj; $obj."WHERE" | ||
camelia | rakudo 71ea14: OUTPUT«===SORRY!===Quoted method name requires parenthesized arguments. If you meant to concatenate two strings, use '~'.at /tmp/SlDP2yHIhH:1------> my $obj; $obj."WHERE"⏏<EOL>» | 10:44 | |
dalek | ecs: dd82127 | (Elizabeth Mattijsen)++ | S12-objects.pod: Clarafication/Expansion in examples of Introspection section |
10:45 | |
11:05
kaare_ joined
|
|||
masak | yes, used to be $obj."method" worked, but it was deemed to confusable with Perl 5 concatenation, so the () were added, and any $obj."method" without the () in the spec is a fossil. | 11:22 | |
11:25
lustlife left
11:30
greg____ joined
|
|||
lizmat | S02:4215 probably needs this diff then: | 11:34 | |
- $foo $bar: # ILLEGAL -- use $bar.$foo for indirection | |||
+ $foo $bar: # ILLEGAL -- use $bar."$foo"() for indirection | |||
am not sure what to do with the next line though: | |||
(foo bar) baz: 1 # ILLEGAL -- use $baz.$(foo bar) for indirection | |||
grondilu | rn: say join(":", (my @)[0] = [^2], [<a b>]), " differs from ", ((my @)[0] = [^2], [<a b>]).join: ":" | ||
camelia | rakudo 71ea14: OUTPUT«0 1 a b differs from 0 1:a b» | ||
..niecza v24-37-gf9c8fc2: OUTPUT«Potential difficulties: Useless redeclaration of variable @ (see line 1) at /tmp/f7f1xnreEu line 1:------> [^2], [<a b>]), " differs from ", ((my @⏏)[0] = [^2], [<a b>]).join: ":"0 1 a b differs from 0 1:a b» | |||
11:35
tgt left
11:36
tgt joined
|
|||
grondilu | rn: (my @a)[0] = [^2], [<a b>]; say @a[0].join(":"); say join ":", @a[0]; | 11:36 | |
camelia | rakudo 71ea14, niecza v24-37-gf9c8fc2: OUTPUT«0 1:a b0 1 a b» | ||
grondilu | rn: my $a = [^2], [<a b>]; say $a.join(":"); say join ":", $a; | 11:37 | |
camelia | rakudo 71ea14: OUTPUT«WARNINGS:Useless use of "," in expression "my $a = [^2], [<a b>]" in sink context (line 1)0:10 1» | ||
..niecza v24-37-gf9c8fc2: OUTPUT«0:10 1» | |||
grondilu | rn: my $a = ([^2], [<a b>]); say $a.join(":"); say join ":", $a; | ||
camelia | rakudo 71ea14, niecza v24-37-gf9c8fc2: OUTPUT«0 1:a b0 1 a b» | ||
grondilu | wtf | 11:38 | |
isn't $x.join: $sep supposed to be the same as join $sep, $x ?? | |||
masak | good question. | 11:42 | |
11:42
PacoAir joined
|
|||
masak | there's different amounts of flattening going on there, but I'm still not convinced there should be a difference. | 11:42 | |
specifically, I don't understand the result of the second join. | 11:43 | ||
grondilu | rn: my $x = <foo bar>; say join ", ", $x; say $x.join: ", "; | 11:46 | |
camelia | rakudo 71ea14, niecza v24-37-gf9c8fc2: OUTPUT«foo barfoo, bar» | ||
grondilu | hum, I think I get it. | ||
rn: my $x = <foo bar>; say join ", ", @$x; say $x.join: ", "; | |||
camelia | rakudo 71ea14, niecza v24-37-gf9c8fc2: OUTPUT«foo, barfoo, bar» | ||
grondilu | makes sense | 11:47 | |
the method call version forces the evaluation as a list, while the function call version considers the argument as an array. Or something like that. | 11:48 | ||
11:49
kaare__ joined,
kaare_ left
11:50
greg____ left
|
|||
grondilu | or in ther words, when writing join $sep, $x, $x is only the first item of a list that could have had several. Like join $sep, $x, $y. In which we probably wanted $x ~ $sep ~ $y. So it really has a different semantic than $x.join($sep) | 11:51 | |
s/In which/& case/ | 11:52 | ||
masak | yeah. | 11:53 | |
that does make sense. | |||
11:54
kaare__ is now known as kaare_
|
|||
masak | rn: my $x = <foo bar>; say join(", ", |$x); say $x.join: ", "; | 11:54 | |
camelia | rakudo 71ea14, niecza v24-37-gf9c8fc2: OUTPUT«foo, barfoo, bar» | ||
masak | there you go. | ||
I don't think | works without the parens, though. | |||
11:55
domidumont joined
|
|||
masak | rn: my $x = <foo bar>; say join ", ", |$x; say $x.join: ", "; | 11:55 | |
camelia | rakudo 71ea14, niecza v24-37-gf9c8fc2: OUTPUT«foo, barfoo, bar» | ||
masak | seems it does :) | ||
grondilu | I don't see why it wouldn't have. | ||
masak | sometimes I suffer from the ghosts of old NYI that have since gone away. | 11:56 | |
lizmat | rn: my $x = <foo bar>; say (|$x) | 11:59 | |
camelia | niecza v24-37-gf9c8fc2: OUTPUT«\("foo", "bar")» | ||
..rakudo 71ea14: OUTPUT«===SORRY!===CHECK FAILED:Undefined routine '&prefix:<|>' called (lines 1, 1)» | |||
lizmat | feels like a rakudobug to me | ||
rn: my $x = <foo bar>; say |$x | |||
camelia | rakudo 71ea14, niecza v24-37-gf9c8fc2: OUTPUT«foobar» | ||
12:00
rking left
|
|||
lizmat | without parens it's ok | 12:00 | |
masak | yes, that's what I remember happening. | ||
12:00
woolfy joined
|
|||
lizmat | seems you got it backward, though, cause it's working *without* the parens | 12:01 | |
12:01
ozmq joined
|
|||
lizmat | and it isn't *with* the parens | 12:01 | |
jnthn | Well, what do you expect it to do there? | ||
jnthn isn't sure what the expected behavior of using | out of the context of an argument list is. | 12:02 | ||
lizmat | well, in either case its a prefix |, is it not? | ||
I mean "say |$x" is a prefix | | 12:03 | ||
or am I missing something here? | |||
jnthn | Yes, but it's not actually turned into a call to prefix:<|>. Rather, it's used by the thing constructing the AST for the call to know to mark the arg as flattening. | ||
So that it actually does get flattened. | 12:04 | ||
12:04
domidumont left
|
|||
lizmat | so it's more like a macro in that context? | 12:04 | |
jnthn | If we're calling "soemthing the compiler handles" a macro, then I guess so :) | ||
12:05
domidumont joined
|
|||
masak | lizmat: now you're just doing it to tease me. | 12:05 | |
lizmat pleads guilty | 12:06 | ||
jnthn | :D | ||
masak .oO( the whole bloody COMPILER is "more like a macro"! ) | |||
jnthn | masak: To be fair, a big thing that makes macros interesting is that the compiler invokes them ;) | ||
masak | I'm not disagreeing about that. | 12:07 | |
GlitchMr | thedailywtf.com/Articles/Global_Spaces.aspx | 12:09 | |
my @space-char := map " " x *, ^Inf; 1; | |||
lizmat | rn: sub prefix:<|> { @_.join }; my $x = <foo bar>; say (|$x) | ||
camelia | rakudo 71ea14, niecza v24-37-gf9c8fc2: OUTPUT«foo bar» | ||
GlitchMr | Reimplementing stuff from this website in Perl is so fun | ||
Perl 6* | |||
lizmat | oddly enough, $x is already stringified before prefix:<|> is called | 12:10 | |
afk for a few hours& | 12:12 | ||
masak | lizmat: no, it's not. that's the wrong conclusion :) | 12:15 | |
rn: sub prefix:<|> { say @_[0].^name; @_.join }; my $x = <foo bar>; say (|$x) | |||
camelia | rakudo 71ea14, niecza v24-37-gf9c8fc2: OUTPUT«Parcelfoo bar» | ||
masak | it gets stringified the moment you call .join on it. and because it's a Parcel, it gets a space in-between its elements. | 12:16 | |
cognominal | lizmat, jnthn, I am confused too about the not really a prefix:<|>. I remember trying using it outside arguments | ||
12:19
felher left
12:35
ozmq left
12:58
xinming left
13:00
xinming joined,
pecastro left,
spider-mario left
13:02
pecastro joined,
fgomez joined
13:04
Chillance left
13:10
Chillance joined
13:40
saxx joined
14:00
rking joined
14:01
saxx left,
AMENDEES_ joined
14:15
felher joined
|
|||
dalek | : 1e60268 | (Tobias Leich)++ | lib/Perl5.pm: we dont need that |
14:20 | |
FROGGS | jnthn: I'm in serious trouble atm. The way v5 inherits from Perl6::Grammar doesn't allow me to override the pod directives, this breaks everything that uses Perl 5 pod blocks... :o( | 14:21 | |
jnthn: Is there a better way to inherit from Perl6::Grammar? | 14:22 | ||
jnthn | FROGGS: Inheriting from Perl6::Grammar sounds wrong. | 14:30 | |
FROGGS: I'd expect inheriting from HLL::Grammar | |||
FROGGS | that's what I do too, but if it doesnt inherit from Perl6::Grammar I end up: P6opaque only supports type changes where the MRO of the original type is a suffix of the MRO of the new type | 14:31 | |
jnthn | That sounds like you're trying to rebless the current cursor to do a language switch rather than just doing something like LANG does. | 14:32 | |
FROGGS | well, token statement has these reblessing | ||
I can remove it for a test though | 14:33 | ||
jnthn | I don't know you should be ending up in there. | ||
I'd expect after you see use v5 you do a langauge switch | |||
The statement rebless is when you tweaked. | 14:34 | ||
(e.g. added a new operator) | |||
The case you have is more like when we switch to the Q langauge to aprse a quote, or the Regex language to parse regexes. | 14:35 | ||
14:35
PacoAir left
14:36
PacoAir joined
|
|||
FROGGS | I'm commenting out the reblessing in rakudo and v5 and see what happens | 14:37 | |
14:38
tgt left
|
|||
FROGGS | when hitting a quote there is no real language switching too, it just nibbles/quibbles use a different language | 14:39 | |
but I cant do that | |||
hmmm | 14:42 | ||
after doing that it uses the P5Actions, but still Perl6::Grammar | 14:43 | ||
jnthn | Regexes use a different langauge, though? | ||
FROGGS | so setting %LANG<MAIN> alone has no effect | ||
jnthn: but for regexes you still know the delims | 14:44 | ||
so you can use sibble/tribble/... | |||
jnthn | How do you know today when to stop parsing P5 and return to P6? | ||
Looking at STD, it declares a new %*LANG and sets it up. | 14:45 | ||
FROGGS | well, use Module only affects the block it is in, so { perl6... { use v5; ... } } is just working | 14:46 | |
and if v5 is the top thing in a file we are clear too... | |||
FROGGS is looking at STD now | |||
jnthn | FROGGS: HLL::Grammar defines a <LANG(...)> which is used for language switching. | 14:47 | |
Or is a way to do it | |||
That is much closer to what you want, I think. | |||
FROGGS | hmmm, sounds good | ||
:my %*LANG; <-- STD | |||
and then it does a reblessing too | |||
at least that is how I read line 1445 | 14:48 | ||
jnthn | yeah, we can't do it that way. | ||
It suspect it relies on a P5ish view of bless under the hood, given it's translating to P5. | |||
Or something like that. | |||
oh, in fact it's completely replacing the current curosr... | 14:49 | ||
Anyway, <LANG(...)> is probably the way to go. | |||
FROGGS | ya, will test that now | 14:50 | |
thanks! | |||
15:05
bwk joined
15:15
Bzek left
15:17
bwk left,
bwk joined
15:21
bwk left
15:22
AMENDEES__ joined,
AMENDEES_ left
15:29
tgt joined
15:43
pecastro left
|
|||
timotimo | should rakudo introspect comments to see if there are vim or emacs configs for tabstop size, so that $?TABSTOP can be set properly? :P | 16:14 | |
dalek | pan style="color: #395be5">perl6-examples: 1c124a8 | (L. Grondin)++ | rosalind/eubt-grondilu.pl: (rosalind) EUBT |
16:15 | |
grondilu | ^ this one was tough | ||
FROGGS | jnthn: okay, so I put my v5 in %LANG<Perl5>, and added a <statementlist=.LANG('Perl5', 'statementlist')>, looks good so far | 16:26 | |
jnthn | FROGGS: Sounds righter :) | 16:27 | |
FROGGS | btw, if we had a $GRAMMAR (like $ACTIONS), it would help too | ||
$*GRAMMAR that is | 16:28 | ||
so the Perl5.pm just sets this | |||
16:41
SamuraiJack joined
16:50
frdmn left
|
|||
timotimo | grondilu: my @left = grep none(@picked), @species; - clever! surprised me that it would work tbh. grep does ~~ internally? | 16:56 | |
16:58
cognominal left
|
|||
colomon | timotimo: yes | 16:59 | |
16:59
cognominal joined
|
|||
colomon | timotimo: possibly not explicitly, but grep smartmatches. | 16:59 | |
17:03
crab2313 joined
|
|||
grondilu | timotimo: yes, grep does ~~ internally. I've been using this "grep none(@)" construct for a while now. | 17:05 | |
Well, a junction is supposed to be exactly like any scalar, so I thought I should be able to do grep $junction, @array as I would do grep $scalar, @array. | 17:07 | ||
colomon | r: (1..10).grep(3|4) | ||
timotimo | it could theoretically have autothreaded the grep call and returned a junction of grep results for each of the junctionpars | ||
camelia | rakudo 71ea14: ( no output ) | ||
colomon | r: say (1..10).grep(3|4) | ||
camelia | rakudo 71ea14: OUTPUT«===SORRY!===Unable to parse expression in argument list; couldn't find final ')'at /tmp/BLVZAbque0:1------> say (1..10).grep(3|4⏏) expecting any of: postfix infix stopper infix or meta-infix»… | ||
timotimo | r: say (1..10).list.grep(3|4\) | 17:08 | |
camelia | rakudo 71ea14: OUTPUT«===SORRY!===Unable to parse expression in argument list; couldn't find final ')'at /tmp/R_ZCAJqupm:1------> say (1..10).list.grep(3|4\⏏) expecting any of: postfix» | ||
timotimo | r: say (1..10).list.grep(3|4) | ||
camelia | rakudo 71ea14: OUTPUT«3 4» | ||
timotimo | there we go | ||
r: say (1...10).grep(3|4) # should be the same | |||
camelia | rakudo 71ea14: OUTPUT«3 4» | ||
colomon must have stuck some sort of control characters in there. Colloquy-- | |||
timotimo | i wonder if the 1..10.grep behavior is to spec | ||
colomon | rn: say (1..10).grep(3|4) | 17:09 | |
timotimo | looks like an italic backslash to me | ||
camelia | rakudo 71ea14, niecza v24-37-gf9c8fc2: OUTPUT«3 4» | ||
colomon | there you go | ||
geekosaur | my client shows a control character, FS (0x1c) | 17:10 | |
colomon | and mine shows nothing. :\ | 17:12 | |
geekosaur | (I use an xchat hook to make control characters visible) | 17:13 | |
17:15
crab2313 left
|
|||
timotimo | i should really get a compose combination for the  character | 17:16 | |
17:17
AMENDEES__ left
17:24
tgt left
17:28
gtodd left
17:43
spider-mario joined
18:10
census joined
18:12
sftp left
18:13
kaare_ left,
sftp joined
18:32
grondilu left
19:03
domidumont left
19:15
sqirrel joined
|
|||
cxreg | so, niecza does concurrency using the threads provided by the CLR? | 19:15 | |
what is rakudo going to do on jvm in that space? anything? | 19:16 | ||
tadzik | I guess it'll use threads provided by JVM | 19:17 | |
19:20
tgt joined
|
|||
nwc10 | cxreg: I know that jnthn has thought about how to do Rakudo concurrency on the JVM in some detail, but I don't know much more than that. | 19:22 | |
but, first one needs Rakudo on the JVM :-) | 19:23 | ||
19:35
kaare_ joined
19:57
kaare_ left
20:03
berekuk joined
|
|||
dmol | Why JVM, not Parrot? | 20:07 | |
FROGGS | dmol: what exactly do you mean? | 20:09 | |
20:10
rindolf left
|
|||
masak | I think the short answer is that exploring Perl 6 concurrency on Parrot isn't a priority for anybody right now. | 20:10 | |
nwc10 | partly, if I understood what I've been told, because Parrot's threading model is very different from the JVM's (and JVM and .NET are fairly similar). And because Parrot's threading implementation is very new, and nothing (else) is using it | 20:13 | |
flussence | Threading is a solved problem on the JVM. It's easier to port Rakudo to that than to wait for Parrot to catch up. | 20:14 | |
lue | (nor is it, as I've heard, nearly as easy as it would be on JVM, a platform that has threads for a while) | ||
nwc10 | so, it's easier to do JVM first - you know that any bugs you find are going to be in the Rakudo code, because someon else has already hit the JVM bugs | ||
then, once Rakudo's threading support is solid, you come back and port it to Parrot | |||
masak | there's a disconnect here between Rakudo and Parrot devs, I find. Parrot devs say "what are you talking about, Parrot has threads, they're awesome!". pmichaud has repeatedly said "if that's so, then please show me how we can do hyper addition, `@a >>+<< @b`, using Parrot's primitives." | 20:17 | |
lue | .oO("We're not rakudo programmers! How are we supposed to create an example like that?") |
20:18 | |
lue goes to actually read the PDD on threads, if it exists | 20:20 | ||
dmol | Thanks for explanation. I'm just curious about p6 world, and try to understand it's tendency. | ||
20:21
sqirrel left
|
|||
masak | dmol: it is a fair question. | 20:23 | |
lue | Parrot's ideas on concurrency are interesting (multiple concurrency models can be used at the same time), but I wonder how much of it is actually implemented. | 20:29 | |
20:31
jnthn joined
20:32
mathw left,
_sri joined,
mathw joined
20:34
frdmn joined
20:35
avar left
20:37
yx joined,
Bucciarati joined
|
|||
cxreg | masak: did parrot ever respond with some examples? | 20:41 | |
tadzik | rurban++ commited some code to nqp repo | ||
it was never fully implemented though, I think | |||
some things were lacking | |||
20:41
adu joined,
SamuraiJack left,
_sri left,
_sri joined,
avar joined,
avar left,
avar joined
20:42
ilogger2 joined,
ChanServ sets mode: +v ilogger2
|
|||
dalek | : 88cfd7d | (Tobias Leich)++ | / (5 files): instead of inheriting from Perl6:Grammar [...] we just execute a statementlist in the given language. |
20:49 | |
20:50
p5eval joined
|
|||
dalek | : f1e39fb | (Tobias Leich)++ | t/test_summary: strip backtrace |
20:54 | |
[Coke] loses some backscroll, and can't hit the log website to find it! *sadface* | 21:00 | ||
dalek | rl6-roast-data: 9af76ea | coke++ | / (3 files): today (automated commit) |
||
rl6-roast-data: 4f577ad | coke++ | / (3 files): today (automated commit) |
|||
adu | hi all | 21:01 | |
masak | hi adu | ||
adu | what's the difference between AST and QAST? | 21:04 | |
masak | AST is language-independent, QAST is what nqp is using. | 21:05 | |
[Coke] | AST is a generic ter. | ||
timotimo | masak: when reviewing the t2 results, did you think the producing grammar for pieces of speech has been implemented in an optimal way? i thought it was pretty concise and good; did you see any obvious improvements? | ||
[Coke] | m | ||
timotimo | ter.m? :) | ||
adu | doc.perl6.org/type/AST | 21:06 | |
masak | timotimo: I did, but I didn't put it in the review. | ||
timotimo | give me the short version of what you thought could be done better? :) | ||
masak | timotimo: it occurs to me that the grammar will not generate all possible trees with equal probability. | ||
timotimo: (because it works top-down, and so the distribution will be biased because of that) | 21:07 | ||
timotimo | oh, that's a good point. reminds me of the time when the minichallenge to make random brace pairs was in the air | ||
masak | yeah, that one is clearly related. | ||
random brace pairs and binary trees are equal up to isomorphism. | 21:08 | ||
adu | random brace pairs? | ||
dalek | ast: 48308c5 | coke++ | S12-construction/destruction.t: pugs fudge |
21:09 | |
timotimo | rosettacode.org/wiki/Balanced_brackets - i think this one | ||
masak | yes, but that's one about verification, not random generation. | ||
cognominal | can someone tell me the difference between LALR and operator precedence parsing? I think that LALR is faster because it is compiled into an automata but operator precedence is more general when combined with other engines like in Perl 6 | ||
can someone correct me or elaborate? | 21:10 | ||
masak | adu: gist.github.com/masak/5129165 | ||
cognominal: "an automaton" ;) | 21:11 | ||
that was the correction -- hold on and I'll try to elaborate. | |||
cognominal: LALR seems more comparable to recursive descent than to operator precedence. | 21:13 | ||
cognominal: and Wikipedia's summary seems to be "LALR is hard to understand, recursive descent is easier". | |||
cognominal | mask: well with recursive descendant parsing in Perl 6, once you start using procedural alternatives, there is so many of them | 21:14 | |
I am writing material and I said that with reduce/reduce and shift/reduce conflicts, LALR was tricky to use. | 21:15 | ||
masak | ah, ok. | ||
yes, maybe that's where the trickiness comes from. I can neither confirm nor deny. | 21:16 | ||
cognominal | my understanding is that with recursive descendant parsing for handling || and && , operator precedence parsing for, well operator stuff and NFA for the rest. Perl 6 has found a sweet spot. | 21:17 | |
the synopsis are silent about operator precedence. And I don't even think that rakudo implement that. It is just two stacks juggling (operators and operands) according to precedence. | 21:20 | ||
I think operator precedence means generating some kind of automata | |||
masak | yes, Rakudo and nqp do operator precedence. | 21:21 | |
cognominal | or not, it seems that the juggling I describe is en.wikipedia.org/wiki/Shunting_yard_algorithm | ||
masak | and that's the only bit that *doesn't* involve generating some kind of automata. | ||
cognominal | I must confuse with some automata based system to deal with operators. | ||
masak | yes. | 21:22 | |
cognominal | Yes, I spent the afternoon reading the code. And I get the gist of it. | ||
masak | I think the shunting yard algorithm is closely related but not identical. | ||
cognominal | btw, I need the trick to use C<.method(args)> as postfix to avoid left recursion in my bast grammar. | 21:23 | |
different things but the vocabulary is the same, so my confusion : en.wikipedia.org/wiki/Operator-prec...ce_grammar en.wikipedia.org/wiki/Simple_precedence_grammar en.wikipedia.org/wiki/Operator-precedence_parser | 21:27 | ||
21:28
telex joined
|
|||
adu | cognominal: I'm not a fan of LALR | 21:29 | |
I am a big fan of PEG tho | |||
cognominal | and packrat? | ||
adu | cognominal: I guess | ||
what's the difference? | 21:30 | ||
cognominal | not sure | ||
don't drink PEG, btw :) | |||
adu | oh packrat = PEG + memoization | ||
cognominal | ok | ||
I thought they were related | 21:31 | ||
I don't think there is a good book that is up to date with all these kind of grammar. | |||
adu | PEG just requires an ordered '|', as opposed to longest-match '|' | ||
cognominal | I was told that the last edition of the dragon book was not worth the price. | 21:32 | |
100$ is a total rip-off | 21:33 | ||
ingy is a big fan of PEGs, I think | 21:35 | ||
21:55
kurahaupo joined
|
|||
pmichaud | expression parsing in NQP and Rakudo is a shift/reduce parser | 21:57 | |
with infinite levels of precedence available | |||
21:59
grondilu joined
|
|||
cognominal | thx | 22:00 | |
pmichaud | or, more accurately, an "operator precedence parser". | 22:02 | |
22:06
tgt joined
|
|||
grondilu | wow, there is a v5 module now, as specced. Nice. | 22:14 | |
22:22
felher joined
22:29
Vlavv_ joined
|
|||
masak | 'night, #Perl6 | 22:30 | |
#perl6* | |||
lizmat | night masak, and #perl6 | ||
adu | cognominal: well I'm a big fan of PEGs because they're provably composable | 23:10 | |
I have a question | 23:27 | ||
so Str has index and rindex methods, but instead of ltrim and rtrim there's trim-trailing and trim-leading? | 23:29 | ||
[Coke] | masak: boingboing.net/2013/04/27/automated...rce=feedly | 23:32 | |
23:44
crab2313 joined
23:49
tgt left
23:50
berekuk joined
|