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

Re: autoload +X[zk]



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