axiom-developer
[Top][All Lists]

## [Axiom-developer] [#187 trouble with tuples] functions are objects of ty

 From: Bill Page Subject: [Axiom-developer] [#187 trouble with tuples] functions are objects of type Mapping Date: Sun, 03 Jul 2005 22:48:32 -0500

Changes
http://page.axiom-developer.org/zope/mathaction/187TroubleWithTuples/diff
--
Bill Page wrote:

> I think such tuples should be Products ...

>From page 246 of the Axiom book:

"The type of a function is always a mapping of the form
Source -> Target where Source and Target are types."

and from page 1085:

"Domains Mapping, Record, and Union are primitive domains. All
other domains are written in the Axiom programming language ..."

\begin{axiom}
)show Mapping
Mapping(String,INT,Float)
\end{axiom}

>From a mathematical point of view clearly the idea that
Mapping(T, A, B) denotes the class of mappings from (A, B)
into T implies that (A,B) denotes some kind of set, i.e.
the Product(A,B).

William Sit wrote:

> I don't agree. When one wraps up something into a single object,
> it is inconvenient to look at the parts without unwrapping.

But [Cartesian Product] is implemented as a Record and the
domain Record is a primative in Axiom. So my proposal above
amounts to stating, for example, that:
\begin{axiom}
f1:Record(a:INT,b:FLOAT)->FLOAT
f1(arg)==arg.b+arg.a
f1[1,1.1]
\end{axiom}

should be viewed as equivalent to
\begin{axiom}
f2:(INT,FLOAT)->FLOAT
f2(a,b)==a+b
f2(1,1.1)
\end{axiom}

And in fact after a simple optimization, the compiler should
be able to produce equivalent internal lisp code.
--