From: Peter Stephenson <p.w.stephenson@ntlworld.com>
To: zsh-workers@sunsite.dk
Subject: Re: [PATCH] Proposal: stat -> zstat
Date: Mon, 07 May 2007 01:58:53 +0100 [thread overview]
Message-ID: <200705070058.l470wrfU010024@pwslaptop.csr.com> (raw)
In-Reply-To: Message from Phil Pennock <zsh-workers+phil.pennock@spodhuis.org> of "Sun, 06 May 2007 07:00:00 PDT." <20070506140000.GA80030@redoubt.spodhuis.org>
Phil Pennock wrote:
> Is it worth adding to the spec that the features will be processed
> left-to-right, so that interactions between features will work? Eg,
> disable all except certain aspects? Most modules will never use this,
> thankfully.
For now, features are likely to mean individual features rather than
groups, but it certainly makes sense to specify they'll be parsed left
to right at the outset.
> zmodload -F zsh/pcre -:builtins :condops
> zmodload -F zsh/files :files -mv :fs
>
> (hypothetically putting "sync" in an ":fs" category)
>
> And yes, the : as a part of the name instead of a separator is
> distinctly un-shell-like, I use it here only so that those similarly
> afflicted will understand what I mean.
I was actually thinking of using ":" but in a different way: "b:" for a
builtin, "p:" for a shell parameter, "c:" for a condition, "m:" for a
math function, so you'd do
zmodload -Fi zsh/stat b:zstat
in the case in question. The main reason for this is to disambiguate
the different namespaces. It would be natural to allow
zmodload -mFi zsh/stat 'b:*'
which is very similar to existing syntax. So I suppose that means we
could ensure that something like
zmodload -mFi zsh/stat 'b:*' -b:stat
would work (load all builtins but disable "stat"). However, explicitly
disabling things gets us back in the mess we've just climbed out
of---each chunk of code knows what it needs, and should be able to
request only those features, but doesn't know what the rest of the shell
needs or doesn't need, so should just leave those alone. (Unless we can
come up with a rule where we take the net effect of a set of patterns
and then apply them, so that b:stat ends up being left alone. I think
that's going to be too complicated.)
> On the other hand, arguing devil's advocate, what would the feature
> infrastructure provide that's not already available via zsh/parameters
> and use of enable/disable?
Natural integration of shell code using different features. The disable
business, as you've already spotted, is not a very pleasant way of
getting rid of a bit you don't want, since someone else may want it
and not expect it to be disabled. Explicit feature requests act
separately and fit together without any special action.
--
Peter Stephenson <p.w.stephenson@ntlworld.com>
Web page now at http://homepage.ntlworld.com/p.w.stephenson/
next prev parent reply other threads:[~2007-05-07 1:00 UTC|newest]
Thread overview: 20+ messages / expand[flat|nested] mbox.gz Atom feed top
2007-05-03 5:39 Phil Pennock
2007-05-03 8:50 ` Peter Stephenson
2007-05-06 1:07 ` Phil Pennock
2007-05-06 11:57 ` Peter Stephenson
2007-05-06 14:00 ` Phil Pennock
2007-05-07 0:58 ` Peter Stephenson [this message]
2007-05-03 14:48 ` Bart Schaefer
2007-05-03 15:46 ` Peter Stephenson
2007-05-07 5:31 ` Bart Schaefer
2007-05-08 14:40 ` Peter Stephenson
2007-05-09 17:19 ` Bart Schaefer
2007-05-09 17:47 ` Peter Stephenson
2012-06-29 9:40 4.3.17 unset RPS1 vs RPROMPT Phil Pennock
2012-06-29 10:02 ` Mikael Magnusson
2012-06-29 13:32 ` Phil Pennock
2012-06-29 17:35 ` Bart Schaefer
2012-06-29 18:52 ` Peter Stephenson
2012-06-30 5:05 ` Phil Pennock
2012-06-30 17:31 ` Bart Schaefer
2012-07-01 17:39 ` 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=200705070058.l470wrfU010024@pwslaptop.csr.com \
--to=p.w.stephenson@ntlworld.com \
--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).