[E-Lang] ERTP-aware MintMaker

Ben Laurie ben@algroup.co.uk
Thu, 15 Feb 2001 09:40:22 +0000


"Mark S. Miller" wrote:
> 
> At 10:54 PM Tuesday 2/13/01, hal@finney.org wrote:
> >At first I thought maybe the MintMaker was supposed to allow floating
> >point amounts, and that was why all those "any"s are used instead of
> >"int"s for the amounts.  E aborts though on the compare ":(any >= 0)"
> >with a floating point value.  It calls the Java BigInteger compareTo
> >function and that doesn't do any int-float promotion as some languages do.
> >(Actually I am testing with the "(_ >= 0)" syntax used in 0.8.9.)
> >Likewise I think the ":(0..quantity)" guard would fail as well on Decr.
> >
> >As long as the purse only allows ints then this attack won't work.
> 
> The intent is indeed to only allow integers.  Your issue above is yet
> another good reason for us to switch to Tyler's proposed ":(integer >= 0)".
> Only with the latter syntax would it be clear to someone reading the code
> that what's meant is "any *integer* greater than or equal to zero".

But that would mean repeating the type for complex conditions (e.g.
:(integer >= 0 && integer < 23)), which strikes me as yukky.

Cheers,

Ben.

--
http://www.apache-ssl.org/ben.html

"There is no limit to what a man can do or how far he can go if he
doesn't mind who gets the credit." - Robert Woodruff