zsh-workers
 help / color / mirror / code / Atom feed
From: Zefram <zefram@fysh.org>
To: pws@pwstephenson.fsnet.co.uk (Peter Stephenson)
Cc: zsh-workers@sunsite.auc.dk
Subject: Re: Namespaces again (was: RE: PATCH: Add jobdirs association to parameter module)
Date: Wed, 15 Dec 1999 10:28:52 +0000 (GMT)	[thread overview]
Message-ID: <E11yBfw-0004PC-00@crucigera.fysh.org> (raw)
In-Reply-To: <E11y1dV-0003ny-00.1999-12-14-23-45-41@cmailg4.svr.pol.co.uk> from Peter Stephenson at "Dec 14, 1999 11:46:41 pm"

Peter Stephenson wrote:
>I think Andrej was saying ${a.b} should be invalid, which I agree with
>since otherwise it complicates things mightily --- i.e, if there are any
>dots in a name, there must be one at the beginning.  Just allowing
>`.' separators might be enough for testing, but it's too much of a hack for
>normal use.  Unfortunately, catching all the relevant entry points to the
>parameter code to test this sort of thing tends to be rather a nuisance.

I don't see a problem with allowing ${a.b}.  In fact, I see it being
useful in scripts, and it doesn't complicate anything.  The shell's
special parameters (other than those with historically established names)
should all have names beginning with ".", but names not beginning with
"." that contain "." should be available to the user.

>It would be nice to get the full module name into the namespace, but
>perhaps ${.parameter.options} is a bit long.

No need.  Put the parameters from the zsh/* module namespace into the
${.zsh.*} parameter namespace; we can manage the clashes as we already do.
Other module writers can do the same kind of namespace tricks.  We could
formalise that: parameters whose names begin with "." have a hierarchical
namespace managed in the same way as the module namespace and with the
same top-level delegations.  That would give every potential module
writer some guaranteed parameter namespace.

Next possibility: add parameters ${.zsh.path}, ${.zsh.module_path}, etc.,
as aliases for $path, $module_path and so on.  Then we can have an option
to make the non-. names non-special.  Only zsh-specific scripts could
do that, of course, but the freeing of the namespace is a non-trivial
advantage that would make it desirable.

>                                                 mapfile is perhaps the
>only candidate, but then ${.mapfile.what?}, or can we get away with
>${.mapfile} ?

If following the module namespace, make it ${.zsh.mapfile}.  If we want
to add other parameters to that module later, there's nothing to stop
${.zsh.mapfile.foo} coexisting.

-zefram


  reply	other threads:[~1999-12-15 10:29 UTC|newest]

Thread overview: 5+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
1999-12-14 14:30 Sven Wischnowsky
1999-12-14 23:46 ` Peter Stephenson
1999-12-15 10:28   ` Zefram [this message]
  -- strict thread matches above, loose matches on Subject: below --
1999-12-15  8:24 Sven Wischnowsky
1999-12-14 13:33 PATCH: Add jobdirs association to parameter module Sven Wischnowsky
1999-12-14 14:18 ` Namespaces again (was: RE: PATCH: Add jobdirs association to parameter module) Andrej Borsenkow

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=E11yBfw-0004PC-00@crucigera.fysh.org \
    --to=zefram@fysh.org \
    --cc=pws@pwstephenson.fsnet.co.uk \
    --cc=zsh-workers@sunsite.auc.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).