Extending arithmetic

Thomas Lindgren <>
Tue Feb 11 12:44:39 CET 2003

--- Peter-Henry Mander
<> wrote:
>  From what I've been hearing on this discussion, I
> don't think tuples 
> are the proper vehicle for multidimentional math,
> they're just too abstract.
> Why not introduce new *numeric* types instead of
> contriving tuples to 
> act like numbers? Then there will be less scope for
> surprises and 
> exceptions occuring. 

That sounds good to me. (Not that I'm sure building in
matrices is worth the effort ...) Besides the nicer
semantics, you can also have a far more efficient
representation: a flat (aligned) memory region holding
double-precision floats, rather than tuples pointing
to tuples (rows or columns?) pointing to boxed

Making operations on matrices efficient (= avoiding
copying the matrix when you update an element)
requires one of:

- an APL- or FP-like sublanguage that builds the final
matrix in one operation, or

- fast-update vectors (as were discarded from erts in
a more general incarnation for various technical
reasons), or

- losing referential transparency (huge mistake)

- ... or perhaps something else?

Those who want to clean up Erlang numerically might
also take a look at how Common Lisp does things (for
scalars, principally). That's the best proposal I'm
aware of. (Though numeric computing isn't my day job
by any means.)


Do you Yahoo!?
Yahoo! Shopping - Send Flowers for Valentine's Day

More information about the erlang-questions mailing list