zsh-workers
 help / color / mirror / code / Atom feed
From: "Andrej Borsenkow" <Andrej.Borsenkow@mow.siemens.ru>
To: "ZSH workers mailing list" <zsh-workers@sunsite.auc.dk>
Subject: RE: ${(A)=xxx} - second go - now real bug.
Date: Wed, 7 Jul 1999 19:50:28 +0400	[thread overview]
Message-ID: <002601bec890$6fc415c0$21c9ca95@mow.siemens.ru> (raw)
In-Reply-To: <002501bec88d$f467f470$21c9ca95@mow.siemens.ru>


>
> ${foo=bar} - the same as foo=bar (with blanks quoted, 'course)
> ${(A)foo=bar}, ${(AA)foo=bar} -
>              the same as foo=(bar)
>

Some more question.

Documentation says "word". It prohibits ${foo=bar baz} because ``bar baz'' is
not a word. Either documentation or shell should be corrected :-)

Assuming that blanks are valid, I _do_ mean ${(A)foo=$bar $baz} should be the
same as foo=($bar $baz):

bor@itsrm2:~%> foo='bar baz'
bor@itsrm2:~%> bar='baz bad'
bor@itsrm2:~%> baz=($foo $bar)
bor@itsrm2:~%> print -l $baz
bar baz
baz bad

Note, that neither $foo nor $bar are word splitted. It is not the same, as first
compute ``$foo $bar'' and split it.

If blanks are not valid - then it is much more simple. We only have to make sure
that arrays are preserved and not converted to scalars.

How is ``bar'' in "${(A)foo=bar}" interpreted? Is it quoted or not? That is
important to decide, what value ``foo'' gets (but the value of substitution
won't change :-)

/andrej


  parent reply	other threads:[~1999-07-07 15:50 UTC|newest]

Thread overview: 5+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
1999-07-07 15:32 Andrej Borsenkow
1999-07-07 15:43 ` Peter Stephenson
1999-07-07 15:50 ` Andrej Borsenkow [this message]
1999-07-07 17:42   ` Bart Schaefer
1999-07-07 17:15 ` Bart Schaefer

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='002601bec890$6fc415c0$21c9ca95@mow.siemens.ru' \
    --to=andrej.borsenkow@mow.siemens.ru \
    --cc=zsh-workers@sunsite.auc.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).