Perl 6 - the future is here, just unevenly distributed

IRC log for #marpa, 2017-03-18

| Channels | #marpa index | Today | | Search | Google Search | Plain-Text | summary

All times shown according to UTC.

Time Nick Message
00:17 ronsavage joined #marpa
00:19 idiosyncrat joined #marpa
00:19 idiosyncrat "Eager" lexemes now work in R3.
00:19 idiosyncrat I need to document them, and perhaps add more tests.
00:20 idiosyncrat Then I'll do a release -- the first R3 release with a real new feature in a while.
00:22 idiosyncrat Corner cases: if there's a eager lexemes, but also a lazy lexeme at the same location, *BOTH* are reported -- I will be adding priorities, and that will allow you to exclude one or the other if desired.
00:23 idiosyncrat Also, note that a lazy lexeme may be *shorter* than an eager lexeme.  If it is shorter, but not the longest lazy lexeme, the eager lexeme is reported.  But note, as above, all lexemes at the eager lexeme's location will also be reported, including any lazy ones.
00:24 idiosyncrat s/if there's a eager lexemes/if there is an eager lexeme/
00:26 idiosyncrat If the longest lazy lexeme is shorter than the shortest eager lexeme, then the longest lazy lexeme is reported, and the eager lexemes are not reported.
00:27 idiosyncrat Btw, if any of you know where in my R3 documentation is the best place to document these corner cases, please let me know.  My memory as to what is discussed where is very very stale.
00:45 ronsavage JK: Re http://irclog.perlgeek.de/marpa/2017-03-18#i_14284488: You asked about R3 but perhaps you meant R2. So I searched this doc for 'longest' and found https://metacpan.org/pod/distribution/Marpa-R2/pod/Scanless/DSL.pod#latm.
01:42 idiosyncrat ronsavage: Actually I meant R3, but the R2 answer is relevant anyway -- it does show where in R2 I put that kind of discussion, so I'll do similarly in R3.  Thanks!!
01:44 idiosyncrat re https://irclog.perlgeek.de/marpa/2017-03-18#i_14284482 -- Now that I think about it, that's not right -- if the longest lazy lexeme is shorter than the shortes eager lexeme, the eager lexeme wins.
01:45 idiosyncrat The justification is this -- from the lazy point of view, the eager lexeme is laziest, so it should win.
01:45 idiosyncrat From the eager point of view, intuitively that means report as soon as the first one found, and the eager lexeme is first eager lexeme found.
01:46 idiosyncrat s/shortes/shortest/
01:47 idiosyncrat Btw, this documentation phase I find is often important in spotting bugs.  Writing stuff out forces me to think out all the corner cases, sometimes to realize stuff that needs more testing, and sometimes to reveal things I overlooked.
01:48 idiosyncrat At times in Perl's history (5.10 I'm looking at you) features were allowed to go out with incomplete or sketchy documentation.  These features very often were the ones that needed backing out.
01:51 idiosyncrat As one consideration -- if it takes "too much time" to document something, that means you haven't fully worked it out.  And if you haven't fully worked out how it should work, you cannot possibly know that it does work.
01:51 idiosyncrat This is why R3's documentation is kept up to date as I go along.
01:58 idiosyncrat re https://irclog.perlgeek.de/marpa/2017-03-18#i_14284488 -- Where to document lexeme behavior, eager vs. lazy, etc etc.
01:59 idiosyncrat The "latm" adverb was removed in R3, but what I take is that I documented the behavior under the appropriate adverb, so the details of eager vs. lazy behavior will be documented with the "eager" adverb on the Scanless/DSL.pod page.
02:00 idiosyncrat Someone looking for that kind of discussion is highly likely to go there, so it's a great place for it.
02:46 kaare_ joined #marpa
02:49 ilbot3 joined #marpa
02:49 Topic for #marpa is now Start here: http://savage.net.au/Marpa.html - Pastebin: http://scsys.co.uk:8002/marpa - Jeffrey's Marpa site: http://jeffreykegler.github.io/Marpa-web-site/ - IRC log: http://irclog.perlgeek.de/marpa/today
03:08 idiosyncrat :lexeme ~ literal eager => 1
03:08 idiosyncrat <literal> ~ '[[' <stuff> ']]'
03:08 idiosyncrat <stuff> ~ <any char>
03:09 idiosyncrat <any char> ~ [\d\D]
03:10 idiosyncrat Above is one example of why eager lexemes are handy.  Ordinarily if you want to say 'stuff in double brackets' using Marpa or a regular expression, you have to go to some effort to describe the <stuff> in the middle,
03:10 idiosyncrat so that it eats up single brackets, but does not eat up a double bracket terminator.
03:12 idiosyncrat With "eager", I was able to define <stuff> as literally just anything.  The ']]' is still found, because an "eager" lexeme tries to be as short as possible, and that's the shortest alternative.
03:13 idiosyncrat So when deciding what to do with a bracket, Marpa takes it as part of a pair of closing square brackets whenever possible, and as part of <stuff> otherwise.
03:15 idiosyncrat "Eager" allows you to avoid defining the complement of a terminator.  It is always possible to define the complement of any regular expression, but it is not always easy, and "eager" allows you to avoid it.
05:20 idiosyncrat Good night!
16:04 idiosyncrat joined #marpa
22:18 ronsavage joined #marpa
22:43 ronsavage Thinking more about the doc for eager/lazy, I think you /really/ need to present it as a table, presumably with eager on 1 axis and lazy of the other, and each intersection can discuss the lengths which contribute to the output(s).

| Channels | #marpa index | Today | | Search | Google Search | Plain-Text | summary