zsh-workers
 help / color / mirror / code / Atom feed
From: Bruce Stephens <b.stephens@isode.com>
To: zsh-workers@math.gatech.edu
Subject: Associative arrays, structured namespaces
Date: 10 Jun 1998 11:24:05 +0100	[thread overview]
Message-ID: <vbaf7lzha2.fsf@snake.isode.com> (raw)
In-Reply-To: Zefram's message of "Tue, 9 Jun 1998 21:02:21 +0100 (BST)"

Zefram <zefram@tao.co.uk> writes:

> One of the conventions I established was that all environment
> variables, except for strictly user-generated ones, have structured
> names.  For example, the equivalent of the Unix "PATH" variable is
> called "shell.path".  The equivalent of "LOCALE" is called
> "user.locale".  This means that scripts, or the user at the shell
> prompt, can use *any* alphanumeric variable name, without any risk
> of colliding with anyone else's variables, now or in the future.
> And utility writers have a guaranteed way to define variables
> special to a particular utility without clashing with anyone else's
> variables, so there's none of this "MAILFILE" nonsense.

This strikes me as an excellent idea.  Presumably the implementation
is similar to that of associative arrays, though?  

If you're going to have structured namespaces, I'd like to be able to
use them to do things I'd otherwise use associative arrays for, I
think, so I'd like ways of asking for all variables like "shell.*" and
stuff.  Oh, maybe there are quoting issues I haven't thought of.
Anyway, this looks quite clean.

What's then needed is some way of tying these names to other names, so
that PATH connects correctly to shell.path and so on.  This would be a
good opportunity to generalise things a bit, and allow arbitrary shell
functions to be called when a variable gets set or read, and stuff
like that.

This is all in ksh93, isn't it?  Another reason for doing it.


  parent reply	other threads:[~1998-06-10 10:28 UTC|newest]

Thread overview: 13+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
1998-06-09 17:09 User-defined zle widgets and built-in widget failure Bart Schaefer
1998-06-09 18:01 ` Zefram
1998-06-09 19:12   ` Bart Schaefer
1998-06-09 20:02     ` Zefram
1998-06-10  6:26       ` Variable namespaces, goals for ZLE, etc Bart Schaefer
1998-06-10 10:55         ` Zefram
1998-06-10 17:37           ` Bart Schaefer
1998-06-10 18:01             ` Zefram
1998-06-10 18:36               ` Bart Schaefer
1998-06-10 10:24       ` Bruce Stephens [this message]
1998-06-10 10:44         ` Associative arrays, structured namespaces Zefram
1998-06-10 12:07           ` Bruce Stephens
1998-06-10 12:28             ` Bruce Stephens

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=vbaf7lzha2.fsf@snake.isode.com \
    --to=b.stephens@isode.com \
    --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).