File: use-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 (78 lines) | stat: -rw-r--r-- 2,493 bytes parent folder | download | duplicates (5)
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
--- status: TODO
--- author(s): 
--- notes: 

undocumented {
     (use,Thing)
     }

document { 
     Key => use,
     Headline => "install or activate object"
     }
document { 
     Key => (use,Package),
     Headline => "activate a previously dismissed package",
     Usage => "use PACKAGENAME",
     Inputs => {
	  "PACKAGENAME" => "which was previously loaded, and then dismissed."
	  },
     Consequences => {
	  "activates the package, making all of its exported symbols visible",
	  "runs the function stored under the key ", TT "symbol use", " in the package, if there is one"
	  },     
     "This function is only necessary after dismissing a package.",
     EXAMPLE lines ///
	  loadPackage "FirstPackage"
	  firstFunction
	  dismiss FirstPackage
  	  firstFunction	
	  use FirstPackage
	  firstFunction
	  ///,
     SeeAlso => {loadPackage,(dismiss,Package),"FirstPackage::FirstPackage"}
     }
document { 
     Key => {(use,Ring),(use,Monoid)},
     Headline => "install ring variables and ring operations",
     Usage => "use R",
     Inputs => {
	  "R" => Nothing => {ofClass {Ring, Monoid}}
	  },
     Consequences => {
	  {"All variables of ", TT "R", " are set to global variables.  Additionally, 
	  certain operations creating elements of ", TT "R", " are installed globally."}
	  },     
     "When a ring (or a monoid) is assigned to a global variable, this function is
     automatically called for it.",
     PARA{},
     "It is possible to have several polynomial rings defined, perhaps with a variable
     belonging to several rings.",
     EXAMPLE lines ///
	  R = QQ[a..d]
	  S = QQ[b,c,d,e]
	  b
	  ///,
     "At this point, b is thought to be a variable of S.  If one typed
     ", TT "a+b", ", an error would occur, since Macaulay2 doesn't know how to add elements
     of R and S together.  This is fixed via:",
     EXAMPLE lines ///
	  use R
	  b
	  a+b
	  ///,
     PARA{},
     "There are several functions that create rings for you.  Generally, their variables are not
     globally visible.  However, once you 'use' the ring, the variables are available.",
     "For example, the numerator of the Hilbert function is a polynomial in a ring with a variable T.",
     EXAMPLE lines ///
         T
	 hf = poincare ideal vars S
	 T
	 use ring hf
	 T
	 ///,
     Caveat => {"Any values stored in the variables that have been assigned to are lost,
	  hence this operation should not be used by code in a package."},
     SeeAlso => {GlobalAssignHook}
     }