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

Re: PATCH: 3.1.6-pws-5: math fix



Sven Wischnowsky wrote:
> > Actually, it would be more efficient to unload the
> > arguments onto the stack at the point the function is found, like the grown
> > up languages do, but that wouldn't fit with calling functions with string
> > arguments.
> 
> That's why I thought people would complain about that kind of math function.

I don't know what you had in mind, but it occurs to me the major potential
use of that sort of math function is with keywords.  For example,
$(( limit(coredumpsize) )) could return the appropriate limit, with MB's
and KB's expanded out in this case.  That would be quite neat.

if (( limit(coredumpsize) == 0 )); then
  print "Warning:  programmes will not dump core" >&2
fi

But I'm sure someone else will have fun writing such things.

-- 
Peter Stephenson <pws@xxxxxxxxxxxxxxxxx>       Tel: +39 050 844536
WWW:  http://www.ifh.de/~pws/
Dipartimento di Fisica, Via Buonarroti 2, 56127 Pisa, Italy



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