zsh-workers
 help / color / mirror / code / Atom feed
From: Bart Schaefer <schaefer@brasslantern.com>
To: Zsh workers <zsh-workers@sunsite.dk>
Subject: Re: PATCH: subscript flags on lhs of assignment
Date: Wed, 31 Mar 2004 15:58:40 +0000	[thread overview]
Message-ID: <1040331155841.ZM29270@candle.brasslantern.com> (raw)
In-Reply-To: <15526.1080739251@trentino.logica.co.uk>

On Mar 31,  3:20pm, Oliver Kiddle wrote:
}
} The SCANPM_MATCHMANY flag also seems to get set for the (k)
} flag. Is that a bug?

No, it's a hack to work around another shortcoming.  In order to use the
keys as the search patterns, I had to pretend to be interested in all
the keys, even though only one of them will eventually be used to return
a matching element.  Or something to that effect, it's been a very long
time since I wrote that code.

} There may well be better ways to implement this. Using the (k), (i) and
} (r) flags seems to result in one element arrays instead of single
} values

I believe that's because, for "normal" arrays, you can do slices with two
patterns e.g. $array[(r)left,(i)right].

It's because they return one-element arrays that assignments previously
didn't work for associatives.

} This seems to work and is fairly minimal

Nice.  You'll need to update the docs, of course; the INability to use
a pair of patterns for associative arrays should have been explicitly
mentioned before, and the stuff about assignments not working will have
to move from the "r" section to the "R" section.


  reply	other threads:[~2004-03-31 15:59 UTC|newest]

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2004-03-31 13:20 Oliver Kiddle
2004-03-31 15:58 ` Bart Schaefer [this message]
2004-04-06 12:58   ` Oliver Kiddle

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=1040331155841.ZM29270@candle.brasslantern.com \
    --to=schaefer@brasslantern.com \
    --cc=zsh-workers@sunsite.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).