From: Sven Wischnowsky <wischnow@informatik.hu-berlin.de>
To: zsh-workers@math.gatech.edu
Subject: Re: wrapper functions in modules
Date: Fri, 11 Dec 1998 15:16:46 +0100 (MET) [thread overview]
Message-ID: <199812111416.PAA03428@beta.informatik.hu-berlin.de> (raw)
In-Reply-To: "Bart Schaefer"'s message of Fri, 11 Dec 1998 05:18:22 -0800
Bart Schaefer wrote:
> ... [ several serious problems with the wrapper functions ]
I stand corrected.
And damn, my first idea was to let modules register only one function
which would have to call back the execution code, i.e.:
doshfunc(...)
{
...
runshfunc(list, wrappers);
...
}
runshfunc(List list, FuncWrap wrap)
{
if (wrap)
wrap->func(list, wrap->next);
else {
...
execlist(...);
...
}
}
example_wrapper(List list, FuncWrap wrap) // from module
{
... do something
runshfunc(list, wrap);
... restore something
}
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...
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,
the question is: how often does one want to unload modules in shell
functions?
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.
Ok. No patch for now, just the question: does this sound ok?
And, of course, if someone has ideas for a completely different
solution, I would like to hear about it.
Bye
Sven
--
Sven Wischnowsky wischnow@informatik.hu-berlin.de
next reply other threads:[~1998-12-11 14:21 UTC|newest]
Thread overview: 9+ messages / expand[flat|nested] mbox.gz Atom feed top
1998-12-11 14:16 Sven Wischnowsky [this message]
1998-12-11 17:40 ` Bart Schaefer
-- 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=199812111416.PAA03428@beta.informatik.hu-berlin.de \
--to=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).