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

Re: r/w access to calling function's $@



# p.stephenson@xxxxxxxxxxx / 2014-05-13 17:13:21 +0100:
> On Tue, 13 May 2014 18:01:40 +0200
> Roman Neuhauser <neuhauser@xxxxxxxxxx> wrote:
> > zparseopts can modify $@ in the calling scope.  i'm playing with my own,
> > slightly different option parser.  what do i have to do to get access to
> > this feature?
> 
> The trick is it's not a different scope, it's just a builtin within the
> current function scope.  The equivalent would be to implement your own C
> plugin, which I presume is not what you're after.

yeah, i was hoping there was a way to implement "builtins" in zsh
(as opposed to C).

> Failing that you have to do something nasty like using "eval" to avoid
> exposing the point where it gets transferred to the current argument
> set.

not sure what exactly you have on mind here, could you give me a sketch?

> (While I've been distracting you, Bart will meanwhile have thought
> of a way of doing it.)

That reminds me: thanks for the many years of work on zsh, and great support
you two provide seemingly tirelessly. 

-- 
roman



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