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

Re: 'i' subscript flag



On Apr 2,  5:53pm, Peter Stephenson wrote:
} Subject: Re: 'i' subscript flag
}
} Bart Schaefer wrote:
} > In some sense, yes.  It has to do with the way that the internals of
} > parameter expansion were originally implemented (long before any kind
} > of reverse-subscripting was possible) and what it was reasonable to
} > layer on top of that.
} 
} It's still a rather confusing bug since there's no indication you can
} can only do this with forward array indexing.

Er, but the doc quite correctly says you can't do *anything* else with
the (i) flag, and what you just wrote about (w) is actually wrong:

schaefer<521> print $X[(wi)p*] 
9
schaefer<522> print $X[(wr)p*]
paz
schaefer<523> print $X[(wR)f*]
foo

The (w) flag works just fine with (r) and (R), it's only (i) and (I)
that are oddballs.
 
} Index: Doc/Zsh/params.yo
} ===================================================================
} +separator is whitespace.  Currently this flag does not work
} +with reverse subscripting (the tt(i), tt(I), tt(r) and tt(R) flags).



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