Ralf Hemmecke wrote:
>
> On 07/11/2011 05:55 PM, Yrogirg wrote:
> > And what is wring with this package?
> >
> > )abbrev package TST Test
> >
> > Test(R: Algebra(Float)): with
> > g : Float -> Float
> > == add
> > g y == y
> > f(x : Integer, y : Integer) : (Float -> Float) == f +-> f
>
> I'd consider that a bug.
>
> This
>
> ---rhxBEGIN p.spad
> )abbrev package TST Test
>
> Test(R: Algebra(Float)): with
> g : Float -> Float
> -- f: (Integer, Integer) -> (Float -> Float)
> == add
> g y == y
> f(x: Integer, y: Integer): Float -> Float == (u: Float): Float +-> u
> ---rhxEND p.spad
>
> also doesn't compile and gives
>
> ****** comp fails at level 1 with expression: ******
> ((DEF (|f| |x| |y|) ((|Mapping| (|Float|) (|Float|)) (|Integer|)
> (|Integer|))
> (NIL NIL NIL) (+-> (|:| (|:| |u| (|Float|)) (|Float|)) |u|)))
> ****** level 1 ******
> $x:= (DEF (f x y) ((Mapping (Float) (Float)) (Integer) (Integer)) (NIL
> NIL NIL) (+-> (: (: u (Float)) (Float)) u))
> $m:= $EmptyMode
> $f:=
> ((((|$Information| #) (~= #) (= #) (|coerce| #) ...)))
>
> >> Apparent user error:
> Wrong number of arguments:
> (f x y)
>
> I first thought it's a problem with using f in f+->f, but the problem is
> somewhere else.
>
> However, uncommenting the export
>
> f: (Integer, Integer) -> (Float -> Float)
>
> compiles fine.
>
Actually, what matters is presence of earlier declaration.
)abbrev package TST Test
Test(R: Algebra(Float)): with
g : Float -> Float
-- f: (Integer, Integer) -> (Float -> Float)
== add
g y == y
f: (Integer, Integer) -> (Float -> Float)
f(x, y) == (u: Float): Float +-> u
compiles fine. 'f(x: Integer, y: Integer): Float -> Float == ..' is
supposed to give the same effect as
f: (Integer, Integer) -> (Float -> Float)
f(x, y) == ...
but for some reason does not (and this is a bug).
> But now to my surprise, with the export
>
> f: (Integer, Integer) -> Float -> Float
>
> it gives again the above error. Isn't "->" right-associative in FriCAS?
>
The above is equivalent to:
f: ((Integer, Integer) -> Float) -> Float
> Finally, I tried
>
> f(x: Integer, y: Integer)(u: Float): Float == u
>
> which compiles fine if there is no export for f
AFAICS to resultion code is bogus.
> and gives
>
> compiling local f(: x (Integer))(: y (Integer)) : Float -> Float
>
> >> Apparent user error:
> (f (: x (Integer)) (: y (Integer))) is local and exported
>
> if the export for f is specified (with or without parentheses).
>
> Although from my experiments you can certainly find a workaround, the
> compiler behaves (IMHO) strange here.
>
> Ralf
>
> --
> You received this message because you are subscribed to the Google Groups
> "FriCAS - computer algebra system" group.
> To post to this group, send email to [email protected].
> To unsubscribe from this group, send email to
> [email protected].
> For more options, visit this group at
> http://groups.google.com/group/fricas-devel?hl=en.
>
>
--
Waldek Hebisch
[email protected]
--
You received this message because you are subscribed to the Google Groups
"FriCAS - computer algebra system" group.
To post to this group, send email to [email protected].
To unsubscribe from this group, send email to
[email protected].
For more options, visit this group at
http://groups.google.com/group/fricas-devel?hl=en.