[E-Lang] ERTP-aware MintMaker
Mark S. Miller
markm@caplet.com
Wed, 14 Feb 2001 18:12:32 -0800
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".
Terminology point: In E, we say "integer". "int" has a C-history of being
precision limited, and "Integer" has a similar Java history. I will not
call it "BigInteger" because they're simply integers. Those things that C
and Java folks call integers aren't.
Cheers,
--MarkM