toplevel
toplevel( [s_langMode] [e_envobj] ) =>g_result
Description
Starts an interactive top-level loop in either SKILL or SKILL++ mode.
All expressions you enter while the loop is in progress are evaluated with the specified language mode and optional environment. If you do not specify a language mode, then classic-SKILL is the default.
The defining forms (such as, define, defun, procedure) entered at the top-level prompt are treated as “toplevel” definitions, not as local ones, even if a non-top-level environment is supplied. (The same is true for eval with an explicit environment.)
Arguments
Value Returned
Examples
Starts an interactive loop, with prompt ILS-<2> and immediately returns the value 1 to the outer top level.
> R = toplevel( 'ils )
ILS-<2> resume( 1 )
1
> R
1
Starts an interactive loop, with prompt ILS-<3>, in the environment established by the let expression. The resume function returns the current value of the local variable x to the outer top level, with promptILS-<2>.
ILS-<2> R = let( ( ( x 1 ) ( y 2 ) )
toplevel( 'ils theEnvironment() )
)
ILS-<3> x
1
ILS-<3> y
2
ILS-<3> x = 4
4
ILS-<3> resume( x )
4
ILS-<2> R
4
Related Topics
Return to top