File: eval_string.texi

package info (click to toggle)
maxima 5.10.0-6
  • links: PTS
  • area: main
  • in suites: etch, etch-m68k
  • size: 44,268 kB
  • ctags: 17,987
  • sloc: lisp: 152,894; fortran: 14,667; perl: 14,204; tcl: 10,103; sh: 3,376; makefile: 2,202; ansic: 471; awk: 7
file content (50 lines) | stat: -rw-r--r-- 1,562 bytes parent folder | download
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
@menu
* Definitions for eval_string::
@end menu

@node Definitions for eval_string,  , eval_string, eval_string
@section Definitions for eval_string


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

Complain if @var{str} is not a Maxima string.

Examples:
@example
(%i1) load("eval_string")$

(%i2) eval_string ("foo: 42; bar: foo^2 + baz");
(%o2)                       42
(%i3) eval_string ("(foo: 42, bar: foo^2 + baz)");
(%o3)                   baz + 1764
@end example

To use this function write first @code{load("eval_string")}. See also @code{parse_string}.
@end deffn


@deffn {Function} parse_string (@var{str})
Parse the Maxima string @var{str} as a Maxima expression (do not evaluate it).
@var{str} is a Maxima string. It may or may not have a terminator (dollar sign @code{$} or semicolon @code{;}).
Only the first expression is parsed, if there is more than one.

Complain if @var{str} is not a Maxima string.

Examples:
@example
(%i1) load("eval_string")$

(%i2) parse_string ("foo: 42; bar: foo^2 + baz");
(%o2)                    foo : 42
(%i3) parse_string ("(foo: 42, bar: foo^2 + baz)");
                                   2
(%o3)          (foo : 42, bar : foo  + baz)
@end example

To use this function write first @code{load("eval_string")}. See also @code{eval_string}.
@end deffn