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 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139 140 141 142 143 144 145 146 147 148 149 150 151 152 153 154 155 156 157 158 159 160 161 162 163 164 165 166 167 168 169 170 171 172 173 174 175 176 177 178 179 180 181 182 183 184 185 186 187 188 189 190 191 192 193 194 195 196 197 198 199 200 201 202 203 204 205 206 207 208 209 210 211
|
@menu
* Introduction for Runtime Environment::
* Interrupts::
* Definitions for Runtime Environment::
@end menu
@node Introduction for Runtime Environment, Interrupts, Runtime Environment, Runtime Environment
@section Introduction for Runtime Environment
@c THIS DISCUSSION OF maxima-init.mac REPLACES AN EARLIER WRITE-UP. !!!
@c HOWEVER IT SEEMS THAT THIS TEXT REALLY WANTS TO BE UNDER A DIFFERENT HEADING. !!!
@code{maxima-init.mac} is a file which is loaded automatically when Maxima starts.
You can use @code{maxima-init.mac} to customize your Maxima environment.
@code{maxima-init.mac}, if it exists, is typically placed in the
directory named by @code{maxima_userdir},
although it can be in any directory searched by the function @code{file_search}.
Here is an example @code{maxima-init.mac} file:
@example
setup_autoload ("specfun.mac", ultraspherical, assoc_legendre_p);
showtime:all;
@end example
In this example, @code{setup_autoload} tells Maxima to load the
specified file
(@code{specfun.mac}) if any of the functions (@code{ultraspherical},
@code{assoc_legendre_p}) are called but not yet defined.
Thus you needn't remember to load the file before calling the functions.
The statement @code{showtime: all} tells Maxima to set the @code{showtime} variable.
The @code{maxima-init.mac} file can contain any other assignments or
other Maxima statements.
@node Interrupts, Definitions for Runtime Environment, Introduction for Runtime Environment, Runtime Environment
@section Interrupts
The user can stop a time-consuming computation with the
^C (control-C) character.
The default action is to stop the computation
and print another user prompt.
In this case, it is not possible to restart a stopped computation.
If the variable @code{*debugger-hook*} is set to @code{nil}, by executing
@example
:lisp (setq *debugger-hook* nil)
@end example
@noindent
then upon receiving ^C, Maxima will enter the Lisp debugger,
and the user may use the debugger to inspect the Lisp environment.
The stopped computation can be restarted by entering
@code{continue} in the Lisp debugger.
The means of returning to Maxima from the Lisp debugger
(other than running the computation to completion)
is different for each version of Lisp.
On Unix systems, the character ^Z (control-Z) causes Maxima
to stop altogether, and control is returned to the shell prompt.
The @code{fg} command causes Maxima
to resume from the point at which it was stopped.
@c end concepts Runtime Environment
@node Definitions for Runtime Environment, , Interrupts, Runtime Environment
@section Definitions for Runtime Environment
@c NEEDS EXPANSION AND CLARIFICATION
@defvr {Declaration} feature
Maxima understands two distinct types of features,
system features and features which apply to mathematical expressions.
See also @code{status} for information about system features.
See also @code{features} and @code{featurep} for information about mathematical features.
@c PROPERTIES, DECLARATIONS FALL UNDER THIS HEADING AS WELL
@c OTHER STUFF ??
@code{feature} itself is not the name of a function or variable.
@end defvr
@c NEEDS CLARIFICATION, ESPECIALLY WRT THE EXTENT OF THE FEATURE SYSTEM
@c (I.E. WHAT KINDS OF THINGS ARE FEATURES ACCORDING TO featurep)
@deffn {Function} featurep (@var{a}, @var{f})
Attempts to determine whether the object @var{a} has the
feature @var{f} on the basis of the facts in the current database. If so,
it returns @code{true}, else @code{false}.
Note that @code{featurep} returns @code{false} when neither @var{f}
nor the negation of @var{f} can be established.
@code{featurep} evaluates its argument.
See also @code{declare} and @code{features}.
@example
(%i1) declare (j, even)$
(%i2) featurep (j, integer);
(%o2) true
@end example
@end deffn
@defvr {System variable} maxima_tempdir
@code{maxima_tempdir} names the directory in which Maxima creates some temporary files.
In particular, temporary files for plotting are created in @code{maxima_tempdir}.
The initial value of @code{maxima_tempdir} is the user's home directory,
if Maxima can locate it; otherwise Maxima makes a guess about a suitable directory.
@code{maxima_tempdir} may be assigned a string which names a directory.
@end defvr
@defvr {System variable} maxima_userdir
@code{maxima_userdir} names a directory which Maxima searches to find Maxima and Lisp files.
(Maxima searches some other directories as well;
@code{file_search_maxima} and @code{file_search_lisp} are the complete lists.)
The initial value of @code{maxima_userdir} is a subdirectory of the user's home directory,
if Maxima can locate it; otherwise Maxima makes a guess about a suitable directory.
@code{maxima_userdir} may be assigned a string which names a directory.
However, assigning to @code{maxima_userdir} does not automatically change
@code{file_search_maxima} and @code{file_search_lisp};
those variables must be changed separately.
@end defvr
@deffn {Function} room ()
@deffnx {Function} room (true)
@deffnx {Function} room (false)
Prints out a description of the state of storage and
stack management in Maxima. @code{room} calls the Lisp function of
the same name.
@itemize @bullet
@item
@code{room ()} prints out a moderate description.
@item
@code{room (true)} prints out a verbose description.
@item
@code{room (false)} prints out a terse description.
@end itemize
@end deffn
@deffn {Function} status (feature)
@deffnx {Function} status (feature, @var{putative_feature})
@deffnx {Function} status (status)
Returns information about the presence or absence of certain
system-dependent features.
@itemize @bullet
@item
@code{status (feature)} returns a list of system features.
These include Lisp version, operating system type, etc.
The list may vary from one Lisp type to another.
@item @code{status (feature, @var{putative_feature})} returns @code{true} if @var{putative_feature}
is on the list of items returned by @code{status (feature)} and @code{false} otherwise.
@code{status} quotes the argument @var{putative_feature}.
The quote-quote operator @code{'@w{}'} defeats quotation.
A feature whose name contains a special character, such as a hyphen,
must be given as a string argument. For example,
@code{status (feature, "ansi-cl")}.
@item
@code{status (status)} returns a two-element list @code{[feature, status]}.
@code{feature} and @code{status} are the two arguments accepted by the @code{status} function;
it is unclear if this list has additional significance.
@end itemize
The variable @code{features} contains a list of features which apply to
mathematical expressions. See @code{features} and @code{featurep} for more information.
@end deffn
@deffn {Function} time (%o1, %o2, %o3, ...)
Returns a list of the times, in seconds, taken to compute the output
lines @code{%o1}, @code{%o2}, @code{%o3}, .... The time returned is Maxima's estimate of
the internal computation time, not the elapsed time. @code{time} can only
be applied to output line variables; for any other variables, @code{time}
returns @code{unknown}.
Set @code{showtime: true} to make Maxima print out the computation time
and elapsed time with each output line.
@end deffn
@deffn {Function} timedate ()
Returns a string representing the current time and date.
The string has the format @code{HH:MM:SS Day, mm/dd/yyyy (GMT-n)},
where the fields are
hours, minutes, seconds, day of week, month, day of month, year, and hours different from GMT.
The return value is a Lisp string.
Example:
@c ===beg===
@c d: timedate ();
@c print ("timedate reports current time", d)$
@c ===end===
@example
(%i1) d: timedate ();
(%o1) 08:05:09 Wed, 11/02/2005 (GMT-7)
(%i2) print ("timedate reports current time", d)$
timedate reports current time 08:05:09 Wed, 11/02/2005 (GMT-7)
@end example
@end deffn
|