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

evalstring

evalstring( 
t_string 
[ s_langMode ] 
) 
=> g_value / nil

Description

Reads and evaluates an expression stored in a string.

The resulting value is returned. Notice that evalstring does not allow the outermost set of parentheses to be omitted from the evaluated expression, as in load or in the top level.

Arguments

t_string

String containing the SKILL expression to be evaluated.

s_langMode

Symbol to determine the language mode to use.

The valid values are:

  • 'ils, which indicates that the given string is evaluated in SKILL++ mode.
  • 'il, which indicates that the given string is evaluated in SKILL code. This is the default mode.

Value Returned

g_value

The value of the argument expression after evaluation.

nil

No form is read.

Examples

The 1+2 infix notation is the same as (plus 1 2).

evalstring("1+2") 
=> 3

The following example signals that car is an unbound variable.

evalstring("cons('a '(b c))") 
=> (a b c)
car '(1 2 3)
=> 1
evalstring("car '(1 2 3)")

Related Topics

Function and Program Structure


Return to top
 ⠀
X