Zsh Mailing List Archive
Messages sorted by:
Reverse Date,
Date,
Thread,
Author
Re: autoload +X[zk]
- X-seq: zsh-workers 10296
- From: Sven Wischnowsky <wischnow@xxxxxxxxxxxxxxxxxxxxxxx>
- To: zsh-workers@xxxxxxxxxxxxxx
- Subject: Re: autoload +X[zk]
- Date: Tue, 28 Mar 2000 13:52:38 +0200 (MET DST)
- In-reply-to: Sven Wischnowsky's message of Tue, 28 Mar 2000 13:40:32 +0200 (MET DST)
- Mailing-list: contact zsh-workers-help@xxxxxxxxxxxxxx; run by ezmlm
I wrote:
> ...
>
> This works by storing a flag in the eprog for the file read that will
> make doshfunc() recurse to execute the function once again on the
> first call. Most of the patch just turns the `alloc' field of the
> eprog struct into a `flags' field and ensures that the call to the
> function (which isn't really in the wordcode) is printed at the end.
>
> Note also the handling of the positional parameters. For the first
> call (i.e.: when the init code from the file is executed) they are not
> set. Only for the appended function call are they set up. This is the
> behaviour the ksh I have here shows.
I wrote that last paragraph after I had written the other stuff and
then tested ksh.
Damn. That doesn't work, because the printing functions just output
`foo "$@"' for the not-really-existing call. Hm. What are we supposed
to do here? Handle positional parameters differently? Output a special
comment as for the other function flags (but that doesn't work with
$functions, but the eprog flag is lost there anyway) or... use another
special option for autoload (but that wouldn't work for $functions
either because that flag-losing thing).
With `work for $functions' I mean: eval "foo() { $functions[foo] }" or
some such.
Bye
Sven
--
Sven Wischnowsky wischnow@xxxxxxxxxxxxxxxxxxxxxxx
Messages sorted by:
Reverse Date,
Date,
Thread,
Author