[ < ] | [ > ] |  | [ << ] | [ Up ] | [ >> ] |  |  |  |  | [Top] | [Contents] | [Index] | [ ? ]

# 35. Runtime Environment

[ < ] | [ > ] |  | [ << ] | [ Up ] | [ >> ] |  |  |  |  | [Top] | [Contents] | [Index] | [ ? ]

## 35.1 Introduction for Runtime Environment

`maxima-init.mac` is a file which is loaded automatically when Maxima starts. You can use `maxima-init.mac` to customize your Maxima environment. `maxima-init.mac`, if it exists, is typically placed in the directory named by `:lisp (default-userdir)`, although it can be in any directory searched by the function `file_search`.

Here is an example `maxima-init.mac` file:

    setup_autoload ("specfun.mac", ultraspherical, assoc_legendre_p);
    showtime:all;

In this example, `setup_autoload` tells Maxima to load the specified file (`specfun.mac`) if any of the functions (`ultraspherical`, `assoc_legendre_p`) are called but not yet defined. Thus you needn't remember to load the file before calling the functions.

The statement `showtime: all` tells Maxima to set the `showtime` variable. The `maxima-init.mac` file can contain any other assignments or other Maxima statements.

[ < ] | [ > ] |  | [ << ] | [ Up ] | [ >> ] |  |  |  |  | [Top] | [Contents] | [Index] | [ ? ]

## 35.2 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 `*debugger-hook*` is set to `nil`, by executing

    :lisp (setq *debugger-hook* nil)

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 `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 `fg` command causes Maxima to resume from the point at which it was stopped.

[ < ] | [ > ] |  | [ << ] | [ Up ] | [ >> ] |  |  |  |  | [Top] | [Contents] | [Index] | [ ? ]

## 35.3 Definitions for Runtime Environment

Declaration: feature

  Maxima understands two distinct types of features, system features and features which apply to mathematical expressions. See also `status` for information about system features. See also `features` and `featurep` for information about mathematical features.

  `feature` itself is not the name of a function or variable.

Function: featurep (a, f)

  Attempts to determine whether the object a has the feature f on the basis of the facts in the current database. If so, it returns `true`, else `false`.

  Note that `featurep` returns `false` when neither f nor the negation of f can be established.

  `featurep` evaluates its argument.

  See also `declare` and `features`.

      (%i1) declare (j, even)$
      (%i2) featurep (j, integer);
      (%o2)                           true

Function: room ()
Function: room (true)
Function: room (false)

  Prints out a description of the state of storage and stack management in Maxima. `room` calls the Lisp function of the same name.

  - `room ()` prints out a moderate description.
  - `room (true)` prints out a verbose description.
  - `room (false)` prints out a terse description.

Function: status (feature)
Function: status (feature, putative_feature)
Function: status (status)

  Returns information about the presence or absence of certain system-dependent features.

  - `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.
  - `status (feature, putative_feature)` returns `true` if putative_feature is on the list of items returned by `status (feature)` and `false` otherwise. `status` quotes the argument putative_feature. The double single quotes operator, `''`, defeats the quotation. A feature whose name contains a special character, such as a hyphen, must be given as a string argument. For example, `status (feature, "ansi-cl")`.
  - `status (status)` returns a two-element list `[feature, status]`. `feature` and `status` are the two arguments accepted by the `status` function; it is unclear if this list has additional significance.

  The variable `features` contains a list of features which apply to mathematical expressions. See `features` and `featurep` for more information.

Function: time (%o1, %o2, %o3, ...)

  Returns a list of the times, in seconds, taken to compute the output lines `%o1`, `%o2`, `%o3`, .... The time returned is Maxima's estimate of the internal computation time, not the elapsed time. `time` can only be applied to output line variables; for any other variables, `time` returns `unknown`.

  Set `showtime: true` to make Maxima print out the computation time and elapsed time with each output line.

Function: timedate ()

  Returns a string representing the current time and date. The string has the format `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:

      (%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)

[ << ] | [ >> ] |  |  |  |  |  | [Top] | [Contents] | [Index] | [ ? ]

This document was generated on March, 19 2006 using texi2html 1.76.