Quantcast

Documentation Center

  • Trial Software
  • Product Updates

expose

Display the source code of a procedure or the entries of a domain

Use only in the MuPAD Notebook Interface.

This functionality does not run in MATLAB.

Syntax

expose(f)

Description

expose(f) displays the source code of the MuPAD® procedure f or the entries of the domain f.

Usually, procedures and domains are printed in abbreviated form. expose serves to display the complete source code of a procedure and all entries of a domain, respectively. However, you cannot use expose to look at the source code of kernel functions.

If f is a domain, then expose returns a symbolic newDomain call. The arguments of the call are equations of the form index = value, where value equals the value of f::index. expose is not recursively applied to f::index; hence, the source code of domain methods is not displayed.

Although expose returns a syntactically valid MuPAD object, this return value is intended for screen output only, and further processing of it is deprecated.

Examples

Example 1

Using expose, you can inspect the source code of procedures of the MuPAD library:

sin

expose(%)
proc(x)   name sin;   local f, y;   option
noDebug; begin   if args(0) = 0 then     error("no arguments given")
  else   ... end_proc 

Example 2

When applied to a domain, expose shows the entries of that domain:

expose(DOM_NULL)
domain DOM_NULL

  new := proc new() ... end;

  new_extelement := proc new_extelement(d) ... end;

  Content := proc DOM_NULL::Content(Out, x) ... end;
end_domain

Example 3

Applying expose to other objects is legal but generally useless:

expose(3)

Parameters

f

Any object; typically, a procedure, a function environment, or a domain

Overloaded By

f

Algorithms

In addition to the usual overloading mechanism for domain elements, a domain method overloading expose must handle the following case: it will be called with zero arguments when the domain itself is to be exposed.

If f is a procedure, then expose returns an object of the domain stdlib::Exposed. The only purpose of this domain is its "print" method; manipulating its elements should never be necessary. Therefore it remains undocumented.

See Also

MuPAD Functions

Was this topic helpful?