File: value-doc.m2

package info (click to toggle)
macaulay2 1.25.05%2Bds-2
  • links: PTS, VCS
  • area: main
  • in suites: experimental
  • size: 172,152 kB
  • sloc: cpp: 107,824; ansic: 16,193; javascript: 4,189; makefile: 3,899; lisp: 702; yacc: 604; sh: 476; xml: 177; perl: 114; lex: 65; python: 33
file content (83 lines) | stat: -rw-r--r-- 2,058 bytes parent folder | download | duplicates (2)
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
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
undocumented {(value, RingElement), (value, Nothing), (value, IndexedVariableTable)}

document {
    Key => value,
    Headline => "evaluate"
}

document {
    Key => (value, Expression),
    "Expressions can be evaluated using ", TO "value", ".",
    EXAMPLE lines ///
	QQ[x];
	f = (x+1)^5
	e = expression f
        value e
	value e == f
        c = factor f
	value c
    ///
}

document {
    Key => (value, Symbol),
    Headline => "retrieve the value of a symbol",
    Usage => "value s",
    Inputs => { "s" },
    Outputs => { {"the value of ", TT "s" } },
    EXAMPLE {
	"x = s",
	"s = 11111111111",
	"x",
	"value x"
    }
}

document {
    Key => (value, IndexedVariable),
    Headline => "retrieve the value of an indexed variable",
    Usage => "value s",
    Inputs => { "s" },
    Outputs => { {"the value of ", TT "s" } },
    EXAMPLE lines ///
    y = x_3
    x_3 = 4
    x_3
    y
    value y
    ///
}

document {
    Key => {(value,String),"currentString"},
    Headline => "evaluate a string",
    Usage => "value s",
    Inputs => { "s" },
    Outputs => { {"the value obtained by evaluating the code in ", TT "s" } },
    "The contents of ", TT "s", " are treated as code in the
    Macaulay2 language, parsed it in its own scope (the same way a file is)
    and evaluated.  The string may contain multiple lines.",
    {
	EXAMPLE {
	    ///value "2 + 2"///,
	    ///value "a := 33
	    a+a"///,
	    ///a///
	},
	"Since the local assignment to ", TT "a", " above occurred in a new scope,
	the value of the global variable ", TT "a", " is unaffected."
    },
    PARA{
	"During evaluation of the string, error messages will refer to the location of the error
	as ", TT "currentString", " with a line number and a column number,
	and the value of the variable ", TO "currentString", " is set to the string, to aid in debugging."
    },
    EXAMPLE lines ///
    debuggingMode = stopIfError = false;
    value "1/0"
    debuggingMode = true;
    value "1/0"
    break
    ///,
    SeeAlso => {"debugging", "stopIfError", "debuggingMode"}
}