Documentation

This is machine translation

Translated by Microsoft
Mouse over text to see original. Click the button below to return to the English verison of the page.

expose

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

MuPAD® notebooks are not recommended. Use MATLAB® live scripts instead.

MATLAB live scripts support most MuPAD functionality, though there are some differences. For more information, see Convert MuPAD Notebooks to MATLAB Live Scripts.

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;

  TeX := "";
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?