evaluating a string



On 8/11/07, Edward A. Romana <erom at earthlink.net> wrote:

> I have some strings that I would like to evaluate or render executable, for example if
> str_eq1:"2*my_var"
> and if say, my_var:1/2
> then some_function(str_eq1);  => 1

See parse_string and eval_string.
e.g.,

str_eq1:"2*my_var";
my_var:1/2;
eval_string (str_eq1);
 => 1

I think it makes sense to call parse_string or eval_string to
import expressions created outside of Maxima.
But if you're building up expressions within Maxima and
you want to delay evaluation, use Maxima's quote operator
instead of string operations (concatenation or whatever).

See also read and readonly.

best
Robert Dodier