zsh-workers
 help / color / mirror / code / Atom feed
From: Oliver Kiddle <okiddle@yahoo.co.uk>
To: zsh-workers@sunsite.dk
Subject: Re: PATCH: Re: Compsys and KSH_AUTOLOAD
Date: Sun, 18 Apr 2004 15:46:18 +0200	[thread overview]
Message-ID: <2643.1082295978@athlon> (raw)
In-Reply-To: <1040416172538.ZM30371@candle.brasslantern.com>

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


  reply	other threads:[~2004-04-18 13:35 UTC|newest]

Thread overview: 20+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2004-04-10 17:44 Bart Schaefer
2004-04-12 14:00 ` Oliver Kiddle
2004-04-12 15:59   ` Bart Schaefer
2004-04-12 21:43     ` Oliver Kiddle
2004-04-13  5:32       ` While we're on the subject of zcompile Bart Schaefer
2004-04-17 21:08         ` Oliver Kiddle
2004-04-13  5:38       ` Compsys and KSH_AUTOLOAD Bart Schaefer
2004-04-13 15:29         ` PATCH: " Oliver Kiddle
2004-04-13 17:51           ` Bart Schaefer
2004-04-16 16:49             ` Oliver Kiddle
2004-04-16 17:25               ` Bart Schaefer
2004-04-18 13:46                 ` Oliver Kiddle [this message]
2004-04-16 17:30               ` Bart Schaefer
2004-04-17 19:51                 ` Oliver Kiddle
2004-04-19  0:14                   ` Bart Schaefer
2004-04-19 10:18                     ` Oliver Kiddle
2004-04-20  4:11                       ` Bart Schaefer
2004-04-20 10:08                         ` Oliver Kiddle
2004-04-14  5:04           ` Bart Schaefer
2004-04-14 19:55 ` Peter Stephenson

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=2643.1082295978@athlon \
    --to=okiddle@yahoo.co.uk \
    --cc=zsh-workers@sunsite.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).