Ralf Hemmecke <[email protected]> writes:

| On 03/12/2012 05:51 PM, Serge D. Mechveliani wrote:
| > I need to build  (in Spad)  an element  x : (D : EuclideanDomain)
| > into  SExpression.
| 
| The first question I would have: Why?
| SExpression is losing all type information, as a FriCAS programmer,
| one would think twice about the need of such a function.
| 
| I D is a EuclideanDomain, then there are no exported functions to turn
| an element of D into SExpression. If you don't additionally require
| from D that it exports a function foo: % -> SExpression, the only
| thing you can do, is via (type unsafe) tricks.

OpenAxiom allows users to *safely* unpack values of the existential type Any:

   case expr is
     x: exist(D: EuclideanDomain) . D => something with x
     otherwise => do something else

See:

  
http://sourceforge.net/apps/trac/open-axiom/browser/1.4.x/src/algebra/any.spad.pamphlet#L184

  
http://sourceforge.net/apps/trac/open-axiom/browser/1.4.x/src/algebra/any.spad.pamphlet#L188

-- Gaby

-- 
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