Product Documentation
Cadence SKILL Development Reference
Product Version IC23.1, June 2023

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

s_langMode

Must be a symbol. Valid values:

'ils  Indicates SKILL++.

'il   Indicates SKILL.

e_envobj

When the given s_langMode is for SKILL++, an optional environment object can be supplied, and the forms entered will be evaluated within the given (lexical) environment (except for the defining forms, like define, defun, and procedure, which will always add definitions to the top-level environment).

Value Returned

g_result

Argument passed to a call to resume.

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 prompt
ILS-<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

Debug Functions

resume

errset


Return to top
 ⠀
X