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

Edit detail for #419 bug in type inference for anonymous functions revision 1 of 1

1
Editor: kratt6
Time: 2008/03/04 06:26:14 GMT-8
Note:

changed:
-
Possibly related to #105 is the following:

\begin{axiom}
f(x,y)==x+y
)set message bottom on
draw(x +-> f(x,3.0), 1.0..2.0)
\end{axiom}

Note that for some reason, axiom prefers to think of 'x+->f(x,3.0)' as a function to 'Point DFLOAT'.

It does help to declare the anonymous function, but only before it's first use:
\begin{axiom}
draw((x:DFLOAT):DFLOAT +-> f(x,3.0), 1.0..2.0)
g(x,y)==x+y
draw((x:DFLOAT):DFLOAT +-> g(x,3.0), 1.0..2.0)
\end{axiom}


Submitted by : kratt6 at: 2008-03-04T06:26:14-08:00 (16 years ago)
Name :
Axiom Version :
Category : Severity : Status :
Optional subject :  
Optional comment :

Possibly related to #105 is the following:

fricas
(1) -> f(x,y)==x+y
Type: Void
fricas
)set message bottom on
Your user access level is compiler and this set option is therefore not available. See the )set userlevel command for more information. draw(x +-> f(x,3.0), 1.0..2.0)
fricas
Compiling function f with type (DoubleFloat, Float) -> Point(
      DoubleFloat) 
   Conversion failed in the compiled user function f .
Cannot convert the value from type DoubleFloat to Point(DoubleFloat) .

Note that for some reason, axiom prefers to think of x+->f(x,3.0) as a function to Point DFLOAT.

It does help to declare the anonymous function, but only before it's first use:

fricas
draw((x:DFLOAT):DFLOAT +-> f(x,3.0), 1.0..2.0)
Conversion failed in the compiled user function f .
Cannot convert the value from type DoubleFloat to Point(DoubleFloat) .