|
|
last edited 10 years ago by test1 |
1 2 3 4 | ||
Editor: gdr
Time: 2008/05/19 20:16:44 GMT-7 |
||
Note: |
added:
From gdr Mon May 19 20:16:44 -0700 2008
From: gdr
Date: Mon, 19 May 2008 20:16:44 -0700
Subject:
Message-ID: <20080519201644-0700@axiom-wiki.newsynthesis.org>
This is a problem with AXIOMs not making their minds about whether
a map should be treated as a value in its own, or whether it is an expression
that needs further evaluation to yield a value.
The proper fix is to have all user defined maps treated as
values in their owns -- e.g. their representation in the
interpreter environment should be wrapped. However, that requires a
more extensive patch to implement. But, that is the right thing to do.
The coersion to InputForm? produces a lispy representation for most types. E.g.
)set output tex off
)set output algebra on
p:POLY INT:=x^2+1
2 (1) x + 1
Type: Polynomial(Integer)
pSex:=p::InputForm
(2) (+ (^ x 2) 1)
Type: InputForm
p1:=interpret(pSex)
2 (3) x + 1
Type: Polynomial(Integer)
But this fails for functions
f:INT->INT
Type: Void
f(x) == x^2+1
Type: Void
-- force compile f(2)
Compiling function f with type Integer -> Integer
(6) 5
Type: PositiveInteger
fSex:=f::InputForm
(7) (coerceOrCroak (CONS '(Mapping (Integer) (Integer)) (wrap (MAP (#1 + (^ #1 2) 1)))) '(InputForm) 'noMapName)
Type: InputForm
So far so good, but
f1:=interpret(fSex)
Cannot convert from type (Integer -> Integer) to InputForm for value theMap(MAP)