Zsh Mailing List Archive
Messages sorted by: Reverse Date, Date, Thread, Author

Re: PATCH: new parameter expansion type?



On Aug 31, 10:50am, Sven Wischnowsky wrote:
} Subject: Re: PATCH: new parameter expansion type?
}
} > This is essentially the same problem as ${(A)foo:=string} where it would
} > be nice to be able to have "string" be interpreted as an array.  I pointed
} > out the parsing problem with this back at that time.  It would be nice to
} > have a solution; Andrej suggested ${(A)foo:=(val1 val2 ...)} but it will
} > require a change to the parser to make that work.
} 
} Or we could add a flag that says that the string is to be split into
} different words and change `dquote_parse()' to allow us to say that
} the `endchar' is any white-space (or any seperator character).

I don't think that will work ... you have to split the string into words
long before you get into paramsubst() or you can't be guaranteed to get
it right.  It has to be a top-level syntax thing, not a parameter flag.

But maybe "a flag" isn't really what you meant ...

} I would have suggested using the forms with a double character (as in
} `${(A)arr:==a b c}') if that weren't too incompatible.

That means to assign the full path of the command named "a b c" to the
array.  You can't get away with overloading `=' any more than it already
is, I'm afraid.

-- 
Bart Schaefer                                 Brass Lantern Enterprises
http://www.well.com/user/barts              http://www.brasslantern.com



Messages sorted by: Reverse Date, Date, Thread, Author