Zsh Mailing List Archive
Messages sorted by: Reverse Date, Date, Thread, Author

Re: Proof of concept: "static" parameter scope



On Fri, 25 Sep 2015 10:15:40 +0100
Peter Stephenson <p.stephenson@xxxxxxxxxxx> wrote:
> On Thu, 24 Sep 2015 19:23:05 -0700
> Bart Schaefer <schaefer@xxxxxxxxxxxxxxxx> wrote:
> > Modules can't declare keywords, so this isn't able to support the new
> > array assignment syntax used by "local" et al.  However, the entry point
> > is coded to match that call signature.
> 
> I think the biggest issue with fixing this is it's going to change the
> "features" interface to modules as we'll have to add a feature type that
> defines a typeset-style interface (and a corresponding reserved word,
> but I think we can tie the two together).

I wonder if it's easier than that.  If the builtin has the BINF_ASSIGN
flag then the module code could do that automatically without the module
needing to declare a different sort of feature.  As long as the
interface is correct, simply adding a reserved word with the token
TYPESET should be enough.

The trouble is it needs to know this early, because anything using this
builtin with the assignment interface needs to be parsed properly.  In
particular, it would have to be registered as a reserved word at any
point it wsa marked for autoload.  But maybe an additional flag is good
enough for that.

pws



Messages sorted by: Reverse Date, Date, Thread, Author