From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 27557 invoked from network); 30 Aug 1999 10:38:49 -0000 Received: from sunsite.auc.dk (130.225.51.30) by ns1.primenet.com.au with SMTP; 30 Aug 1999 10:38:49 -0000 Received: (qmail 26674 invoked by alias); 30 Aug 1999 10:38:38 -0000 Mailing-List: contact zsh-workers-help@sunsite.auc.dk; run by ezmlm Precedence: bulk X-No-Archive: yes X-Seq: 7543 Received: (qmail 26667 invoked from network); 30 Aug 1999 10:38:37 -0000 Date: Mon, 30 Aug 1999 12:38:37 +0200 (MET DST) Message-Id: <199908301038.MAA20917@beta.informatik.hu-berlin.de> From: Sven Wischnowsky To: zsh-workers@sunsite.auc.dk In-reply-to: "Andrej Borsenkow"'s message of Mon, 30 Aug 1999 14:06:02 +0400 Subject: RE: PATCH: new parameter expansion type? 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