zsh-workers
 help / color / mirror / code / Atom feed
From: Oliver Kiddle <opk@u.genie.co.uk>
To: zsh-workers@sunsite.auc.dk
Subject: Re: PATCH: 3.1.6-bart-7: Self-loading auto-functions
Date: Mon, 25 Oct 1999 18:48:29 +0100	[thread overview]
Message-ID: <381497ED.EEBF94E9@u.genie.co.uk> (raw)
In-Reply-To: <991025093146.ZM25984@candle.brasslantern.com>

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


  parent reply	other threads:[~1999-10-25 17:48 UTC|newest]

Thread overview: 7+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
1999-10-25  9:31 Bart Schaefer
1999-10-25  9:46 ` Bart Schaefer
1999-10-25 17:48 ` Oliver Kiddle [this message]
1999-10-25 20:32   ` Bart Schaefer
1999-10-25  9:53 Sven Wischnowsky
1999-10-25 10:27 ` Zefram
1999-10-25 10:40 Sven Wischnowsky

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=381497ED.EEBF94E9@u.genie.co.uk \
    --to=opk@u.genie.co.uk \
    --cc=zsh-workers@sunsite.auc.dk \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
Code repositories for project(s) associated with this public inbox

	https://git.vuxu.org/mirror/zsh/

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).