2 * Introduction to Miscellaneous Options::
4 * Functions and Variables for Miscellaneous Options::
7 @c -----------------------------------------------------------------------------
8 @node Introduction to Miscellaneous Options, Share, Miscellaneous Options, Miscellaneous Options
9 @section Introduction to Miscellaneous Options
10 @c -----------------------------------------------------------------------------
12 In this section various options are discussed which have a global effect
13 on the operation of Maxima. Also various lists such as the list of all
14 user defined functions, are discussed.
16 @c -----------------------------------------------------------------------------
17 @node Share, Functions and Variables for Miscellaneous Options, Introduction to Miscellaneous Options, Miscellaneous Options
19 @c -----------------------------------------------------------------------------
21 The Maxima "share" directory contains programs and other files
22 of interest to Maxima users, but not part of the core implementation of Maxima.
23 These programs are typically loaded via @code{load} or @code{setup_autoload}.
25 @code{:lisp *maxima-sharedir*} displays the location of the share directory
26 within the user's file system.
28 @c -----------------------------------------------------------------------------
29 @node Functions and Variables for Miscellaneous Options, , Share, Miscellaneous Options
30 @section Functions and Variables for Miscellaneous Options
31 @c -----------------------------------------------------------------------------
33 @c After studying src/compar.lisp, it appears that askexp would
34 @c work as advertised, except that it doesn't appear to be possible
35 @c to open a break prompt with ^A or any other character.
36 @c What should we do about askexp ???
38 @c -----------------------------------------------------------------------------
40 @defvr {System variable} askexp
42 When @code{asksign} is called,
43 @code{askexp} is the expression @code{asksign} is testing.
45 At one time, it was possible for a user to inspect @code{askexp}
46 by entering a Maxima break with control-A.
48 @opencatbox{Categories:}
49 @category{Declarations and inferences}
53 @c -----------------------------------------------------------------------------
55 @defvr {Option variable} genindex
56 Default value: @code{i}
58 @code{genindex} is the alphabetic prefix used to generate the
59 next variable of summation when necessary.
61 @opencatbox{Categories:}
62 @category{Sums and products}
67 @defvr {Option variable} gensumnum
70 @code{gensumnum} is the numeric suffix used to generate the next variable
71 of summation. If it is set to @code{false} then the index will consist only
72 of @code{genindex} with no numeric suffix.
74 @opencatbox{Categories:}
75 @category{Sums and products}
79 @c -----------------------------------------------------------------------------
81 @deffn {Function} gensym @
83 @fname{gensym} (@var{x})
85 @code{gensym()} creates and returns a fresh symbol.
87 The name of the new symbol is the concatenation of a prefix, which defaults to
88 "g", and a suffix, which is an integer that defaults to the value of an internal
91 If @var{x} is supplied, and is a string, then that string is used as a prefix
92 instead of "g" for this call to gensym only.
94 If @var{x} is supplied, and is a nonnegative integer, then that integer, instead
95 of the value of the internal counter, is used as the suffix for this call to
98 If and only if no explicit suffix is supplied, the internal counter is
99 incremented after it is used.
118 @c STILL EXISTS, NEEDS CLARIFICATION !!!
120 @c -----------------------------------------------------------------------------
122 @defvr {Option variable} packagefile
123 Default value: @code{false}
125 Package designers who use @mref{save} or @mref{translate} to create packages
126 (files) for others to use may want to set @code{packagefile: true} to prevent
127 information from being added to Maxima's information-lists (e.g.
128 @mrefcomma{values} @mref{functions}) except where necessary when the file is
129 loaded in. In this way, the contents of the package will not get in the user's
130 way when he adds his own data. Note that this will not solve the problem of
131 possible name conflicts. Also note that the flag simply affects what is output
132 to the package file. Setting the flag to @code{true} is also useful for
133 creating Maxima init files.
135 @opencatbox{Categories:}
136 @category{Translation flags and variables}
143 @c -----------------------------------------------------------------------------
145 @deffn {Function} remvalue @
146 @fname{remvalue} (@var{name_1}, @dots{}, @var{name_n}) @
147 @fname{remvalue} (all)
149 Removes the values of user variables @var{name_1}, @dots{}, @var{name_n}
150 (which can be subscripted) from the system.
152 @code{remvalue (all)} removes the values of all variables in @code{values},
153 the list of all variables given names by the user
154 (as opposed to those which are automatically assigned by Maxima).
156 See also @mrefdot{values}
158 @opencatbox{Categories:}
159 @category{Evaluation}
165 @c -----------------------------------------------------------------------------
167 @deffn {Function} rncombine (@var{expr})
169 Transforms @var{expr} by combining all terms of @var{expr} that have
170 identical denominators or denominators that differ from each other by
171 numerical factors only. This is slightly different from the behavior
172 of @mrefcomma{combine} which collects terms that have identical denominators.
174 Setting @code{pfeformat: true} and using @code{combine} yields results similar
175 to those that can be obtained with @code{rncombine}, but @code{rncombine} takes
176 the additional step of cross-multiplying numerical denominator factors.
177 This results in neater forms, and the possibility of recognizing some
180 @code{load("rncomb")} loads this function.
182 @opencatbox{Categories:}
183 @category{Expressions}
187 @c -----------------------------------------------------------------------------
188 @anchor{setup_autoload}
189 @deffn {Function} setup_autoload (@var{filename}, @var{function_1}, @dots{}, @var{function_n})
191 Specifies that if any of @var{function_1}, @dots{}, @var{function_n} are
192 referenced and not yet defined, @var{filename} is loaded via @code{load}.
193 @var{filename} usually contains definitions for the functions specified,
194 although that is not enforced.
196 @code{setup_autoload} does not work for @mrefdot{memoizing functions}
198 @code{setup_autoload} quotes its arguments.
202 @c EXAMPLE GENERATED FROM FOLLOWING INPUT
203 @c legendre_p (1, %pi);
204 @c setup_autoload ("specfun.mac", legendre_p, ultraspherical);
205 @c ultraspherical (2, 1/2, %pi);
206 @c legendre_p (1, %pi);
207 @c legendre_q (1, %pi);
209 (%i1) legendre_p (1, %pi);
210 (%o1) legendre_p(1, %pi)
211 (%i2) setup_autoload ("specfun.mac", legendre_p, ultraspherical);
213 (%i3) ultraspherical (2, 1/2, %pi);
214 Warning - you are redefining the Macsyma function ultraspherical
215 Warning - you are redefining the Macsyma function legendre_p
218 (%o3) ------------ + 3 (%pi - 1) + 1
220 (%i4) legendre_p (1, %pi);
222 (%i5) legendre_q (1, %pi);
226 (%o5) ---------------- - 1
230 @opencatbox{Categories:}
231 @category{Function definition}
232 @category{File input}
236 @c RECOMMEND CUTTING THIS ITEM AND CUTTING $tcl_output IN src/plot.lisp
237 @c THIS REALLY, REALLY SEEMS LIKE CRUFT:
238 @c $tcl_output IS NEVER CALLED WITHIN MAXIMA SOURCE,
239 @c AND THIS EXTREMELY NARROW, LIMITED FUNCTIONALITY ISN'T USEFUL TO USERS
240 @c AND IT'S BROKEN: INCORRECT OUTPUT FOR CLISP, DIES ON GCL
242 @c -----------------------------------------------------------------------------
244 @deffn {Function} tcl_output @
245 @fname{tcl_output} (@var{list}, @var{i0}, @var{skip}) @
246 @fname{tcl_output} (@var{list}, @var{i0}) @
247 @fname{tcl_output} ([@var{list_1}, @dots{}, @var{list_n}], @var{i})
249 Prints elements of a list enclosed by curly braces @code{@{ @}},
250 suitable as part of a program in the Tcl/Tk language.
252 @code{tcl_output (@var{list}, @var{i0}, @var{skip})}
253 prints @var{list}, beginning with element @var{i0} and printing elements
254 @code{@var{i0} + @var{skip}}, @code{@var{i0} + 2 @var{skip}}, etc.
256 @code{tcl_output (@var{list}, @var{i0})}
257 is equivalent to @code{tcl_output (@var{list}, @var{i0}, 2)}.
259 @code{tcl_output ([@var{list_1}, ..., @var{list_n}], @var{i})}
260 prints the @var{i}'th elements of @var{list_1}, @dots{}, @var{list_n}.
264 @c tcl_output ([1, 2, 3, 4, 5, 6], 1, 3)$
265 @c tcl_output ([1, 2, 3, 4, 5, 6], 2, 3)$
266 @c tcl_output ([3/7, 5/9, 11/13, 13/17], 1)$
267 @c tcl_output ([x1, y1, x2, y2, x3, y3], 2)$
268 @c tcl_output ([[1, 2, 3], [11, 22, 33]], 1)$
270 @c EXAMPLE OUTPUT: CLISP
271 @c OUTPUT IS OK FOR FIRST TWO, BROKEN FOR OTHERS
272 @c GCL OUTPUT: SAME FOR FIRST TWO
273 @c GCL FAILS ON OTHERS (IN EACH CASE COMPLAINING ELEMENTS ARE "not of type (OR RATIONAL LISP:FLOAT)")
275 (%i1) tcl_output ([1, 2, 3, 4, 5, 6], 1, 3)$
277 @{1.000000000 4.000000000
279 (%i2) tcl_output ([1, 2, 3, 4, 5, 6], 2, 3)$
281 @{2.000000000 5.000000000
283 (%i3) tcl_output ([3/7, 5/9, 11/13, 13/17], 1)$
285 @{((RAT SIMP) 3 7) ((RAT SIMP) 11 13)
287 (%i4) tcl_output ([x1, y1, x2, y2, x3, y3], 2)$
291 (%i5) tcl_output ([[1, 2, 3], [11, 22, 33]], 1)$
293 @{SIMP 1.000000000 11.00000000