From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 319 invoked from network); 27 Mar 1997 18:39:42 -0000 Received: from euclid.skiles.gatech.edu (list@130.207.146.50) by coral.primenet.com.au with SMTP; 27 Mar 1997 18:39:42 -0000 Received: (from list@localhost) by euclid.skiles.gatech.edu (8.7.3/8.7.3) id NAA10233; Thu, 27 Mar 1997 13:34:01 -0500 (EST) Resent-Date: Thu, 27 Mar 1997 13:34:01 -0500 (EST) From: Zefram Message-Id: <1424.199703271836@stone.dcs.warwick.ac.uk> Subject: Re: ksh autoloading To: roderick@argon.org (Roderick Schertler) Date: Thu, 27 Mar 1997 18:36:04 +0000 (GMT) Cc: zsh-workers@math.gatech.edu (Z Shell workers mailing list) In-Reply-To: from "Roderick Schertler" at Mar 27, 97 01:15:19 pm X-Loop: zefram@dcs.warwick.ac.uk X-Stardate: [-31]9088.87 X-Phase: The Moon is Waning Gibbous (88% of Full) X-US-Congress: Moronic fuckers X-Personality: INTJ X-This-is-not-HTML: Content-Type: text Resent-Message-ID: <"WGG2L2.0.qV2.PshEp"@euclid> Resent-From: zsh-workers@math.gatech.edu X-Mailing-List: archive/latest/3040 X-Loop: zsh-workers@math.gatech.edu Precedence: list Resent-Sender: zsh-workers-request@math.gatech.edu 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