»ö« 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 sorear on 25 June 2013. |
|||
00:02
sjn_ is now known as sjn
00:18
hoversosmooth is now known as troll_op,
troll_op is now known as hoverboard
00:32
BenGoldberg joined
00:40
dmol left
00:52
hoverboard left
00:58
pippo left
01:00
pippo joined,
pippo left
01:02
aindilis joined
01:07
pippo joined,
pippo left
01:08
hoverboard joined
01:11
berekuk left
02:09
bjz left
|
|||
[Coke] | github.com/coke/mojo6 is no longer empty. (though it's really very mostly empty) | 02:21 | |
raydiak | [Coke]: are you able to fix my rt account? it has no permissions, even to view the homepage or bugs which I can view as anonymous guest | 02:23 | |
02:30
FROGGS_ joined
02:32
Sqirrel_ joined
02:33
Sqirrel left,
FROGGS left
|
|||
TimToady | r: say so '一' ~~ /<:Ideographic>/ say so '海' ~~ /<:Ideographic>/ | 02:34 | |
camelia | rakudo-parrot 45e230, rakudo-jvm 45e230, rakudo-moar 45e230: OUTPUT«===SORRY!=== Error while compiling /tmp/tmpfileTwo terms in a rowat /tmp/tmpfile:1------> say so '一' ~~ /<:Ideographic>/ ⏏say so '海' ~~ /<:Ideographic>/ exp…» | ||
TimToady | r: say so '一' ~~ /<:Ideographic>/; say so '海' ~~ /<:Ideographic>/ | ||
camelia | rakudo-moar 45e230: OUTPUT«TrueFalse» | ||
..rakudo-parrot 45e230, rakudo-jvm 45e230: OUTPUT«TrueTrue» | |||
TimToady | that's the bug I'm hunting right now... | ||
araujo greets around | 02:39 | ||
araujo sees TimToady is hunting tonight | 02:40 | ||
02:44
klapperl joined
02:46
sctt joined
02:48
klapperl_ left
|
|||
[Coke] | raydiak: what's your rt account id? | 02:52 | |
raydiak | [Coke]: I log in with bitcard using [email@hidden.address] ...is that the id you're asking for? | 03:03 | |
[Coke] | top line: "Logged in as..." | 03:08 | |
kicking off a daily run on the new box | 03:09 | ||
Group already has member: [email@hidden.address] | |||
You already have full privs. Can you give us a URL you're trying to use that isn't letting you close tickets? | 03:10 | ||
raydiak | oh weird, now I can see my tickets | 03:14 | |
[Coke] | .... maybe I clicked twice | 03:15 | |
enjoy. :) | |||
raydiak | thanks :) | 03:16 | |
03:25
klapperl_ joined,
bjz joined
03:27
ingy left,
ingy joined,
klapperl left
03:50
pdcawley left
03:52
pdcawley joined
03:56
rurban joined
04:44
xinming_ left
04:46
xinming joined
05:22
hoverboard left
05:34
rurban left
05:47
Ejp joined,
Ejp left
05:56
bjz left
|
|||
moritz | good morning | 05:57 | |
nwc10 | good UGT moritz | 06:08 | |
06:19
xinming left
06:21
xinming joined
06:24
bjz joined,
bjz left,
bjz joined
06:27
bjz left,
bjz joined
06:33
hoverboard joined
06:34
rurban joined
06:39
rurban left
06:47
rurban joined
06:51
bjz left
06:52
rurban left
|
|||
moritz | <TimToady> | is not, in that sense, a variadic parameter, because from the standpoint of the binding, it's supposed to consume 0 args, not all of them. | 06:54 | |
if that's true, you can't do sub redispatch(|a) { other(|a) } | 06:55 | ||
because the |a wouldn't consume any arguments, so calling the sub with non-zero arguments always bind-ails | |||
(that's from irclog.perlgeek.de/perl6/2014-03-01#i_8369448 ) | 06:56 | ||
maybe we need both mechanisms, with different syntax | 06:57 | ||
07:03
BenGoldberg left
|
|||
TimToady | just be cause a doesn't *consume* the arguments, doesn't mean the arguments aren't in a | 07:24 | |
one must either clone any argments desired after a |a (none in this case), or have referential purity into the remaining capture so that both can use it | |||
|a takes a snapshot of the rest of the arguments without consuming them from the standpoint of subsequent parameters | 07:25 | ||
moritz | but that means that sub a(|x) { }; a(42); is a bind fail | 07:27 | |
because nothing consumes the 42 | |||
which is not at all how we handle things today | |||
p6: sub a(|x) { say x }; a 42 | 07:28 | ||
camelia | rakudo-parrot 45e230, rakudo-jvm 45e230, rakudo-moar 45e230: OUTPUT«42» | ||
..niecza v24-109-g48a8de3: OUTPUT«\(42)» | |||
TimToady | hmm, well then, we have a contradictory spec, who'd'a thunk it? | 07:31 | |
sub a(|x) { my ($first) ::= x; say $first; }; a(42) | 07:33 | ||
r: sub a(|x) { my ($first) ::= x; say $first; }; a(42) | |||
camelia | rakudo-parrot 45e230, rakudo-jvm 45e230, rakudo-moar 45e230: OUTPUT«42» | ||
07:33
darutoko joined
|
|||
TimToady | I guess there's a workaround | 07:33 | |
but if that can work, why not (|x, $first) ? | 07:34 | ||
obviously that can't match a() | 07:35 | ||
but that seems to be the intent here | |||
(to not match a()) | |||
and one could say (|x, $first?) | |||
well, I need to think about all that s'more | 07:36 | ||
07:36
xinming left
|
|||
lue | TimToady: maybe |c could be the more general version of *@c, at least based on current behavior in rakudo ? [that is, *@c must be the last positional, and |c would be required to be the last parameter at all.] | 07:37 | |
♘ #perl6 o/ | |||
moritz | if we allow both sub a(|x) to work as it does now in niecza and rakudo, and allow (|x, $first), then the | does two rather different things in those two cases | ||
and I wouldn't like that | 07:38 | ||
maybe we should steal the <?assertion> syntax from regexes and says that |?x binds the rest of the argument list without consuming anything | |||
07:38
xinming joined
|
|||
moritz has updated the software on feather2 | 07:39 | ||
07:39
xinming left
07:41
dalek joined,
ChanServ sets mode: +v dalek
|
|||
moritz | now feather3... | 07:41 | |
... and host07 (camelia's home) | 07:42 | ||
07:46
xinming joined,
LLamaRider left,
LLamaRider joined
|
|||
moritz | m: say 'sanity' | 07:53 | |
camelia | rakudo-moar 45e230: OUTPUT«sanity» | ||
moritz | feather3 upgrade was more bumpy, since it ran out of disc sapce in the process | 07:54 | |
wasyl.eu/programming/2014/03/01/int...ember.html looks interesting | 07:57 | ||
08:02
bjz joined
08:06
pdcawley left
08:13
pdcawley joined
08:32
sctt left
|
|||
timotimo | o/ | 08:37 | |
08:41
sctt joined
|
|||
timotimo | which machine hosts dalek? | 08:42 | |
are you going to fix dalek, too, moritz? | |||
08:46
xinming left
08:48
xinming joined
08:49
rurban joined
08:50
FROGGS_ is now known as FROGGS
|
|||
FROGGS | morning | 08:50 | |
08:53
berekuk joined,
rurban left
09:01
radhe joined
09:03
rindolf joined
|
|||
radhe | how i can add two number and print into screen in Perl6 | 09:03 | |
FROGGS | p: say 6 + 3 | 09:05 | |
camelia | rakudo-parrot 45e230: OUTPUT«9» | ||
FROGGS | p: print 4 + 5 | ||
camelia | rakudo-parrot 45e230: OUTPUT«9» | ||
radhe | thanks | 09:06 | |
09:08
radhe left
|
|||
masak | good antenoon, #perl6 | 09:10 | |
FROGGS | hi masak | ||
09:33
pdcawley left,
pdcawley joined
|
|||
masak | moritz: September looks nice. | 09:35 | |
moritz: I predict there will be interesting corner cases wrt scoping, though. | |||
moritz: like, the 'until' macro he mentions at the end does not seem to give the loop body its own scope. or -- if it does -- what's the difference between it and the condition? | 09:36 | ||
moritz: how would I communicate that things declared in the '(;;)' part of a C-style for loop should be included in the block scope? or is that simply not allowed? | 09:37 | ||
moritz: what about the times when I want to .resolve() a block but have it act like a thunk rather than a block with its own scope? what about the times when I want non-hygienic variable lookup? | 09:38 | ||
dalek | ast: 4b5c5c9 | larry++ | S05-mass/properties-derived.t: don't pick a future unified char as non-unified The test picked for a non-Unified_Ideograph character the first character after the CJK area. Unfortunately, this is precisly where the Unicode Consortium adds new characters (and in fact did). Instead, pick the first character before CJK as a sample non-CJK character. |
09:39 | |
timotimo | dalek \o/ | ||
FROGGS | and TimToady++ :o) | 09:40 | |
09:43
berekuk left
09:47
vendethiel joined
|
|||
moritz | masak: yes, interesting questions | 09:47 | |
09:49
berekuk joined
09:50
rurban joined
|
|||
masak | it's all about scopes. lexical scoping is (as we've discovered over the years) a great way to achieve sanity. | 09:50 | |
since macros intentionally mess with lexical scoping, they have to do so carefully, with style, and with a higher goal in mind. | |||
moritz | and explicitly | 09:51 | |
TimToady | r: say so " | ||
camelia | rakudo-parrot 45e230, rakudo-jvm 45e230, rakudo-moar 45e230: OUTPUT«===SORRY!=== Error while compiling /tmp/tmpfileUnable to parse expression in double quotes; couldn't find final '"' at /tmp/tmpfile:1------> say so "⏏<EOL> expec…» | ||
moritz | does anybody still use the apache server on feather3? | 09:52 | |
FROGGS | moritz: panda perhaps? feather.perl6.nl:3000/projects.json | ||
TimToady | r: say so "海" ~~ /<:Ideographic>/ | ||
camelia | rakudo-moar 45e230: OUTPUT«False» | ||
..rakudo-parrot 45e230, rakudo-jvm 45e230: OUTPUT«True» | |||
masak has been meaning to a few times | |||
moritz | FROGGS: that's feather1, and not apache :-) | 09:53 | |
masak | TimToady: moarbug? | ||
TimToady | that should be fixed with the latest MoarVM HEAD | ||
FROGGS | moritz: okay :o) | ||
masak | TimToady: oh, ok. | ||
TimToady | someone needs to bump it though | ||
FROGGS | I can do that in a minute | ||
TimToady already stayed up about 2 hours too late fixing this... | |||
t/spec/S05-mass/properties-derived.t is now down to about 4 failing tests | 09:54 | ||
FROGGS | cool! | ||
09:54
rurban left
|
|||
TimToady | zzz & | 09:55 | |
FROGGS | TimToady: sleep well | ||
moritz | oh, it seems feather3 used to host try.rakudo.org | 09:56 | |
which is defunct anyway | |||
so I'm going to switch off that apache | 09:57 | ||
09:58
pippo joined,
pippo left,
pippo joined
|
|||
masak | moritz++ | 10:01 | |
what does feather.perl6.nl:3000/projects.json use, if not apache? | 10:02 | ||
moritz | some perl 5 based PSGI/Plack web server, iirc | 10:03 | |
10:06
grondilu joined
|
|||
FROGGS | hmmm, TimToady has not pushed to MoarVM it seems | 10:07 | |
masak | slacker! :P | 10:08 | |
masak feels a sudden urge to add more ':P's to that... | |||
FROGGS | ahh, he pushed to its own... shall I steal his commits? :P | ||
masak | FROGGS: sure. | 10:09 | |
TimToady | fixed it alrady | ||
*already | |||
moritz | TimToady++ | ||
FROGGS | TimToady++ # off you go to bed! | ||
*g* | |||
TimToady | I was kinda wondering why dalek didn't report it on #moarvm | ||
masak | man, I don't like that you can only Ctrl+D once in a program. :/ | 10:10 | |
I have what I feel is a real use case for being able to Ctrl+D several times. | |||
FROGGS | ctrl+d in a program? | ||
TimToady | ^D really | ||
masak | right. | ||
I have a main program which accepts stuff from $*STDIN. | |||
I just threw in a 'use Grammar::Debugger' in the module that the main program uses. | 10:11 | ||
it correctly goes into the debugger, but it (incorrectly) aborts it right away because *we're already ^D'd* :/ | |||
feels like the wrong least-surprise... | |||
moritz | libc upgraded on feather1 | 10:12 | |
dalek | p: a2324ac | (Tobias Leich)++ | tools/build/MOAR_REVISION: bump moar rev for unicode property fixes |
||
kudo/nom: 652a1fa | (Tobias Leich)++ | tools/build/NQP_REVISION: bump nqp+moar rev for unicode property fixes |
10:13 | ||
10:19
dmol joined
10:21
spider-mario joined
|
|||
dalek | p: 591268e | moritz++ | Configure.pl: [Configure] support --backends=all |
10:21 | |
10:30
kivutar joined
10:31
spider-mario left
|
|||
moritz | who uses X on feather? | 10:35 | |
masak | jnthn: Grammar::Debugger appears busted... gist.github.com/masak/eccadc58b72cd32f720e | ||
jnthn: (on Rakudo Moar) | 10:36 | ||
jnthn: I golfed my own program down to that. if it'd help, I could also golf down Grammar::Debugger to what's wrong. | |||
FROGGS | a PR might also help :o) | 10:38 | |
masak: btw: github.com/masak/gge/pulls | |||
masak | yes, of course. but golfing comes first. | ||
10:39
denisboyun joined
|
|||
masak | FROGGS: merged both pull requests. thanks. | 10:40 | |
FROGGS | cool! thank you | ||
10:40
spider-mario joined
10:46
tgt joined
|
|||
masak | no, thank *you*. | 10:46 | |
10:47
aborazmeh joined
|
|||
timotimo | is gge still functional? | 10:47 | |
FROGGS | I've not tested it | 10:48 | |
timotimo | the COOLTHINGS document from docs/ should be reviewed by people with lots of tuits :P | 10:52 | |
(but not built on top of gge; we should now be able to build all that on top of nqp::getcomp and rakudo) | 10:54 | ||
masak | agreed. | 10:59 | |
GGE was written in a time when Rakudo was a lot less bootstrapping than it is now. | |||
11:08
kivutar left
11:13
aborazmeh left
|
|||
timotimo | i'm kind of glad i joined the perl6 effort after that period :P | 11:33 | |
masak | r: say "\0xA0" | 11:35 | |
camelia | rakudo-parrot 45e230, rakudo-jvm 45e230, rakudo-moar 45e230: OUTPUT«␀xA0» | ||
masak | r: say "\xA0" | ||
camelia | rakudo-parrot 45e230, rakudo-jvm 45e230, rakudo-moar 45e230: OUTPUT« » | ||
timotimo | .u ␀ | 11:36 | |
yoleaux | U+2400 SYMBOL FOR NULL [So] (␀) | ||
timotimo | ah | ||
masak | so... NUL is the symbol for NULL? :) | 11:38 | |
FROGGS | how DULL :o) | 11:40 | |
timotimo | i couldn't read it on my font | 11:53 | |
on this display it looks kind of like a 45° turned ellipsis | |||
.u ° | |||
yoleaux | U+00B0 DEGREE SIGN [So] (°) | ||
timotimo | huh | 12:02 | |
$config<build-date> := '2012-08-05T16:57:45Z'; | |||
that's hard-coded in the debugger | |||
interesting choice | |||
tadzik | hah | ||
jnthn | haha | 12:03 | |
timotimo | oh wow | ||
jnthn | The debugger was built "in secret" and "quickly" 'cus I wanted to show it off in a talk. I probably stole from the generated main.nqp ;) | ||
timotimo | i just realized | ||
i could introduce a repr QStringList for list_s and QString for strings and have super simple qt interop | 12:04 | ||
that's crazy cool | |||
jnthn | timotimo: That's one of the points of repr poly ;) | 12:05 | |
timotimo | similarly QMap for nqp::hash | ||
yeah, but ... wow | |||
well, the string ops are kind of hardcoded to use MVM_string_... functions, are they not? | 12:06 | ||
12:07
arnsholt joined
|
|||
jnthn | timotimo: Oh, I think the better option is that your QString repr is one that can *unbox* to an MVMString. | 12:07 | |
timotimo | ah, hm. | ||
jnthn | then you just produce an MVMString on demand and cache it. | ||
That's how I'd do it. | 12:08 | ||
timotimo | agreed. | ||
jnthn | Shoudn't be too hard. :) | ||
.oO( famous last words ) |
|||
timotimo | it's not really a sensible thing to do *right now* | ||
except it would make a cool blog post at some point | |||
jnthn | yeah :) | 12:09 | |
It is a neat idea. ;) | |||
12:11
jercos joined
|
|||
jnthn | & | 12:15 | |
12:39
araujo left
12:41
araujo joined
|
|||
colomon | masak: Text::CSV is failing in the smoke test | 12:42 | |
labster: Lingua::Number is failing in the smoke test | |||
Sum is still failing as well | 12:43 | ||
12:45
hoverboard left
|
|||
colomon | skids: Sum is failing in the smoke test | 12:53 | |
13:17
rurban joined
13:28
denisboyun left
13:29
denis_boyun joined
13:35
molaf joined,
denis_boyun__ joined
13:36
denis_boyun left
|
|||
masak | colomon: ok, thanks for the heads-up. gonna run the tests locally and see what's up. | 13:53 | |
13:54
cognominal joined
|
|||
masak | I managed to locate the error, but I don't know why it's wrong yet. seems there's been some slippage in the underlying grammar semantics. | 14:01 | |
14:01
virtualsue joined
14:08
beastd joined
14:15
xragnar_ joined,
xragnar is now known as Guest83346,
Guest83346 left,
xragnar_ is now known as xragnar
14:21
xenoterracide left
14:22
sctt left
14:23
xenoterracide joined
14:31
Mouq joined
14:32
virtualsue left
14:38
xenoterracide left
14:41
virtualsue joined
14:45
rindolf left
|
|||
masak | for people who would like to trailing-comma their JSON: json5.org/ | 15:06 | |
Mouq | masak: I was just working on a JSON::Tiny fork to parse it :) | ||
masak | (though I fear the original JSON has extreme simplicity going for it, and that's part of why it has so many parsers. this new proposal loses that, with some-would-argue relatively little gain.) | 15:07 | |
Mouq: oh wow, cool. | |||
Mouq: if you get it to some relatively ready state, make sure to put in a HN comment about it: news.ycombinator.com/item?id=7325735 | |||
Mouq | masak: Though I agree, I think it kind of misses the point | ||
masak: -ofun | |||
*O | 15:08 | ||
15:09
rindolf joined,
telex left
15:10
telex joined
|
|||
grondilu likes YAML too | 15:13 | ||
masak | Mouq: then I think we are in agreement. | ||
Mouq: I was mostly talking about the amount of uptake you're likely to see on anything JSON5. | 15:14 | ||
vendethiel | YAML indeed does too much with its inheritance system, object etc | ||
if YAML was just "JSON With Meaningful Indentation", I think it'd be better (and it'd make implem. etc not such a pain) | |||
Mouq | perlcabal.org is down :( | 15:17 | |
15:19
xinming_ joined
|
|||
Mouq | github.com/Mouq/json5 | 15:20 | |
Doesn't actually add change much from JSON::Tiny atm | |||
15:22
xinming left
15:24
denis_boyun__ left
|
|||
masak | Mouq++ | 15:32 | |
15:34
zakharyas joined
|
|||
dalek | kudo/pod-table: 9626115 | Mouq++ | src/Perl6/ (2 files): Get much closer to doing pod table right There's still some major bug somewhere getting everything serialized correctly |
15:35 | |
15:35
LLamaRider left
|
|||
Mouq had to commit so he could checkout nom and build a clean perl6 | 15:35 | ||
TimToady | r: say so "海" ~~ /<:Ideographic>/ | 15:37 | |
camelia | rakudo-parrot 652a1f, rakudo-jvm 652a1f, rakudo-moar 652a1f: OUTPUT«True» | ||
TimToady | much better | ||
Mouq | \o/ | ||
15:40
virtualsue left
15:41
xinming_ left
|
|||
Mouq | ...we don't actually have a YAML parser in our ecosystem(?!) | 15:41 | |
15:42
xinming joined
15:47
xinming left,
xinming joined
|
|||
grondilu | every time I try to write a grammar for a language, I fail miserably. I suspect grammars are a bit tough to write and that's how I explain we have so few of them. And that include YAML. | 15:49 | |
15:51
[Sno] left
|
|||
[Coke] | I have most of a test run done... forget I needed a perlbrew setup for post processing. | 15:52 | |
geekosaur | working grammars take some forethought and design | ||
grondilu | well sometimes it's hard even with *very* simple languages. Yesterday I tried one here with the basic Wolfram language. I could not get it to work, FROGGS gave it a go and could not either. | 15:54 | |
(search 'grammar Foo' if you want to know what I'm talking about) | 15:56 | ||
(eg. Foo[bar,and[so,on]]) | 15:58 | ||
15:59
[Sno] joined
|
|||
grondilu | if this is not easy, then there is a problem with grammars, imho. | 15:59 | |
[Coke] | what about that did you get stuck on? | ||
grondilu | I could not get it to work recursively | ||
[Coke] | let's see, you have what look like comma separated lists, and nested brackets? | ||
grondilu | yes | 16:00 | |
Mouq runs with perl6-debug-m | 16:03 | ||
It looks like it's LTM weird... | |||
grondilu | without being recursive, it's easy: | 16:04 | |
r: grammar Wolfram { rule TOP { ^ <expr> $ }; token expr { <symbol> \[ ~ \] [ <symbol>+ % \, ]? }; token symbol { <.alpha>+ } }; say Wolfram.parse("Foo[Bar,cuz]") | |||
16:04
xinming_ joined
|
|||
camelia | rakudo-parrot 652a1f, rakudo-jvm 652a1f, rakudo-moar 652a1f: OUTPUT«「Foo[Bar,cuz]」 expr => 「Foo[Bar,cuz]」 symbol => 「Foo」 symbol => 「Bar」 symbol => 「cuz」» | 16:04 | |
jnthn | r: my grammar G { token TOP {<ts>}; token ts { <t>+ % ',' }; token t { \w+ [ '[' ~ ']' <ts> ]? } }; say G.parse('Foo[bar,and[so,on]]').Str | ||
camelia | rakudo-parrot 652a1f, rakudo-jvm 652a1f, rakudo-moar 652a1f: OUTPUT«Foo[bar,and[so,on]]» | ||
grondilu | r: my grammar G { token TOP {<ts>}; token ts { <t>+ % ',' }; token t { \w+ [ '[' ~ ']' <ts> ]? } }; say G.parse('Foo[bar,and[so,on]]') | 16:05 | |
camelia | rakudo-parrot 652a1f, rakudo-jvm 652a1f, rakudo-moar 652a1f: OUTPUT«「Foo[bar,and[so,on]]」 ts => 「Foo[bar,and[so,on]]」 t => 「Foo[bar,and[so,on]]」 ts => 「bar,and[so,on]」 t => 「bar」 t => 「and[so,on]」 ts => 「so,on」 t => …» | ||
16:05
xinming left
|
|||
[Coke] had started up a little project and started working this out and sees that jnthn just ripped something off his head. Nice. | 16:07 | ||
"ripped something off his head" << clearly I need coffee. | |||
grondilu | I'm amazed he managed to write this without alternation | | 16:08 | |
jnthn | I did make one mistake in my first attempt. :) | 16:09 | |
I wrote ** intead of %. I'm only 3 years out of date on syntax :P | |||
grondilu | it's kind of a cheat, though | 16:10 | |
r: my grammar G { token TOP {<ts>}; token ts { <t>+ % ',' }; token t { \w+ [ '[' ~ ']' <ts> ]? } }; say G.parse('Foo[bar,and[so,on]],THIS_SHOULD_FAIL') | |||
camelia | rakudo-parrot 652a1f, rakudo-jvm 652a1f, rakudo-moar 652a1f: OUTPUT«「Foo[bar,and[so,on]],THIS_SHOULD_FAIL」 ts => 「Foo[bar,and[so,on]],THIS_SHOULD_FAIL」 t => 「Foo[bar,and[so,on]]」 ts => 「bar,and[so,on]」 t => 「bar」 t => 「and[so,on]」 …» | ||
grondilu | the TOP entry is supposed to be only one term | 16:11 | |
jnthn | grondilu: Oh, then call <t> there instead of <ts> | ||
16:11
__thou joined
|
|||
grondilu | r: my grammar G { token TOP {<t>}; token ts { <t>+ % ',' }; token t { \w+ [ '[' ~ ']' <ts> ]? } }; say G.parse('Foo[bar,and[so,on]],THIS_SHOULD_FAIL') | 16:11 | |
camelia | rakudo-parrot 652a1f, rakudo-jvm 652a1f, rakudo-moar 652a1f: OUTPUT«「Foo[bar,and[so,on]]」 t => 「Foo[bar,and[so,on]]」 ts => 「bar,and[so,on]」 t => 「bar」 t => 「and[so,on]」 ts => 「so,on」 t => 「so」 t => 「on」» | ||
grondilu | r: my grammar G { token TOP {^<t>$}; token ts { <t>+ % ',' }; token t { \w+ [ '[' ~ ']' <ts> ]? } }; say G.parse('Foo[bar,and[so,on]],THIS_SHOULD_FAIL') | ||
jnthn | Uh, and apparently parse ain't anchoring the end... | ||
camelia | rakudo-parrot 652a1f, rakudo-jvm 652a1f, rakudo-moar 652a1f: OUTPUT«#<failed match>» | ||
grondilu | go damned it you're right | ||
I struggled a long time with this an you cracked it almost instantly. That's embarassing. | 16:13 | ||
16:13
circuit joined
|
|||
jnthn | It's practice, I think. I think debugging them is often hard, though, which is why I've written 3 things by now (sadly, 1 currently busted) to try and help with that. | 16:13 | |
What I'd really like to build is a kind of interactive "grammar assembly tool". | 16:14 | ||
Mouq | perl6-debug++ jnthn++ | ||
16:15
berekuk left
16:20
rindolf left
16:26
myfree joined
|
|||
grondilu | r: my grammar G { token TOP {^<t>$}; token ts { <t>+ % ',' }; token t { \w+ [ '[' ~ ']' <ts> ]? } }; say G.parse('Foo[bar][and]') | 16:29 | |
camelia | rakudo-parrot 652a1f, rakudo-jvm 652a1f, rakudo-moar 652a1f: OUTPUT«#<failed match>» | ||
Mouq | r: my grammar G { token TOP {^<t>$}; token ts { <t>+ % ',' }; token t { \w+ [ '[' ~ ']' <ts> ]* } }; say G.parse('Foo[bar][and]') | ||
camelia | rakudo-parrot 652a1f, rakudo-jvm 652a1f, rakudo-moar 652a1f: OUTPUT«「Foo[bar][and]」 t => 「Foo[bar][and]」 ts => 「bar」 t => 「bar」 ts => 「and」 t => 「and」» | ||
Mouq | woo | ||
16:30
berekuk joined
|
|||
Mouq | grondilu: sorry if I took the fun out of making that work | 16:30 | |
grondilu | yeah bu it does not parse Foo[bar] as a token | 16:31 | |
I mean, it's supposed to mean (Foo[bar])[and] | |||
16:31
myfree left
|
|||
grondilu | so Foo[bar] should stand out in the parse tree | 16:31 | |
16:32
circuit left
|
|||
grondilu | though I'm not sure, I should verify on wolframalpha | 16:32 | |
anyway yes it parses, but the logic of the grammar is a bit obfustated | 16:33 | ||
16:33
xinming_ left
|
|||
grondilu | *cated | 16:34 | |
16:35
xinming joined
|
|||
[Coke] | grondilu: I presume your actions would make that clear. | 16:36 | |
16:36
circuit joined
|
|||
dalek | rl6-roast-data: bb81017 | coke++ | / (6 files): today First run on new host - not yet automated |
16:38 | |
rl6-roast-data: 12ce0cc | coke++ | bin/cull: New host, new minor version of perl |
|||
FROGGS | and in the end you would use better token names | ||
[Coke] | +S02-types/baghash.rakudo.parrot aborted 64 test(s) | 16:39 | |
16:39
molaf_ joined
|
|||
grondilu | well, yeah I guess. I'm possibly just trying to rationalize the fact that I was unable to come up with this in the first place :/ | 16:39 | |
using alternation seemed so much natural, like in a BNF grammar. And yet it did not work at all. | 16:40 | ||
FROGGS | only 71 fails left on moar!!! | ||
16:40
virtualsue joined
|
|||
FROGGS | TimToady++ | 16:40 | |
Mouq | [Coke]++ | ||
grondilu++ | |||
FROGGS++ | |||
jnthn++ | |||
geekosaur++ | |||
FROGGS | 190 ppl to go :o) | 16:41 | |
189 perhaps | |||
Mouq | masak++ | ||
vendethiel++ | |||
FROGGS | [Coke]: I'm going to have a look at that | ||
vendethiel | wut wat | ||
Mouq | That's everyone I've seen today | ||
grondilu | (@hacker-in-the-world.grep({$_ ~~ Perl6User}))»++ | ||
vendethiel | oh okay Mouq++ | ||
geekosaur | well, you do need to know how the grammar machinery works and what model it uses. I'd write a different thing for LR vs. LALR(1) | 16:42 | |
16:42
molaf left
|
|||
timotimo | grondilu: i think you can write .grep(Perl6User) instead of .grep({ $_ ~~ Perl6User }) | 16:43 | |
grondilu | timotimo: actually not | ||
timotimo | since grep already uses smartmatch semantics for its argument | ||
grondilu | r: say ('foo', 4).grep(Int) | ||
camelia | rakudo-parrot 652a1f, rakudo-jvm 652a1f, rakudo-moar 652a1f: OUTPUT«4» | ||
grondilu | hum | 16:44 | |
I remembered omthing similar that did not work | |||
FROGGS | star: say ('foo', 4).grep(Int) | ||
camelia | star 2013-09: OUTPUT«4» | ||
Mouq definitely didn't realize that | |||
pippo | o/ #perl6 | ||
Mouq | r: say 4 ~~ {$_ ~~ Int} | ||
FROGGS | hi pippo | ||
camelia | rakudo-parrot 652a1f, rakudo-jvm 652a1f, rakudo-moar 652a1f: OUTPUT«True» | 16:45 | |
Mouq | r: say 4 ~~ {$_ ~~ Num} | ||
grondilu | r: subset Even of Int where * %% 2; say (^10).grep(Even) | ||
camelia | rakudo-parrot 652a1f, rakudo-jvm 652a1f, rakudo-moar 652a1f: OUTPUT«False» | ||
rakudo-parrot 652a1f, rakudo-jvm 652a1f, rakudo-moar 652a1f: OUTPUT«0 2 4 6 8» | |||
grondilu | r: subset Even of Int where * %% 2; say (^10).grep(Even) | ||
camelia | rakudo-parrot 652a1f, rakudo-jvm 652a1f, rakudo-moar 652a1f: OUTPUT«0 2 4 6 8» | ||
grondilu | oh, I remember now | ||
pippo | Can someone explain me what does '[' ~ ']' mean in a grammar. Particularly the "~" ? For me is string concatenation but it does not seem used like this there. | 16:46 | |
timotimo | yes, it's the "surrounded by" operator | ||
and it operates on three tokens, rather than two | |||
FROGGS | m: say "[abc]" ~~ /'[' ~ ']' \w+/ | ||
camelia | rakudo-moar 652a1f: OUTPUT«「[abc]」» | ||
grondilu | r: subset TenMultiple where * %% 10; say 0, 1 ... TenMultiple | ||
camelia | rakudo-parrot 652a1f, rakudo-jvm 652a1f, rakudo-moar 652a1f: OUTPUT«0» | ||
timotimo | so a ~ b c means roughly the same as a c b | ||
FROGGS | pippo it is about '<opener>' ~ '<closer>' <something in the middle> | 16:47 | |
timotimo | but it gives extra nice error reporting when b doesn't get found | ||
grondilu | r: subset TenMultiple where * %% 10; say 0, 1 ... TenMultiple # <= here smarmatch does not work as with grep | ||
camelia | rakudo-parrot 652a1f, rakudo-jvm 652a1f, rakudo-moar 652a1f: OUTPUT«0» | ||
timotimo | grondilu: 0 is %% 10, so it stops right there | ||
pippo | FROGGS: timotimo: Thank you! | ||
timotimo | r: subset TenMultiple where * %% 10; say 1, 2 ... TenMultiple | ||
grondilu | r: subset TenMultiple where * %% 10; say 1, 2 ... TenMultiple # <= here smarmatch does not work as with grep | ||
camelia | rakudo-parrot 652a1f, rakudo-jvm 652a1f, rakudo-moar 652a1f: OUTPUT«1 2 3 4 5 6 7 8 9 10» | ||
grondilu | ahh | 16:48 | |
timotimo | the end point gets matched against the whole sequence on the left of ... | ||
r: say 1, 2, 3, 4, 5 ... * > 3; | |||
camelia | rakudo-parrot 652a1f, rakudo-jvm 652a1f, rakudo-moar 652a1f: OUTPUT«1 2 3 4» | ||
grondilu | so it must be something else. I'd swear I once had to write {$_ ~~ SomeType} instead of just SomeType | ||
timotimo | gotta run now | ||
pippo | m: say "[abc[abc]]" ~~ /'[' ~ ']' \w+/; | 16:49 | |
camelia | rakudo-moar 652a1f: OUTPUT«Unable to parse expression in ; couldn't find final ']'  in any FAILGOAL at gen/moar/stage2/QRegex.nqp:1139 in method ACCEPTS at src/gen/m-CORE.setting:12724 in method ACCEPTS at src/gen/m-CORE.setting:798 in block at /tmp/KfKFKnMN8b:1» | ||
Mouq thinks someone should definitely fix that '[' ~ ']' parsefail causes the whole program to die | |||
pippo | m: say "[abc[abc]]" ~~ /'[' ~ ']' .+/; | 16:50 | |
camelia | rakudo-moar 652a1f: OUTPUT«Unable to parse expression in ; couldn't find final ']'  in any FAILGOAL at gen/moar/stage2/QRegex.nqp:1139 in method ACCEPTS at src/gen/m-CORE.setting:12724 in method ACCEPTS at src/gen/m-CORE.setting:798 in block at /tmp/4EvUGTpmwV:1» | ||
timotimo | actually, i can stay \o/ | ||
Mouq | pippo: Your .+ is eating everything to the end | ||
FROGGS | m: say "[abc[abc]]" ~~ /'[' ~ ']' .+?/; | ||
camelia | rakudo-moar 652a1f: OUTPUT«Unable to parse expression in ; couldn't find final ']'  in any FAILGOAL at gen/moar/stage2/QRegex.nqp:1139 in method ACCEPTS at src/gen/m-CORE.setting:12724 in method ACCEPTS at src/gen/m-CORE.setting:798 in block at /tmp/QeGCXYa4vW:1» | ||
Mouq | Uh | ||
FROGGS | n: say "[abc[abc]]" ~~ /'[' ~ ']' .+?/; | 16:51 | |
camelia | niecza v24-109-g48a8de3: OUTPUT«Unhandled exception: Unable to parse anonymous regexCouldn't find final ']'; gave up at /home/p6eval/niecza/lib/CORE.setting line 1536 (die @ 5)  at /home/p6eval/niecza/lib/CORE.setting line 2962 (Cursor.FAILGOAL @ 6)  at /tmp/SwsOyP3T6…» | ||
FROGGS | n: say "[abc[abc]]" ~~ /'[' ~ ']' <-[\]]>+/; | ||
Mouq | m: say "[abc[abc]]" ~~ /'[' .+? ']'/; | ||
camelia | niecza v24-109-g48a8de3: OUTPUT«「[abc[abc]」» | ||
rakudo-moar 652a1f: OUTPUT«「[abc[abc]」» | |||
Mouq | The problem is that it dies on parsefail >:( | 16:52 | |
So it never gets a chance to backtrack | |||
timotimo | yeah, i think we need a better way to add a failure message to a failed parse | ||
better than to die inside the regex | |||
(which you can prevent the whole program from crashing with by using try) | 16:53 | ||
pippo | Mouq: Thanks. | 16:55 | |
16:56
xinming left
16:57
xinming joined
|
|||
FROGGS | r: say BagHash.new("a", "b", "b").grab: * | 17:00 | |
camelia | rakudo-moar 652a1f: OUTPUT«a b b» | ||
..rakudo-parrot 652a1f: OUTPUT«No such method 'value' for invocant of type 'Any' in method grab at gen/parrot/CORE.setting:15867 in block at /tmp/tmpfile:1» | |||
..rakudo-jvm 652a1f: OUTPUT«b a b» | |||
17:00
xfix joined
17:08
xinming left
17:09
xinming joined
17:10
beastd left
17:13
grondilu left
17:14
Rotwang joined,
xinming_ joined
17:15
xinming left
17:16
jnap joined
17:17
denis_boyun joined
17:20
rurban left
17:23
xinming_ left
17:24
xinming joined
|
|||
Mouq wishes `token type:subtype:subsubtype {*}` worked | 17:24 | ||
Mouq is the one who make `token type:subtype {...}` work in the first place, so you don't have to use `token type:sym<subtype> {...}` when you don't actually need a <sym> | 17:25 | ||
17:33
xinming left
17:35
xinming joined
|
|||
TimToady | '[' ~ ']' isn't intended to backtrack, but to commit to the '[' | 17:38 | |
use the old-fashioned form if you want to backtrack | |||
we could maybe do it differently in a regex declaration than in a token declaration, I suppose | 17:42 |