semantics_package and new()

22 views
Skip to first unread message

Durand Jean-Damien

unread,
Dec 22, 2013, 11:20:47 AM12/22/13
to marpa-...@googlegroups.com
Jeffrey,

Is semantics_package's new() method supposed to be called if it exist ?

C.f. file attached.

Thanks / JD.

semantics_package.pl

Jeffrey Kegler

unread,
Dec 22, 2013, 12:12:39 PM12/22/13
to marpa-...@googlegroups.com
Thanks for finding this.  Fixed in commit ddcb710ae7b7891a65aa228422e69c334c850111.  -- 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 marpa-parser...@googlegroups.com.
For more options, visit https://groups.google.com/groups/opt_out.

Durand Jean-Damien

unread,
Dec 22, 2013, 1:22:14 PM12/22/13
to marpa-...@googlegroups.com
Tested OK - Thanks / JD.

Durand Jean-Damien

unread,
Dec 22, 2013, 5:49:18 PM12/22/13
to marpa-...@googlegroups.com
A comment: I realise that, since Marpa is using the *codename{'CODE'} method to resolve the actions, semantic_package, and probably action_object as well, must give a package name that explicitely provide slots for actions in its namespace. I.e. Marpa does not work with packages that would use the:

use parent 'Parent::Package';

method, letting inheritance do its role (example: the action named myAction in somewhere else), but only with:

use parent 'Parent::Package';
user SUPER;

sub myAction {
  # eventually calling super() is enough
}

I have not checked yet with Moose family, but I suppose this is the same thing.

Fine with me, but perhaps to be mentionned in the doc, if not already in.

Thanks / JD.

Jeffrey Kegler

unread,
Dec 23, 2013, 8:32:09 PM12/23/13
to marpa-...@googlegroups.com
At some point it may make sense to allow a resolve_name() callback, which will allow the user to write their own code to resolve names.

As an aside, Marpa's development has coincided with a time during which OO experimentation was very fashionable.  A few people have looked at Marpa and seen it as an OO experiment wanting to happen.  I keep the OO to a minium because IMHO a lot of open source R&D time is being lost because of excessive interest in OO.

-- jeffrey

Reply all
Reply to author
Forward
0 new messages