zsh-workers
 help / color / mirror / code / Atom feed
From: Zoltan Hidvegi <hzoli@cs.elte.hu>
To: zsh-workers@math.gatech.edu (Zsh workers list)
Subject: autoloaded function behaviour
Date: Tue, 3 Sep 1996 22:25:28 +0200 (MET DST)	[thread overview]
Message-ID: <199609032025.WAA06763@bolyai.cs.elte.hu> (raw)

There is a problem with the present function autoloading scheme.  It is not
a big problem, it just seems that it is too ksh compatible.

As you all know zsh originally assumed that in the file it loads only the
function body is stored while ksh simply executes the file in the current
shell environment then executes the required function.

To hack in ksh compatibility zsh first assumes that the file is the body of
the function and executes this as a function.  If the executed function is
redefined during that process then it is executed again.  This means that
if a zsh function uses the old zsh way for autoloading and it redefines
itself, the redefined function will be executed after the real function
exits.  The only way to prevent this is by using ksh-style autoloding.  In
that case there is no way to be compatible with both the original zsh and
the ksh behaviour.

This can be left as it is saying that it is a rare case with a workaround
and actually I prefer.  The only other solution I see now is to add a new
option which forces the original zsh behaviour.

Zoltan


                 reply	other threads:[~1996-09-03 21:03 UTC|newest]

Thread overview: [no followups] expand[flat|nested]  mbox.gz  Atom feed

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=199609032025.WAA06763@bolyai.cs.elte.hu \
    --to=hzoli@cs.elte.hu \
    --cc=zsh-workers@math.gatech.edu \
    /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).