login  home  contents  what's new  discussion  bug reports     help  links  subscribe  changes  refresh  edit

Edit detail for #209 The function |Domain| is undefined revision 2 of 2

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 


Submitted by : (unknown) at: 2007-11-17T22:08:52-08:00 (17 years ago)
Name :
Axiom Version :
Category : Severity : Status :
Optional subject :  
Optional comment :

This fails

fricas
(1) -> (Integer,Float)
LISP output: (UNPRINTABLE UNPRINTABLE)
Type: Tuple(Type)

fricas
Tuple Type
LISP output: (UNPRINTABLE)
Type: Tuple(Category)

But this works

fricas
List Type

\label{eq1}\hbox{\axiomType{List}\ } \left({\hbox{\axiomType{Type}\ }}\right)(1)
Type: Type

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:

aldor
#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); } }
aldor
   Compiling FriCAS source code from file 
      /var/lib/zope2.10/instance/axiom-wiki/var/LatexWiki/5624154441249846913-25px004.as
      using Aldor compiler and options 
-O -Fasy -Fao -Flsp -lfricas -Mno-ALDOR_W_WillObsolete -DFriCAS -Y $FRICAS/algebra -I $FRICAS/algebra
      Use the system command )set compiler args to change these 
      options.
"/var/lib/zope2.10/instance/axiom-wiki/var/LatexWiki/5624154441249846913-25px004.as", line 1: 
#include "axiom.as"
^
[L1 C1] #1 (Error) Could not open file `axiom.as'.
The )library system command was not called after compilation.

fricas
aInteger:=make()$AldorDomain(Integer)
There are no library operations named AldorDomain Use HyperDoc Browse or issue )what op AldorDomain to learn if there is any operation containing " AldorDomain " in its name.
Cannot find a definition or applicable library operation named AldorDomain with argument type(s) Type
Perhaps you should use "@" to indicate the required return type, or "$" to specify which version of the function you need.

Ref:

http://lists.nongnu.org/archive/html/axiom-developer/2005-09/msg00250.html

http://lists.nongnu.org/archive/html/axiom-developer/2005-09/msg00248.html

aldor
#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); } }
aldor
   Compiling FriCAS source code from file 
      /var/lib/zope2.10/instance/axiom-wiki/var/LatexWiki/domain.as 
      using Aldor compiler and options 
-O -Fasy -Fao -Flsp -lfricas -Mno-ALDOR_W_WillObsolete -DFriCAS -Y $FRICAS/algebra -I $FRICAS/algebra
      Use the system command )set compiler args to change these 
      options.
"/var/lib/zope2.10/instance/axiom-wiki/var/LatexWiki/domain.as", line 1: 
#include "axiom.as"
^
[L1 C1] #1 (Error) Could not open file `axiom.as'.
The )library system command was not called after compilation.

And it nearly solves the problem!

fricas
a:=(Integer,Float)
LISP output: (UNPRINTABLE UNPRINTABLE)
Type: Tuple(Type)

Except:

  \begin{axiom}
  select(a,1)
  \end{axiom}

causes Axiom to abort.

Category: Aldor Library Compiler => Axiom Compiler Status: open => duplicate