Zsh Mailing List Archive
Messages sorted by:
Reverse Date,
Date,
Thread,
Author
Re: ksh autoloading
- X-seq: zsh-workers 3040
- From: Zefram <zefram@xxxxxxxxxxxxxxxxx>
- To: roderick@xxxxxxxxx (Roderick Schertler)
- Subject: Re: ksh autoloading
- Date: Thu, 27 Mar 1997 18:36:04 +0000 (GMT)
- Cc: zsh-workers@xxxxxxxxxxxxxxx (Z Shell workers mailing list)
- In-reply-to: <pzpvwlurpk.fsf@xxxxxxxxxxxxxxxxx> from "Roderick Schertler" at Mar 27, 97 01:15:19 pm
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:
foodate=`date`
foo () {
echo $foodate
}
foo
whereas the ksh equivalent merely omits that last line. One could even do
foodate=`date`
foo () {
echo $foodate
}
[[ -n "${ZSH_VERSION+set}" ]] && foo
to make it work the same under both ksh and zsh.
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 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. Not to
mention that the new system is simpler.
-zefram
Messages sorted by:
Reverse Date,
Date,
Thread,
Author