Perl 6 - the future is here, just unevenly distributed

IRC log for #marpa, 2016-11-06

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

All times shown according to UTC.

Time Nick Message
03:19 Idiosyncrat joined #marpa
03:19 Idiosyncrat Jdurand: re https://irclog.perlgeek.de/marpa/2016-11-05#i_13521487
03:21 Idiosyncrat The following is off the top of my head, but I think it's fairly accurate --
03:21 Idiosyncrat Let <Exp> be the LHS of our prioritized rule.
03:22 Idiosyncrat In rewriting the alternatives of a prioritized rule, all RHS occurences of <Exp> must be give a priority.
03:22 Idiosyncrat s/give/given/
03:23 Idiosyncrat That's how associativity is implemented.
03:23 Idiosyncrat So for each alternative I need a "current" and a "next" priority.
03:26 Idiosyncrat But what should be the "next" priority of the topmost priority?
03:28 Idiosyncrat As implemented, Marpa::R2 "wraps around", so that the next priority of the topmost priority is the lowest (tightest) priority.
03:34 Idiosyncrat === OK, I went back to the code and docs, so scratch that.  I'll start over. ===
03:35 Idiosyncrat Let <Exp> be the LHS of our prioritized rule.
03:35 Idiosyncrat In rewriting the alternatives of a prioritized rule, all RHS occurences of <Exp> must be given a priority.
03:35 Idiosyncrat That's how associativity is implemented.
03:36 Idiosyncrat For left associativity, for example, the leftmost <Exp> gets the "current" priority, and all the other occurrences of <Exp> get the "next" priority.
03:37 Idiosyncrat The "next" priority is "tighter" than the current priority.
03:38 Idiosyncrat But what to do is the "current" priority is the tightest possible?
03:39 Idiosyncrat As Marpa::R2 is currently implemented, the priorities "wrap around", so the "next" priority of the tightest priority is the loosest priority.
03:39 Idiosyncrat The comment indicates that I no longer think this was a very good idea.
03:41 Idiosyncrat The issue never comes up, because the "arity" of the tightest priority is, in practice, almost always zero.
03:41 Idiosyncrat Here "arity" means the number of RHS occurences of <Exp> ...
03:41 Idiosyncrat so that an alternative with an arity of zero has no RHS occurrences of <Exp>
03:42 Idiosyncrat and therefore the issue of what priority to give the RHS occurrences of <Exp> does not come up.
03:43 Idiosyncrat If I had it to do over, the "next" priority of the tighest priority would be the tightest priority, so that the priorities "dead end", rather than "wrapping around".
03:44 Idiosyncrat jdurand: I hope that helps.
03:44 Idiosyncrat Sorry about the false start.
04:17 idiosyncrat_ Good night!
06:21 jdurand Many thanks!
06:37 jdurand FYI I reproduced the "difference" with this simple grammar: <Expression> ::= Number | '(' Expression Expression ')' assoc => left || Expression '**' Expression assoc => right
06:38 jdurand The current Marpa implementation will say, for the set of alternatives:
06:38 jdurand Expression[1] ::= [Lex-0] Expression[1] Expression[0] [Lex-1]
06:39 jdurand while the version that does what say the comment would produce:
06:39 jdurand Expression[1] ::= [Lex-0] Expression[1] Expression[1] [Lex-1]
06:42 jdurand ("for the first set of alternatives")
08:56 maybekoo2 joined #marpa
11:51 maybekoo2 joined #marpa
15:32 maybekoo2 joined #marpa
16:57 sirdancealot joined #marpa
21:41 ronsavage joined #marpa
22:19 ronsavage joined #marpa

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