[e-lang] Prize and Milestone as mutable state idioms

Tyler Close tyler.close at gmail.com
Wed Jul 2 18:04:27 CDT 2008


On Wed, Jul 2, 2008 at 12:13 PM, David Wagner <daw at cs.berkeley.edu> wrote:
>    Also, one has to check for numbers that would overflow the precision
>    of Javascript's builtin number type.  Actually, what do you do about
>    the latter?

That's an excellent question. I hadn't done anything about it. The
JSON spec says you can output any integer, but of course Javascript
can't handle any number and it looks like all the Javascript JSON
parsers just silently turn a too big integer into an approximation.

For Waterken server <=> Waterken server communication, this isn't an
issue, since the BigInteger type is used, but it's clearly an issue
for Waterken server <=> web browser communication. I suspect it would
be safest to drop to the lowest common denominator and refuse to
encode any number that Javascript cannot accurately represent. So much
for BigIntegers. Comments?

--Tyler


More information about the e-lang mailing list