zsh-workers
 help / color / mirror / code / Atom feed
From: Peter Stephenson <pws@csr.com>
To: zsh-workers@sunsite.dk (Zsh hackers list)
Subject: Re: Changes for dev-4
Date: Thu, 16 Feb 2006 19:35:26 +0000	[thread overview]
Message-ID: <EXCHANGE03FXfyY0QUU0000e4ba@exchange03.csr.com> (raw)
In-Reply-To: <20060216190317.GC1320@dot.blorf.net>

Wayne Davison wrote:
> Actually, I didn't change = because I was thinking that it would just
> turn into a scalar anyway.  However, since the assignment might be to an
> array, it could also benefit from the new array-split-preservation code.
> 
> Attached is a patch that fixes this.  Let me know if you agree that this
> is something that should make it into 4.3.1.  (I'll check-in the first
> tweak to the README file, since it fixes a typo.)

I certainly missed the fact that it doesn't fix a compatibility problem
since you can't assign to an array in the other shells that way.
Ideally we probably want it to be whatever would happen in bash or ksh,
seeing as sh doesn't have arrays, though by the looks of things it's the
same.

In ksh I get:
$ set -A foo
$ set "one word" "two words"
$ : ${foo:="$@"}
$ echo ${foo[0]}
one word two words

and in zsh I get:
% setopt shwordsplit
% set -A foo
% set "one word" "two words"
% : ${foo:="$@"}
% print ${(t)foo}
scalar

So it looks like from the compatibility point of view we're OK either
way.

I would guess that with zsh's ability to assign arrays it would be
better to keep this consistent with the other forms, as in your patch,
however.

(We should probably hold off on the other one, that moves the flag into
the link node, until 4.3.1, though it is useful simplification to have
later.)

-- 
Peter Stephenson <pws@csr.com>                  Software Engineer
CSR PLC, Churchill House, Cambridge Business Park, Cowley Road
Cambridge, CB4 0WZ, UK                          Tel: +44 (0)1223 692070


To access the latest news from CSR copy this link into a web browser:  http://www.csr.com/email_sig.php


  reply	other threads:[~2006-02-16 19:36 UTC|newest]

Thread overview: 4+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2006-02-16 11:00 Peter Stephenson
2006-02-16 19:03 ` Wayne Davison
2006-02-16 19:35   ` Peter Stephenson [this message]
2006-02-16 20:26     ` Wayne Davison

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=EXCHANGE03FXfyY0QUU0000e4ba@exchange03.csr.com \
    --to=pws@csr.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).