## `info` -- prints short information

#### Introduction

`info(`object`)` prints short information about `object`.

`info(``)` prints a list of all available MuPAD libraries.

#### Call(s)

`info(object)`
`info()`

#### Parameters

`object` | - | any MuPAD object

#### Returns

the void object `null()` of type `DOM_NULL`.

#### Side Effects

The formatting of the output of `info` is sensitive to the environment variable `TEXTWIDTH`.

#### Related Functions

`help`, `export`, `print`, `setuserinfo`, `userinfo`

#### Details

- `info` prints a short descriptive information about `object` if available. Typically, only domains and function environments provide such information.

- If `object` is a domain, additional information is given about the methods of the domain.

- A call to `info` without arguments prints the names of all available system libraries.

- Users can add information about their own functions and domains by `overloading` `info`. If `object` is a user-defined domain or function environment providing a slot `"`info", whose value is a string, then the call `info(`object`)` prints this string. See example 2.

#### Example 1

With `info(``)`, you obtain a list of all libraries:

    >> info()

          -- Libraries:
          Ax,        Cat,      Dom,      Network,   RGB,
          Series,    Type,     adt,      combinat,  detools,
          fp,        generate, groebner, import,    intlib,
          linalg,    linopt,   listlib,  matchlib,  module,
          numeric,   numlib,   ode,      orthpoly,  output,
          plot,      polylib,  prog,     property,  solvelib,
          specfunc,  stats,    stdlib,   stringlib, student,
          transform

The next example shows information about the library `property`:

    >> info(property)

          Library 'property': properties of identifiers

          -- Interface:
          property::hasprop, property::implies, property::simpex

          -- Exported:
          assume, getprop, is, unassume

`info` prints information about preferences:

    >> info(Pref::promptString)

          A character string to be displayed as a prompt.

For some objects, `info` cannot give information:

    >> info(a + b)

          Sorry, no information available.

#### Example 2

`info` prints information about a function environment:

    >> info(sqrt)

          sqrt -- the square root

`sqrt` is a function environment and has a slot named `"`info":

    >> domtype(sqrt), sqrt::info

                      DOM_FUNC_ENV, "sqrt -- the square root"

User-defined procedures can contain short information. By default, `info` does not return any useful information:

    >> f := x -> x^2:
       info(f)

          Sorry, no information available.

To improve this, we embed the function `f` into a function environment and store an information string in its `"`info" slot:

    >> f := funcenv(f):
       f::info := "the squaring function":
       info(f)

          the squaring function

    >> delete f:

#### Background

- If the argument `object` of `info` is a domain, then the call `info(`object`)` first prints the entry `"`info", which must be a string. Then the entry `"interface"`, which must be a set of identifiers, is used to display all public methods, and the entry `"exported"`, which is a set of identifiers created by `export`, is used to display all exported methods.

#### Changes

- no changes

Do you have questions or comments?
Copyright © SciFace Software GmbH & Co. KG 2000