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

Re: [PATCH] Index of element after width of characters



On Wed, Oct 28, 2015 at 12:38 PM, Sebastian Gniazdowski
<sgniazdowski@xxxxxxxxx> wrote:
> After thinking this through I would want to use "<", ",", ">". Could I
> allocate those symbols? Very mnemonic and nice, the use would be
> ${(<:10:)a}, ${(,:10:)a}, ${(>:10:)a} for index before width, index at
> width, index after width. I checked that they work with parser.
>
> PS. The code works in D07multibyte.ztst, so the tests issue is solved.

Wouldn't it make more sense to use syntax like $a[(y)10,-1] and
$a[1,(y)10] ? That's also less likely to trouble Bart since we only
have about 9 flags in that namespace. For example the (w) flag works
this way, making the number refer to words rather than characters in
the string.

-- 
Mikael Magnusson



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