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

Re: PATCH: Re: `foo=foo; (( foo ))' => infinite recursion



On Mar 14,  9:05am, Sven Wischnowsky wrote:
} Subject: PATCH: Re: `foo=foo; (( foo ))' => infinite recursion
}
} 
} Bart Schaefer wrote:
} 
} > On Mar 13, 10:34am, Sven Wischnowsky wrote:
} > } Subject: Re: `foo=foo; (( foo ))' => infinite recursion
} > }
} > } What really irritated me was that getnumvalue() called matheval().
} > 
} > Maybe just a recursion counter with a reasonably large limit?
} 
} Ok.

Something is still too aggressive:

zagzig% foo='x > 0 ? (--x, y += foo) : 1'
zagzig% x=3
zagzig% echo $[foo]
zsh: math recursion limit exceeded

`foo' should have been evaluated at most three times, no?

Maybe there's no real reason to fix this ...

-- 
Bart Schaefer                                 Brass Lantern Enterprises
http://www.well.com/user/barts              http://www.brasslantern.com



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