5.1 Algebraic variables

A variable which has been declared share by the REDUCE share command is accessible from both modes in the same style and it represents the same algebraic value. A share variable is the easiest way to transfer data between the modes. The only restriction is that a symbolic program should assign only a legal algebraic form to it - otherwise a later access in algebraic mode can lead to problems. Example:

   share hugo;  
   hugo :=(x+y)**2$  
   hugo;  
   symbolic;  
   hugo := reval {’sqrt,hugo};  
   algebraic;  
   hugo;

Variables which have not been declared share have different values in symbolic and algebraic mode. Nevertheless a symbolic mode program has access to the algebraic value of a symbol:

Of course a clever LISP programmer easily sees how REDUCE organizes the assignment and storage of values to algebraic variables in property lists, and he might be attempted to use this knowledge for “easier” access; please resist: otherwise your program might not run in a future version of REDUCE.