Product Documentation
Cadence SKILL Language Reference
Product Version IC23.1, November 2023

sstatus

sstatus( 
s_name 
g_switchValue 
) 
=> g_switchValue

Description

Sets the internal system variable named to a given value. This is a syntax form.

The internal variables are typically Boolean switches that accept only the Boolean values of t and nil. Efficiency and security are the reasons why these system variables are stored as internal variables that can only be set by sstatus, rather than as SKILL variables you can set directly.

Internal System Variables

Name Meaning Default

autoReload

If t, the debugger will try to auto-reload a file that is not loaded under debugMode when the user tries to single-step into the code defined by that file.

This might not work correctly for SKILL++ functions defined using assignment.

nil

classAuxAutoLoad

If t, the SKILL++ code that accesses classes located in SKILL context files auto-loads the context (if this context has not already been loaded).

nil

debugMacro

If t, the IL compiler sets lineNumber on the expanded macro code to lineNumber of the original form.

nil

debugMode

If t, provides more information for debugging SKILL programs. Allows you to redefine write-protected SKILL functions.

nil

echoInput

If t, each user input in CIW is repeated in the output port.

nil

errsetTrace

If t, prints errors and stacktrace information that is normally suppressed by errset.

nil

floatPrecisionChars

Rounds off the value to the specified number of digits. For example, if set to 10, the value has 10-digit accuracy.

If fullPrecision is set to t, it is also considered and the value then has 17-digit accuracy.

If fullPrecision is set to nil, the value still has 10-digit accuracy.

7

forceWarnings

If t, all warnings are flushed immediately, even if getWarn() is used or the warning is stored in a temporary buffer to be printed later in the CIW.

nil

fullPrecision

If t, unformatted print functions (print, println, printlev) print floating point numbers in full precision (usually 16 digits); otherwise, the default is about 7 digits of precision.

nil

integermode

If t, the parser translates all arithmetic operators into calls to functions that operate only on fixnums. This results in small execution time savings, particularly for compute-intensive tasks whose inner loops are dominated by integer arithmetic calculations.

nil

keepNLInString

When set to nil, newline characters in strings are replaced with spaces. When set to t, the newline characters are retained as they are.

This option is applicable only if status(multilineString) is t and the parsed string is inside a SKILL expression.

nil

keepSrcInfo

If t, the source information (file/line information) is added to funobject during compilation.

It is an auxiliary switch used by the V-code compiler.

nil

lazyComp

If t, tells V-code compiler to generate code (compile function) when it is called for the first time. That is, not to compile function after it is entered by the user (or loaded from a file) until it is called.

If set to nil, enables the eager mode, where each function is compiled immediately after it is entered.

t

mergemode

If t, arithmetic expressions are merged by the parser, whenever possible, into a minimum number of function calls and therefore run somewhat faster because most of the arithmetic functions, such as plus, difference, times, and quotient, can accept a variable number of arguments.

t

multilineString

If t, allows SKILL strings inside double quotes to be spanned on several lines.

t

optimizeNestedLet

If t, instructs the SKILL compiler to parse the code for let constructions (defining local variables and local functions) and expand/remove them by moving their local variables to the top-level function's local variables section.

This variable works only for Scheme functions (for example, .ils/.scm files).

nil

optimizeTailCall

If t, enables the tail call recursion, which prevents runtime stack overflow when a function is called recursively.

