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

Re: PATCH: skip command from debug trap



On Wed, Aug 6, 2008 at 10:22 AM, Bart Schaefer
<schaefer@xxxxxxxxxxxxxxxx> wrote:
> On Aug 6, 10:47am, Peter Stephenson wrote:
> }
> } An option to "return" is quite tempting.  This separates out this behaviour
> } from any other.  It removes any reliance on obscure numerology. It makes it
> } quite explicit this particular mechanism is in use.  Currently return
> } doesn't take options at all, so the result is also completely compatible
> } with existing versions.
>
> Umm, the argument to return is interpreted as a math expression.  So for
> example
>
>        x=-3
>        return -x
>
> returns "3", and
>
>        x=3
>        return --x
>
> returns "2".  How are you going to make any kind of option parsing for
> return behave compatibly with that?

How about "return $((x))", or "return $((-x))"?



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