zsh-workers
 help / color / mirror / code / Atom feed
From: Oliver Kiddle <okiddle@yahoo.co.uk>
To: Paul Ackersviller <paulda@rogers.com>
Cc: zsh-workers@sunsite.dk
Subject: Re: set -A
Date: Tue, 11 Feb 2003 09:45:38 +0100	[thread overview]
Message-ID: <8132.1044953138@finches.logica.co.uk> (raw)
In-Reply-To: <20030207000138.GK5418@msi.ld>

On 6 Feb, you wrote:
> I think this is a bug in all versions, but if there's some reason
> the behaviour could be considered correct, it'd be nice if it at
> least worked like ksh in emulation mode.  I recently had some trouble
> getting a ksh script to work properly in zsh, as illustrated by:
> 
> unset arr
> set -A arr "${arr[@]}" first
> [ ${#arr[@]} = 2 ] && echo "arr[0]='${arr[0]}' arr[1]='${arr[1]}'"
> 
> Note the null entry on the start of the array.  I believe the above
> should work as in ksh, and consistently with positional parameters,
> like this:

I'm inclined to agree that this is wrong. It would seem more logical to
me for an unset variable to be interpreted as an empty array when
retrieved in array context. A similar thing which I find annoying is
that local defines parameters to be scalar by default instead of
leaving their type undefined causing similar empty element problems.

I've been aware of this for some while and had intended to change it if
I ever have time to finish work on the parameter code. Would changing
it break much? It would improve bash/ksh compatibility.

Oliver

This e-mail and any attachment is for authorised use by the intended recipient(s) only.  It may contain proprietary material, confidential information and/or be subject to legal privilege.  It should not be copied, disclosed to, retained or used by, any other party.  If you are not an intended recipient then please promptly delete this e-mail and any attachment and all copies and inform the sender.  Thank you.


  parent reply	other threads:[~2003-02-11  8:42 UTC|newest]

Thread overview: 4+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
     [not found] <20030207000138.GK5418@msi.ld>
2003-02-07 11:53 ` Peter Stephenson
2003-02-07 16:08   ` Bart Schaefer
2003-02-11  8:45 ` Oliver Kiddle [this message]
2003-02-11 10:38   ` Peter Stephenson

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=8132.1044953138@finches.logica.co.uk \
    --to=okiddle@yahoo.co.uk \
    --cc=paulda@rogers.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).