zsh-workers
 help / color / mirror / code / Atom feed
From: Peter Stephenson <pws@ibmth.df.unipi.it>
To: zsh-workers@math.gatech.edu
Subject: Re: assoc array memory mucking, and semantics of patterned keys
Date: Tue, 17 Nov 1998 09:47:58 +0100	[thread overview]
Message-ID: <9811170847.AA37847@ibmth.df.unipi.it> (raw)
In-Reply-To: ""Bart Schaefer""'s message of "Tue, 17 Nov 1998 00:15:08 NFT." <981117001508.ZM4342@candle.brasslantern.com>

"Bart Schaefer" wrote:
> The final possibility is to change the meanings of (r) and (i) when an
> AA is involved, so that (r) means search the values and (i) means search
> the keys.

Without thinking too hard, because I want to get some work done today,
I think I prefer this, because the (k) and (v) flags always refer to
what's returned, while the (r) and (i) flags always refer to what's
being searched.  It's both neat and powerful.  It's maybe annoying
it's different from normal arrays, but I think understandably so.
Once you've got the point that (i) tells you to search the index, not
return it, it's entirely logical.  Otherwise the meanings of (k) and
(i) are mixed in a slightly messy way.  It just needs one sentence in
the manual saying
   
   i [what happens with ordinary arrays]
  
     With associative arrays, specifies that the keys of the array
     should be searched for a match.  The part of the array returned
     is controlled by the (k) and (v) substitution flags in this case.

and pretty much everything else is covered already.

-- 
Peter Stephenson <pws@ibmth.df.unipi.it>       Tel: +39 050 844536
WWW:  http://www.ifh.de/~pws/
Dipartimento di Fisica, Via Buonarroti 2, 56100 Pisa, Italy


  reply	other threads:[~1998-11-17  9:10 UTC|newest]

Thread overview: 7+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
1998-11-16  9:54 Associative arrays and memory Sven Wischnowsky
1998-11-16 12:43 ` Bart Schaefer
1998-11-16 14:58   ` Ksh93 (was Re: Associative arrays and memory) Bruce Stephens
1998-11-16 17:16   ` PATCH: 3.1.5: assoc array memory mucking around tedium Peter Stephenson
1998-11-17  8:15     ` assoc array memory mucking, and semantics of patterned keys Bart Schaefer
1998-11-17  8:47       ` Peter Stephenson [this message]
1998-11-17  9:42 Sven Wischnowsky

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=9811170847.AA37847@ibmth.df.unipi.it \
    --to=pws@ibmth.df.unipi.it \
    --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).