This works only in Scheme mode (toplevel 'ils).

nil

printinfix

Printing of arithmetic expressions and function calls in infix notation is turned off (on) if the second argument is nil (t).

t

profCount

If t, the SKILL Profiler provides the number of times a SKILL function is called (as an additional column in the table view of the profiler's result).

nil

saveInlineDoc

If t, when a SKILL function has inline documentation, allows the documentation string to be stored in the function symbol property.

t

savePcreData

When set to t, all pcre compiled objects are saved to context. After the context is loaded these objects are restored.

savePcreData can cause context incompatibility with previous versions of SKILL.

nil

scopedMacros

Identifies the scope of the macros and controls how the macros are expanded when processing the Scheme function body.

If this switch is set to t, the scope is checked before expanding MACRO/ALIAS: FUN(ARGS). If the function is found in local scope (in Scheme environment), the MACRO/ALIAS is not expanded to prevent it from calling a GLOBAL function.

nil

showStepResult

If t, prints the expression evaluation results performed by the step command in CIW. If the SKILL IDE is also running, a new assistant window is displayed, which also displays the expression evaluation results.

nil

sourceTracing

If t, the debugger will try to print the corresponding source location at stop/breakpoints (as well as in stack tracing).

A file must be loaded in when debugMode is set to t to get its source line numbers. The source forms printed are truncated to fit on one line.

nil

stacktrace

Prints stack frames every time an error occurs. Toggle on or off with t or nil, or set the number of frames to display.

0

stacktraceDump

Prints the local variables when an error occurs if sstatus( stacktrace t) is set. Toggle on/off with t / nil.

nil

stackTraceFormat

Controls the stacktrace output format. It can have one of three values:

  • fullStack prints the complete set of SKILL stack frames.
  • onlyCall suppresses the printing of non-function frames in the output.
  • onlyTop suppresses the printing of non-function frames except for the topmost function frame.

fullStac

traceArgs

If not set to nil, the system will save the evaluated arguments of function calls, which can then be displayed in the stacktrace.

Setting debugMode or tracing functions (using tracef) will no longer turn on traceArgs automatically. The default behavior is to turn off this switch because it is expensive to retain the evaluated arguments.

Turning on this switch could slow down the execution speed significantly.

nil

traceTEnable

Allows the use of t as an argument to the trace, tracev, and tracep functions.

. nil

traceIndent

If t, prints the trace with many '|||||', as in the earlier trace style. To print the trace in the new '|[%level]' construction, use the default value (nil).

nil

verboseLoad

If t, prints the complete path of the loaded file in the CIW in debug mode.

nil

verboseNamespace

If t, enables the printing of warnings related to SKILL namespaces.

nil

writeProtect

When on, all functions being defined have their write protection set to t so they cannot be redefined.

When off, all functions being defined for the first time are not write-protected and thus can be redefined. When developing SKILL code, be sure this switch is set to off.

nil

Arguments

s_name

Name of internal system variable.

g_switchValue

New value for internal system variable, usually t or nil.

Value Returned

g_switchValue

The second argument to sstatus.

Examples

Turns on debug mode.

sstatus( debugMode t )          
=> t

Turns on integer mode.

sstatus( integermode t )        
=> t

Prints the local variables when an error occurs.

sstatus( stacktraceDump t )      
=> t

Prints the first six stack frames every time an error occurs.

sstatus( stacktrace 6 )         
=> 6
defun factorial (n) (if (n== 0) 1 (n*factorial(n-1]
=>factorial

(trace factorial); value of the traceIndent variable is nil, which is the default value

=>(factorial)
(factorial 10)
|[1]factorial(10)
|[2]factorial(9)
|[3]factorial(8)
|[4]factorial(7)
|[5]factorial(6)
|[6]factorial(5)
|[7]factorial(4)
|[8]factorial(3)
|[9]factorial(2)
|[10]factorial(1)
|[11]factorial(0)
|[11]factorial --> 1
|[10]factorial --> 1
|[9]factorial --> 2
|[8]factorial --> 6
|[7]factorial --> 24
|[6]factorial --> 120
|[5]factorial --> 720
|[4]factorial --> 5040
|[3]factorial --> 40320
|[2]factorial --> 362880
|[1]factorial --> 3628800
3628800
(sstatus traceIndent t)
t
(factorial 10)
|factorial(10)
||factorial(9)
|||factorial(8)
||||factorial(7)
|||||factorial(6)
||||||factorial(5)
|||||||factorial(4)
||||||||factorial(3)
|||||||||factorial(2)
||||||||||factorial(1)
|||||||||||factorial(0)
|||||||||||factorial --> 1
||||||||||factorial --> 1
|||||||||factorial --> 2
||||||||factorial --> 6
|||||||factorial --> 24
||||||factorial --> 120
|||||factorial --> 720
||||factorial --> 5040
|||factorial --> 40320
||factorial --> 362880
|factorial --> 3628800
3628800

Related Topics

Core Functions


Return to top
 ⠀
X