zsh-workers
 help / color / mirror / code / Atom feed
From: "Bart Schaefer" <schaefer@brasslantern.com>
To: zsh-workers@sunsite.auc.dk
Subject: set -A and stat -A vs. typeset -A and stat -H
Date: Thu, 28 Jan 1999 01:47:24 -0800	[thread overview]
Message-ID: <990128014724.ZM32736@candle.brasslantern.com> (raw)

Phil P. has expressed interest in going back to `typeset -H assoc' rather
than the ksh-inspired `typeset -A assoc' presently in use.  I objected on
the grounds that (H)ash, as e.g. used in the `stat -H' documentation, is
the wrong way to refer to associative arrays; it implies too much about the
implementation.

It occurred to me that a compromise would use the more accurate term "map"
to refer to associative arrays, and change to `typeset -M' and `stat -M'
(with special-case code for `typeset -A' in ksh emulation mode).  When
investigating this further, I find the following problems:

`set -M' already means `setopt single_line_zle' (of all things); in fact,
the only letters NOT already taken for `set' are b, c, d, q, and z, so we
might as well give up on congruence between `typeset' and `set'.  (BTW,
for those who've forgotten, `set -H' means `setopt rm_star_silent'.)

${(M)...} means "include (M)atching portion" when combined with certain
other parameter expansion operations, so it's out for what's now ${(AA)...}.

In other contexts, -M introduces things like zle keymap names, so there
is still a potential for confusion (though manipulating keymaps through
associative arrays is an interesting idea).

I send this along mainly to illustrate the sort of problems we face when
trying to avoid inconsistencies in command interfaces.  Certainly this is
to be avoided when possible (which is why I asked earlier for a summary
of the state of programmable completion), and certainly the time to do it
is while we have a development version (I have far less compunction about
breaking compatibility with 3.1.2 than I do with 3.0.5); but unless it's
really a glaring conflict it's usually best to make the right decision for
each command individually.

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


             reply	other threads:[~1999-01-28  9:47 UTC|newest]

Thread overview: 6+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
1999-01-28  9:47 Bart Schaefer [this message]
1999-01-28 13:23 ` Phil Pennock
1999-01-28 17:33   ` Bart Schaefer
1999-01-28 17:43     ` Bruce Stephens
1999-01-28 17:50     ` Phil Pennock
1999-01-30  6:22       ` 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=990128014724.ZM32736@candle.brasslantern.com \
    --to=schaefer@brasslantern.com \
    --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).