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

stringToFunction

stringToFunction( 
t_string 
[ s_langMode ] 
) 
=> u_function

Description

Wraps and converts a string of SKILL code into a parameterless SKILL function.

Parses the given string argument and wraps the result with a parameterless lambda, then compiles the entire form into a function object. The returned function can later be applied with better performance than direct evaluation using evalstring.

Arguments

t_string

String representing some SKILL code.

s_langMode

Must be a symbol.

Valid values

'ils: Treats the string as SKILL++ code.

'il: Treats the string as SKILL code.

Value Returned

u_function

Parameterless function equivalent to evaluating the string (lambda( ) t_string).

Examples

f = stringToFunction("1+2") 
=> funobj:0x220038
apply(f nil) 
=> 3

Related Topics

Type Conversion Functions

stringToSymbol

stringToTime


Return to top
 ⠀
X