zsh-workers
 help / color / mirror / code / Atom feed
From: Sven Wischnowsky <wischnow@informatik.hu-berlin.de>
To: zsh-workers@sunsite.auc.dk
Subject: RE: PATCH: new parameter expansion type?
Date: Mon, 30 Aug 1999 12:38:37 +0200 (MET DST)	[thread overview]
Message-ID: <199908301038.MAA20917@beta.informatik.hu-berlin.de> (raw)
In-Reply-To: "Andrej Borsenkow"'s message of Mon, 30 Aug 1999 14:06:02 +0400


Andrej Borsenkow wrote:

> > Ok, the `.' thingy is just because I couldn't think of a better
> > character/syntax (suggestions?) and this isn't as powerful as I would
> > like it because `then' and `else' can't expand to arrays. Maybe we
> > could make `${(A)foo^?^$arr1^$arr2}' do that (and maybe we could do
> > the same for `${(A)foo:-$arr}'.
> >
> 
> Remember discussion of backreference in new regexp implementation? I think, we
> should unify it with ${.../...} & Co code. There are two possibilities:

Sure I remember that, but it's a different thing -- or how would you
do an if-then-else with `${.../...}'? Or are you suggesting
`${.../pat/repl-then/repl-else}'? Hm.

> And about arrays and scalars - well, I'm afraid, this needs revising once more.
> Else we simply create one more ad hoc case. What is needed, is clear notion,
> when we have "array context" and "scalar context". Then it is possible to
> define, when result of substitution is an array and scalar. Currently, there is
> only really vague definition of "list of words". I just wish, result of
> substitution be better typed.

It isn't that vaguely defined -- ${..:-..} produces just a string. For 
${foo^..} we would have to say what happens if the then/else produces
more than one string and foo is an array (all strings inserted instead 
of the original element, I would say).

Bye
 Sven


--
Sven Wischnowsky                         wischnow@informatik.hu-berlin.de


             reply	other threads:[~1999-08-30 10:38 UTC|newest]

Thread overview: 9+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
1999-08-30 10:38 Sven Wischnowsky [this message]
1999-08-31 13:18 ` Andrej Borsenkow
  -- strict thread matches above, loose matches on Subject: below --
1999-08-31  8:50 Sven Wischnowsky
1999-08-31 17:47 ` Bart Schaefer
1999-08-30  9:49 Sven Wischnowsky
1999-08-30 10:06 ` Andrej Borsenkow
1999-08-30 10:58 ` Tanaka Akira
1999-08-30 16:05 ` Bart Schaefer
1999-08-30 16:10   ` 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=199908301038.MAA20917@beta.informatik.hu-berlin.de \
    --to=wischnow@informatik.hu-berlin.de \
    --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).