Zsh Mailing List Archive
Messages sorted by:
Reverse Date,
Date,
Thread,
Author
Re: How to create unnamed temporary arrays?
- X-seq: zsh-users 3638
- From: Andrej Borsenkow <Andrej.Borsenkow@xxxxxxxxxxxxxx>
- To: Hannu Koivisto <azure@xxxxxx>
- Subject: Re: How to create unnamed temporary arrays?
- Date: Tue, 20 Feb 2001 21:38:58 +0300 (MSK)
- Cc: zsh-users@xxxxxxxxxx
- In-reply-to: <87snl9teqa.fsf@xxxxxxxxxxxxxxxx>
- Mailing-list: contact zsh-users-help@xxxxxxxxxx; run by ezmlm
On 20 Feb 2001, Hannu Koivisto wrote:
> Sven Wischnowsky <wischnow@xxxxxxxxxxxxxxxxxxxxxxx> writes:
>
> | If I got that right and you really only want those filenames one per
>
> Not quite; that package listing job was just a simple example using
> which I was able to demonstrate the kind of situations in which I
> might want to create unnamed temporary arrays. I.e. I'd really like
> to know if it is possible to rewrite this...
>
> kala=(/usr/local/etc/packages/*(.:t:r))
> echo ${(F)kala}
>
> ...so that kala variable is not defined but the ${(F)...}
> construction is still used.
>
The idea I had today (in relation to other things) was to introduce new
syntax, something like
${foo-(bar baz)}
(note braces). Combined with empty parameter name (it is legal) it makes
it possible to do
${(F)${:-(foo bar baz)}}
thus giving you exactly what you want.
I do not claim that I fully understand the parameter substitution code,
but it looks doable. There remain some decisions to make though.
-andrej
Messages sorted by:
Reverse Date,
Date,
Thread,
Author