zsh-workers
 help / color / mirror / code / Atom feed
From: "Bart Schaefer" <schaefer@brasslantern.com>
To: Sven Wischnowsky <wischnow@informatik.hu-berlin.de>,
	zsh-workers@math.gatech.edu
Subject: Re: wrapper functions in modules
Date: Fri, 11 Dec 1998 09:40:53 -0800	[thread overview]
Message-ID: <981211094053.ZM21039@candle.brasslantern.com> (raw)
In-Reply-To: <199812111416.PAA03428@beta.informatik.hu-berlin.de>

On Dec 11,  3:16pm, Sven Wischnowsky wrote:
} Subject: Re: wrapper functions in modules
}
} [...] my first idea was to let modules register only one function
} which would have to call back the execution code [...]
} This would solve the call stack problems you mentioned. Also, writing
} wrappers would be easier in modules since you can use local variables, 
} static local variables for number-of-calls and so on...

This would indeed be an improvement.  An interesting side-effect is that
it would permit a module to decide not to run the shell function at all;
it could instead branch off into any code it liked.

That in turn probably makes modules even more dangerous than before, from
a run-time perspective.  An innoccuous module placed in root's module path
could suddenly have someone else driving the shell.  It might even be a
good idea to have zsh refuse to dynamically load modules when EUID==0, or
at least refuse to auto-load them.

} About the problems with unloading: I would vote for completely
} disallowing to unload a module if a wrapper is active for it.
} This is relatively easy to keep track of and seems to be the savest

(Safest.)  This still isn't quite good enough -- you can't unload
modules upon which other modules depend, so if X has a wrapper and
depends on Y, you can't unload Y even though Y has no wrapper.

This probably means you end up refusing to unload any modules at all
whenever there are any wrappers at all, which may be problematic.

} the question is: how often does one want to unload modules in shell
} functions?

I could envision someone wanting to write a pair of functions, one that
installs several related modules and another that uninstalls them again.

} Finally about the order in which installed wrappers are to be called:
} looking at load_module() it should be enough to build the wrappers
} list by appending new definitions to the end.

Yes, as I said, if the only constraint is module dependencies this will
work fine.

Side note to Phil Pennock:  If we get this worked out, then an emulator
module for ksh would be the perfect way to fudge WORDCHARS and various
keybindings for later restoration ...

-- 
Bart Schaefer                                 Brass Lantern Enterprises
http://www.well.com/user/barts              http://www.brasslantern.com


  reply	other threads:[~1998-12-11 17:50 UTC|newest]

Thread overview: 9+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
1998-12-11 14:16 Sven Wischnowsky
1998-12-11 17:40 ` Bart Schaefer [this message]
  -- strict thread matches above, loose matches on Subject: below --
1998-12-16  8:05 Sven Wischnowsky
1998-12-16  9:50 ` Bart Schaefer
1998-12-15 12:03 Sven Wischnowsky
1998-12-15 17:05 ` Bart Schaefer
1998-12-14 10:11 Sven Wischnowsky
1998-12-14 18:42 ` Bart Schaefer
1998-12-09 14:44 PATCH: " Sven Wischnowsky
1998-12-11 13:18 ` Bart Schaefer

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=981211094053.ZM21039@candle.brasslantern.com \
    --to=schaefer@brasslantern.com \
    --cc=wischnow@informatik.hu-berlin.de \
    --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).