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

Re: ksh autoloading

On Thu, 27 Mar 1997 18:36:04 +0000 (GMT), Zefram <zefram@xxxxxxxxxxxxxxxxx> said:
> Roderick Schertler wrote:
>> One of the nicest things about the ksh semantics are that you can define
>> the function plus run some initialization code.  It sounds like your
>> patch will disallow that.
> Not at all.  Using the zsh style, we can autoload a function foo from
> a file saying:

Well, of course, if the function is written knowing it could run under
ksh or zsh then it can be made to work.  The problem is that a function
which was written in ksh style will suddenly stop working (on first

> Remember that the zsh form of autoloading is the canonical one, to be
> preferred, and technically superior in some ways to the ksh semantics.

I don't see how the zsh behavior is superior, and I do see advantages to
the ksh behavior.  I always figured it was an oversight/misunderstanding
on the part of pws, like the [16]ff business.

Consider a file which provides 3 tightly related functions and runs some
initialization code.  I used such a think for directory stack handling
in ksh, eg.  In ksh you link it to the 3 names.  In zsh you have to do
some work.  I can't think of a real example which zsh makes easier than

> I think it's more important for self-modifying functions using the zsh
> style to work correctly than it is for ksh style functions with
> initialisation code to work exactly the way they do in ksh.

I wanted to be sure you knew you were breaking ksh compatibility.  Since
you know and you still think it's right that's okay with me.  I don't
feel strongly about the issue because there are workarounds.  I used to
use these workarounds before zsh provided any ksh autoloading, I could
go back to using them if I found I needed to start using ksh again.

Roderick Schertler

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