People,
I need to build  (in Spad)  an element  x : (D : EuclideanDomain)
into  SExpression.
I do not mind to set it there, for example, via  OutputForm.
So, I try

-----------------------------------------
)abbrev package FOO Foo
Foo(D : EuclideanDomain) : with
                           f : D -> SExpression
 ==
   add
     f x ==
          xOF  := coerce(x)       :: OutputForm
          xI   := convert(xOF)    $InputForm
          xStr := unparse(xI)     :: String
          convert(xStr :: Symbol) $SExpression
-----------------------------------------

I have spent 1 hour to find this conversion which satisfies the compiler.
Instead of writing
                   x :: OutputForm :: String :: SExpression,

one needs to guess of all these clever   coerce, convert, unparse, 
and also of introducing  InputForm,  where this InputForm  seems to have
no relevance to the subject. 

1. Is there possible a simpler code?
2. If it is not, can the compiler be improved in this point?

I suspect that all such questions about improving the compiler need to be 
consdered in the frame of Aldor, and one could write things in Aldor, 
with using the FriCAS library. 
(?)
But  
a) I do not know, of whether Aldor is currently workable in this mode,
b) it seems, there are some problems with openness and license.

Thanks,

Regards,

------
Sergei
[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.

Reply via email to