[ < ] | [ > ] |  | [ << ] | [ Up ] | [ >> ] |  |  |  |  | [Top] | [Contents] | [Index] | [ ? ]

# 50. eval_string

[ < ] | [ > ] |  | [ << ] | [ Up ] | [ >> ] |  |  |  |  | [Top] | [Contents] | [Index] | [ ? ]

## 50.1 Functions and Variables for eval_string

Function: eval_string (str)

  Parse the Maxima string str as a Maxima expression and evaluate it. str is a Maxima string. It may or may not have a terminator (dollar sign `$` or semicolon `;`). Only the first expression is parsed and evaluated, if there is more than one.

  Complain if str is not a Maxima string.

  Examples:

      (%i1) eval_string ("foo: 42; bar: foo^2 + baz");
      (%o1)                       42
      (%i2) eval_string ("(foo: 42, bar: foo^2 + baz)");
      (%o2)                   baz + 1764

  See also `parse_string`.

Function: parse_string (str)

  Parse the Maxima string str as a Maxima expression (do not evaluate it). str is a Maxima string. It may or may not have a terminator (dollar sign `$` or semicolon `;`). Only the first expression is parsed, if there is more than one.

  Complain if str is not a Maxima string.

  Examples:

      (%i1) parse_string ("foo: 42; bar: foo^2 + baz");
      (%o1)                    foo : 42
      (%i2) parse_string ("(foo: 42, bar: foo^2 + baz)");
                                         2
      (%o2)          (foo : 42, bar : foo  + baz)

  See also `eval_string`.

[ << ] | [ >> ] |  |  |  |  |  | [Top] | [Contents] | [Index] | [ ? ]

This document was generated by Robert Dodier on August, 25 2007 using texi2html 1.76.