From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 6297 invoked from network); 18 Apr 2004 13:35:37 -0000 Received: from sunsite.dk (130.225.247.90) by ns1.primenet.com.au with SMTP; 18 Apr 2004 13:35:37 -0000 Received: (qmail 3898 invoked by alias); 18 Apr 2004 13:35:28 -0000 Mailing-List: contact zsh-workers-help@sunsite.dk; run by ezmlm Precedence: bulk X-No-Archive: yes X-Seq: 19791 Received: (qmail 3883 invoked from network); 18 Apr 2004 13:35:27 -0000 Received: from localhost (HELO sunsite.dk) (127.0.0.1) by localhost with SMTP; 18 Apr 2004 13:35:27 -0000 X-MessageWall-Score: 0 (sunsite.dk) Received: from [130.225.247.86] by sunsite.dk (MessageWall 1.0.8) with SMTP; 18 Apr 2004 13:35:27 -0000 Received: (qmail 30080 invoked from network); 18 Apr 2004 13:35:27 -0000 Received: from d2978.d.pppool.de (HELO athlon) (80.184.41.120) by a.mx.sunsite.dk with SMTP; 18 Apr 2004 13:35:25 -0000 Received: from opk by athlon with esmtp (masqmail 0.2.20) id 1BFCck-0ge-00 for ; Sun, 18 Apr 2004 15:46:18 +0200 In-reply-to: <1040416172538.ZM30371@candle.brasslantern.com> From: Oliver Kiddle References: <1040410174430.ZM10891@candle.brasslantern.com> <1170.1081778412@athlon> <040412085942.ZM19035@candle.brasslantern.com> <3571.1081806187@athlon> <1040413053826.ZM20012@candle.brasslantern.com> <18035.1081870188@trentino.logica.co.uk> <1040413175111.ZM21011@candle.brasslantern.com> <13987.1082134179@trentino.logica.co.uk> <1040416172538.ZM30371@candle.brasslantern.com> To: zsh-workers@sunsite.dk Subject: Re: PATCH: Re: Compsys and KSH_AUTOLOAD Date: Sun, 18 Apr 2004 15:46:18 +0200 Message-ID: <2643.1082295978@athlon> X-Spam-Checker-Version: SpamAssassin 2.63 on a.mx.sunsite.dk X-Spam-Level: **** X-Spam-Status: No, hits=4.0 required=6.0 tests=RCVD_IN_DYNABLOCK, RCVD_IN_SORBS autolearn=no version=2.63 X-Spam-Hits: 4.0 Bart wrote: > On Apr 16, 6:49pm, Oliver Kiddle wrote: > } > } Why do export and readonly accept -f arguments? Is that just to avoid > } errors on bash scripts? Any reason why we shouldn't implement readonly > } functions. > > It could get pretty tricky to have a readonly autoloaded function. Does > the function become readonly only after the autoload occurs? What *can* > one change about a readonly function -- can one `typeset -t' it? If it > hasn't been loaded yet, can the new ksh/zsh autoload flags be changed? We seem to be generous in allowing various typeset flags to be changed for readonly variables so I see little reason to prevent typeset -t. Bash doesn't have autoloadable functions so we can't just look at how it works. We could prevent changing the definition of the function but allow it to be autoloaded if it was already declared autoloadable. And you can't make an existing function autoloadable without first using unfunction anyway. By the way, in a restricted shell, ksh restricts FPATH (zsh doesn't). > BTW, independent of readonly, what do +z and +k mean? Revert the > function to using the current global ksh_autoload setting? What happens > if you use +k on a function that has -z ? They remove the PM_ZSHSTORED or PM_KSHSTORED flag respectively. So if PM_ZSHSTORED is set, +k will do nothing. You need `+k +z' to be sure of returning it to the global ksh_autoload setting. In contrast -z or -k alone will remove a contradictory flag. This is consistent with how the -E and -F flags work: you need `+E +F' to convert a float to scalar. Oliver