From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 28289 invoked from network); 25 Oct 1999 17:48:44 -0000 Received: from sunsite.auc.dk (130.225.51.30) by ns1.primenet.com.au with SMTP; 25 Oct 1999 17:48:44 -0000 Received: (qmail 11319 invoked by alias); 25 Oct 1999 17:48:36 -0000 Mailing-List: contact zsh-workers-help@sunsite.auc.dk; run by ezmlm Precedence: bulk X-No-Archive: yes X-Seq: 8418 Received: (qmail 11310 invoked from network); 25 Oct 1999 17:48:36 -0000 Message-ID: <381497ED.EEBF94E9@u.genie.co.uk> Date: Mon, 25 Oct 1999 18:48:29 +0100 From: Oliver Kiddle X-Mailer: Mozilla 4.7 [en] (Win95; I) X-Accept-Language: en MIME-Version: 1.0 To: zsh-workers@sunsite.auc.dk Subject: Re: PATCH: 3.1.6-bart-7: Self-loading auto-functions References: <991025093146.ZM25984@candle.brasslantern.com> Content-Type: text/plain; charset=us-ascii Content-Transfer-Encoding: 7bit Bart Schaefer wrote: > purposes of making `eval $(functions)' work was equally annoying. Further, > it might be useful to differentiate an actual autoloaded function from one > that merely calls "autoload -X". Also, does it differentiate at all between an autoloaded function that was autoloaded with -U at all. I only actually realised what the -U does when checking the documentation now (suppressing alias expansion). It might be clear if this would expand to 'builtin autoload -XU' (if it doesn't already). The autoload -X seems like it could be interesting from the perspective of using it intentionally in a function so that it does some extra stuff the first time it is executed. or to force it to reload every time it is run (though I don't think that can be done without infinite recursion or reloading after running). The latter could be especially useful when I'm debugging completion functions - it can be quite tedious to constantly have to do unfunction _foo; autoload _foo. Actually, it'd be useful to have an option to autoload (-f for force maybe) which does the unfunction first. Do these changes allow you to now declare local functions (which was what started this all off). From what I can make out, it should work with typeset +h functions with the parameter module loaded. I can see one possible problem in this approach. From what I can gather, the +h option saves the value of the parameter, clears it and it is restored when returning. Does this mean that after typeset +h functions, all existing functions are lost until you return? How efficiently would this work - saving and restoring all the functions might not be very efficient. Anyway, I certainly agree that local functions would be useful to have. I'm often forgetting that nested functions aren't local. Oliver Kiddle