next | previous | forward | backward | up | top | index | toc | home

value(String) -- evaluate a string

Synopsis

Description

The contents of s are treated as code in the Macaulay 2 language, parsed it in its own scope (the same way a file is) and evaluated. The string may contain multiple lines.
i1 : value "2 + 2"

o1 = 4
i2 : value "a := 33
     a+a"

o2 = 66
i3 : a

o3 = a

o3 : Symbol
Since the local assignment to a above occurred in a new scope, the value of the global variable a is unaffected.

During evaluation of the string, error messages will refer to the location of the error as a string with a line number and a column number, and the value of the variable currentString is set to the string, to aid in debugging.