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

Re: RFC PATCH: Sketch at :@ subscripting



On Fri, Dec 18, 2020, at 8:18 AM, Mikael Magnusson wrote:
> As the subject says, this is in a very early idea stage, but it does 
> work for basic cases at least.
> 
> The idea is that you can do this:
> % typeset -a somearray=( 'data here' 'some words' etc etc 1 2 3 4 ) idx=(1 3 5)
> % echo ${somearray:@idx}
> data here etc 1
> 
> The way it currently works also lets you do this:
> % typeset -a somearray=( 'data here' 'some words' etc etc 1 2 3 4 ) 
> idx=( '(r)<->' '(I)etc' )
> % echo ${somearray:@idx}
> 1 4
> 
> Not decided on if that's desirable :).

Any further feedback on this?

vq




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