On Mon, Sep 09, 2002 at 02:14:25PM -0500, Me wrote:
> Hence the introduction of let:
> 
>     m/ { let $date := <date> } /
> 
> which makes (a symbol table like entry for) $date available
> somewhere via the match object.

Somewhere?  where it appears in in the namespace of the caller.
Apparently there is no way to use someone else's grammar and prevent it
trashing your namespace.

> And has the additional effect that $date (I think the whole
> variable/entry, but at the very least its value) disappears
> if the match backtracks over the closure.
> 
> Right?

As I understand it that is the intent.

Perhaps what we need is something like @EXPORT and @EXPORT_OK for
hypotheticals in grammars.  I'm not suggesting those as names, but
something along those lines.  It would give the caller some degree of
protection if they had to specifically ask you to overwrite their
variables with hypothetically bound results.

I think if we don't do something like that it's going to make other
peoples grammars very hard to use.  You will have to read them and know
which variables they will mess with before you start.

andrew
-- 
Scorpio: (Oct. 24 - Nov. 21)
It's been almost three decades, but you think you're finally beginning to
recover from the long, national nightmare of Vietnam movies.

Reply via email to