:default ::= action => ::array sound the best to me, because it is natural 
when we read a grammar to expect as many values as there are RHS.

I quite liked to proposal of ron, although IMHO lhs better fits in 
blessing, despite the fact that beginners will always certainly do 
Data::Dumper(), whose output is simply unmanagable with  hundreds of 
blessed structures - in contrary to a lhs that would be added to [values]. 
But I'd not make that a default.

What puzzles me is the presence of "interface 2", or is it "revision 2". 
Meaning is clear. Backward compatibility constraint is clear. But this look 
strange. Unfortunately, until a major version change, there is no real 
alternative.

Le samedi 15 février 2014 18:29:06 UTC+1, Jeffrey Kegler a écrit :
>
> I'd like opinions on adding a "interface" statement to the SLIF.
> Currently, for backward compatibility reasons, some of the defaults are
> not the best.  I'd like to add a
>
>     interface 2
>
> statement which, if present, will makes these the new defaults:
>
>   lexeme default = forgiving => 1
>   :default ::= action => ::array
>
> The first line would make LATM the default, and the second would make
> the make the default semantics for rules return the child values in
> an array.
>
> A specific reason for changing the default for rule semantics is that
> in the first stages of development, array output is useful in checking
> your grammar.  So it's a great way to start.
>
> The current behavior, returning 'undef' by default, is especially
> perplexing to newcomers to Marpa.  It means that, by default, value()
> returns \undef on success, and undef on failure.  This behavior is
> unintuitive, unhelpful and confusing.
>
> A specific question I have: Should one of the bless options also be the
> default for rules?  If so, what about lexemes?  A reason not to bless
> is clutter.  A reason to bless is that it provides even more information
> for grammar checking.
>
> As usual, these defaults will be able to be overriden, but they do make
> a real difference in convenience, and to those just finding their way
> in Marpa.  Whichever is the choice, I'll change all the synopses in the
> docs to include a
>
>   revision 2
>
> statement at the beginning, so that it becomes more or less like the
> "use strict", etc. incantation at the beginning of Perl scripts.
>
> Please comment or ask questions -- jeffrey
>
>

-- 
You received this message because you are subscribed to the Google Groups 
"marpa parser" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to [email protected].
For more options, visit https://groups.google.com/groups/opt_out.

Reply via email to