zsh-workers
 help / color / mirror / code / Atom feed
From: Andrej Borsenkow <borsenkow.msk@sni.de>
To: Andrew Main <zefram@tao.co.uk>
Cc: Zoltan Hidvegi <hzoli@frontiernet.net>,
	schaefer@brasslantern.com, zsh-workers@math.gatech.edu
Subject: Re: RC_EXPAND_PARAM bug
Date: Wed, 30 Jul 1997 19:54:01 +0400 (MSD)	[thread overview]
Message-ID: <Pine.SV4.3.95.970730135946.10447C-100000@itsrm1> (raw)
In-Reply-To: <199707300818.JAA26068@taos.demon.co.uk>

On Wed, 30 Jul 1997, Andrew Main wrote:

> Zoltan Hidvegi wrote:
> >What would be the preferred evaluation of ${^a}1${^^x}?
> 
> Who cares?  Anyone mixing plan9 and non-plan9 array expansions is asking
> for trouble.  Perhaps the documentation should warn against it.
> 

After looking at rc, I agree. Actually, the implementation in ZSH is so
different, that the name RC_EXPAND_PARAM is just misleading.

In rc, there are two legal cases:
 1. concatenation of scalar (or rather list of length 1, as rc doesn't
    have scalars at all); it corresponds to RC_EXPAND_PARAM in ZSH:

    ; a=(a)
    ; x=(x y)
    ; echo $a$x
    ax ay
 2. concatenation of two lists of _equal_ size; it is _pairwise_ 
    and not cartesian product as in ZSH:

    ; a=(a b)
    ; x=(x y)
    ; echo $a$x
    ax by
 Anything else is error:
 
    ; a=(a b)
    ; x=(x y z)
    ; echo $a$x
    bad concatenation

As far as ZSH goes, I am not shure, if any reasonable way to mix arrays
with and without RC_EXPAND_PARAM in one line (word to be shure) exists.
Any way you select will give you very strange results sometimes. Probably,
it is enough, if RC_EXPAND_PARAM works with scalars, and FAQ should
mention, that anything else should better be avoided. The important thing
is to document how selected method really works and most intuitive to me
looks like disallow such mix at all ;)

-------------------------------------------------------------------------
Andrej Borsenkow 		Fax:   +7 (095) 252 01 05
SNI ITS Moscow			Tel:   +7 (095) 252 13 88

NERV:  borsenkow.msk		E-Mail: borsenkow.msk@sni.de
-------------------------------------------------------------------------






  reply	other threads:[~1997-07-30 15:58 UTC|newest]

Thread overview: 19+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
1997-07-28 13:42 Andrew Main
1997-07-28 16:26 ` Bart Schaefer
1997-07-29  6:04   ` Zoltan Hidvegi
1997-07-29  7:09     ` Bart Schaefer
1997-07-29  7:36       ` Zoltan Hidvegi
1997-07-29  7:47     ` Geoff Wing
1997-07-29 16:27       ` Bart Schaefer
1997-07-30  3:04         ` Geoff Wing
1997-07-30  3:56           ` Bart Schaefer
1997-07-30  5:16         ` Zoltan Hidvegi
1997-07-30  5:46           ` Andrej Borsenkow
1997-07-30  6:11           ` Bart Schaefer
1997-07-30  6:51             ` Zoltan Hidvegi
1997-07-30  7:33               ` Bart Schaefer
1997-07-30  8:18           ` Andrew Main
1997-07-30 15:54             ` Andrej Borsenkow [this message]
1997-07-30 17:05               ` Bart Schaefer
1997-08-01 13:17                 ` Andrej Borsenkow
1997-08-01 18:18                   ` 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=Pine.SV4.3.95.970730135946.10447C-100000@itsrm1 \
    --to=borsenkow.msk@sni.de \
    --cc=hzoli@frontiernet.net \
    --cc=schaefer@brasslantern.com \
    --cc=zefram@tao.co.uk \
    --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).