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

Re: saved from prince of eval



On 11/09/2015 10:41 AM, Bart Schaefer wrote:
On Nov 9, 12:50am, Ray Andrews wrote:
}
}      foo="\$${IN[list]}[${IN[topE]}, ${IN[bottomE]}]"
}      IN[PAGE]="${(e)foo}"

${IN[list]} must name a normal array (because you can't do ranges of an
associative array), so I don't think you need (e), you just need (P):

Yeah, IN[list] is the raw data coming in to the thing, just broken by newlines so that's a normal arry.

    IN[PAGE]=${${(P)IN[list]}[IN[topE],IN[bottomE]]}

Because of math context in the enclosing [subscript]ing you don't need
the ${ } on IN[topE] etc.

The only time you'd want (e) is if you had something like

    IN[list]=array
    array=( '$x' '$y' )

Ok, I'll try it.



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