| 1 2 | ||
|
Editor: kratt6
Time: 2007/12/28 15:11:47 GMT-8 |
||
| Note: See also #187 | ||
added:
From kratt6 Fri Dec 28 15:11:47 -0800 2007
From: kratt6
Date: Fri, 28 Dec 2007 15:11:47 -0800
Subject: See also #187
Message-ID: <20071228151147-0800@axiom-wiki.newsynthesis.org>
Category: Aldor Library Compiler => Axiom Compiler
Status: open => duplicate
This fails
(Integer,Float)
LISP output: (UNPRINTABLE UNPRINTABLE)
Tuple Type
LISP output: (UNPRINTABLE)
But this works
List Type
| (1) |
The following domain called Domain provides some of the
missing functionality. It is based on AldorDomain by Peter
Broadbery who writes:
[One] can still do some useful things with them by disguising the fact that they are domains, so in aldor have a type and your aldor programs can return this to axiom.
For example:
#include "axiom.as"
AldorDomain(T:Type): with { make: () -> %; coerce: (%) -> OutputForm; } == add { Rep ==> Type;
make(): % == per T;
coerce(t: %): OutputForm == { import from SExpression; devaluate(t pretend SExpression)::OutputForm };
import { BOOT_:_:devaluate: SExpression -> SExpression; } from Foreign Lisp;
local devaluate(s: SExpression): SExpression == { BOOT_:_:devaluate(s); } }
Compiling FriCAS source code from file
/var/zope2/var/LatexWiki/5624154441249846913-25px004.as using
AXIOM-XL compiler and options
-O -Fasy -Fao -Flsp -laxiom -Mno-AXL_W_WillObsolete -DAxiom -Y $AXIOM/algebra
Use the system command )set compiler args to change these
options.
#1 (Warning) Deprecated message prefix: use `ALDOR_' instead of `_AXL'
Compiling Lisp source code from file
./5624154441249846913-25px004.lsp
Issuing )library command for 5624154441249846913-25px004
Reading /var/zope2/var/LatexWiki/5624154441249846913-25px004.asy
AldorDomain is now explicitly exposed in frame initial
AldorDomain will be automatically loaded when needed from
/var/zope2/var/LatexWiki/5624154441249846913-25px004aInteger:=make()$AldorDomain(Integer)
| (2) |
http://lists.nongnu.org/archive/html/axiom-developer/2005-09/msg00250.html
http://lists.nongnu.org/archive/html/axiom-developer/2005-09/msg00248.html
#include "axiom.as"
Domain: SetCategory == add {
(a: %) = (b: %): Boolean == { import from SExpression; a pretend SExpression = b pretend SExpression }
coerce(t: %): OutputForm == { import from SExpression; devaluate(t pretend SExpression)::OutputForm };
import { BOOT_:_:devaluate: SExpression -> SExpression; } from Foreign Lisp;
local devaluate(s: SExpression): SExpression == { BOOT_:_:devaluate(s); } }
Compiling FriCAS source code from file
/var/zope2/var/LatexWiki/domain.as using AXIOM-XL compiler and
options
-O -Fasy -Fao -Flsp -laxiom -Mno-AXL_W_WillObsolete -DAxiom -Y $AXIOM/algebra
Use the system command )set compiler args to change these
options.
#1 (Warning) Deprecated message prefix: use `ALDOR_' instead of `_AXL'
Compiling Lisp source code from file ./domain.lsp
Issuing )library command for domain
Reading /var/zope2/var/LatexWiki/domain.asy
Domain is now explicitly exposed in frame initial
Domain will be automatically loaded when needed from
/var/zope2/var/LatexWiki/domainAnd it nearly solves the problem!
a:=(Integer,Float)
| (3) |
Except:
\begin{axiom}
select(a,1)
\end{axiom}
causes Axiom to abort.