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

Edit detail for #208 interpret(x::InputFor)=x is broken for functions and types revision 2 of 4

1 2 3 4
Editor: kratt6
Time: 2007/12/28 15:10:20 GMT-8
Note:

added:

From kratt6 Fri Dec 28 15:10:20 -0800 2007
From: kratt6
Date: Fri, 28 Dec 2007 15:10:20 -0800
Subject: 
Message-ID: <20071228151020-0800@axiom-wiki.newsynthesis.org>

Category: Aldor Library Compiler => Axiom Library 


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

The coersion to InputForm? produces a lispy representation for most types. E.g.

axiom
)set output tex off )set output algebra on

axiom
p:POLY INT:=x^2+1 2 (1) x + 1
Type: Polynomial Integer
axiom
pSex:=p::InputForm (2) (+ (** x 2) 1)
Type: InputForm?
axiom
p1:=interpret(pSex) 2 (3) x + 1
Type: Polynomial Integer

But this fails for functions

axiom
f:INT->INT
Type: Void
axiom
f(x) == x^2+1
Type: Void
axiom
-- force compile f(2)
axiom
Compiling function f with type Integer -> Integer 
   (6)  5
Type: PositiveInteger?
axiom
fSex:=f::InputForm (7) (coerceOrCroak (CONS '(Mapping (Integer) (Integer)) (wrap (MAP (#1 + (^ #1 2) 1)))) '(InputForm) 'noMapName)
Type: InputForm?

So far so good, but

axiom
f1:=interpret(fSex) >> System error: The function MAP is undefined.

Category: Aldor Library Compiler => Axiom Library