lua-users home
lua-l archive

[Date Prev][Date Next][Thread Prev][Thread Next] [Date Index] [Thread Index]



On Apr 06, 2006, at 14:43, Gavin Wraith wrote:


<rant - please excuse>
Programming languages tend to serve the mathematician
poorly for coping with the infinite multiplicity of meanings that
"number" can have. No doubt there are practical advantages in
having the IEEE standards, and processors that have been intensively
developed to use them, but even for modelling real arithmetic the IEEE
formats are a few among an infinity of different possibilities, some
better for particular tasks than others. Did you know that
you can have real arithmetics that are exactly associative
(which the IEEE formats are not)? Google "Abbas Edalat" to find out.
Or you can use modular arithmetic modulo a large prime; or
lazy streams of rational Moebius transformations, .... .
I am afraid that a lot of programmers tend to dismiss arithmetic as a
bothersome technical detail, and are thankful to the cram the
whole business into the IEEE's bed of Procrustes (google if this
particular kind of bed is not familiar!).
</rant>

I appreciate that you're deliberately ranting, and I appreciate and agree with many of your points, but what you want can be achieved with what most computer scientists would call a datatype.

I think Lua does rather well here with userdata and tables and metatables. You want a model of {\bb Z}/13 ? Go make a nice metatable and knock yourself out.

drj