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

Re: Parameters are being typed as float by default?



"Bart Schaefer" wrote:
> On Jul 7,  4:43pm, Bart Schaefer wrote:
> } }
> } }     let lines=$LINES-2
> } } 
> } } Why did $lines become float-typed?
> } 
> } It became float-typed because at math.c:644, MN_UNSET != MN_INTEGER
> } 
> } However, I don't know the right way to fix this.
> 
> After some further study, the following seems to be sufficient, because
> `a' is never referenced again on `EQ'.  Peter?

That looks fine.  In fact, (a.type != MN_UNSET) should be enough, because
it will always be marked as unset if (what == EQ), but I wouldn't lose
sleep over that.

I looked to see if this is going to have further ramifications since
there's no type coercion until the actual point of setting, but I couldn't
find a case where it makes a difference (this almost is the point of
setting, since that's all that equals does apart from returning the
value/type just set).

-- 
Peter Stephenson <pws@xxxxxxxxxxxxxxxxxxxxxxxx>
Work: pws@xxxxxxx
Web: http://www.pwstephenson.fsnet.co.uk



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