Hi Waldek,

https://github.com/hemmecke/fricas-svn/blob/502a3518235cb5c6f0ecc75c9ba2064a2b500d43/src/interp/s-parser.boot#L98

there is still a

          ["->", 1001, 1002], _

in line 98 of that file. I don't know whether this matters, but I want to make sure that you have not overlooked something.

Actually... looking at this NUD stuff, it seems in FriCAS "->" can be used as a prefix operator.

However, I can compile

---rhxBEGIN p.spad
)abbrev package TST Test
Z ==> Integer
Test(): with
    "->": Z -> Z
 == add
    "->"(x: Z): Z == 1000*x
---rhxEND p.spad

but I've no idea how to use the function ->.

OK, it's not important. I don't like the double quotes above anyway.

Ralf

PS: Interestingly, the following compiles with Aldor
---rhxBEGIN p.as
#include "axllib"
Z ==> Integer;
Tst: with {
    _-_>: Z -> Z;
} == add {
    _-_>(x: Z): Z == 1000*x;
}

main():() == {
        import from Tst, Z;
        z: Z := (->$Tst)3;
        print << z << newline;
}

main();
---rhxEND p.as

aldor -fx p.as && ./p

But it's use is rather cumbersome. Without the "$Tst" the program just runs and consumes a lot of memory without returning. But with $Tst, everything seems to be fine.

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.

Reply via email to