As above. In the above example, the domains Integer and
Fraction Integer are computed from the string "(Fr (I -2) (I 3)".
BTW, wouldn't it be easier if you hand over the string in a lisp-like
form. That would probably make parsing much easier. You could probably
even use some lisp routine for getting the sting into the SExpression
form of FriCAS.
In fact, the same applies to an expression. You would prepare the string
in Haskell and use a lisp-like form that you can send to fricas.
In FriCAS, you simply parse the string as LISP and then pretend that
they have the correct type for the Any representation. That would be, of
course, all depend on the representation of Any. I have no idea how
types are constructed on the lisp level (maybe with evalType$Lisp as in
the Any domain code), but (apart from timings which I have not
considered) that would probably be my way to try out a connection to
another language.
Actually, I fear that just type information on the outermost level might
not be enough. It specifies the return type, but maybe in some places
one might need something like
foo((x+y)::DMP([x,y].Integer)
instead of interpreting x+y as UP(x,UP(y,Integer)), because foo wants
DMP, not UP.
Sorry, I cannot help with code. Nevertheless, I hope you find some of my
thoughts helpful.
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.