Date: Fri, 31 Oct 2003 12:58:23 +0200 From: Peter Pentchev <roam@ringlet.net> To: Luigi Rizzo <rizzo@icir.org> Cc: hackers@freebsd.org Subject: Re: RFC: proposed new builtin for /bin/sh (associative arrays) Message-ID: <20031031105823.GF569@straylight.oblivion.bg> In-Reply-To: <20031031014331.A71967@xorpc.icir.org> References: <20031031014331.A71967@xorpc.icir.org>
next in thread | previous in thread | raw e-mail | index | archive | help
[-- Attachment #1 --]
On Fri, Oct 31, 2003 at 01:43:31AM -0800, Luigi Rizzo wrote:
[snip description of a new 'indexes' builtin]
> Any comments ? Is this interesting enough to be committed
> (with a proper manpage description) ?
> I could provide a flag to "indexes" to return the values instead
> of the names, but i believe this form is more useful.
Just a minor suggestion: could this be done as another form of variable
expansion instead of as another keyword? Rationale: bash already does
this - from the 'EXPANSION' section of its manpage:
${!prefix*}
Expands to the names of variables whose names begin with prefix,
separated by the first character of the IFS special variable.
Thus, 'indexes foo_' would be equivalent to '${!foo_*}'.
What you've done is great - several times I've found myself wishing that
our sh had this, especially after finding that bash does it - but
wouldn't it be better not to introduce a gratuitious syntax
incompatibility if we can help it? :)
G'luck,
Peter
--
Peter Pentchev roam@ringlet.net roam@sbnd.net roam@FreeBSD.org
PGP key: http://people.FreeBSD.org/~roam/roam.key.asc
Key fingerprint FDBA FD79 C26F 3C51 C95E DF9E ED18 B68D 1619 4553
If this sentence were in Chinese, it would say something else.
[-- Attachment #2 --]
-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.2.3 (FreeBSD)
iD8DBQE/okBP7Ri2jRYZRVMRAlSlAKCFaaHpWgp4GDuTDONOqk6UHAq2ZgCfZz7U
bRXJBQ33zAX86tk1bw60fBM=
=eWCx
-----END PGP SIGNATURE-----
Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?20031031105823.GF569>
