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

expandMacro

expandMacro( 
g_form 
) 
=> g_expandedForm

Description

Expands one level of macro call for a form.

Checks if the given form g_form is a macro call and returns the expanded form if it is. Otherwise it returns the original argument. The macro expansion is done only once (one level). That is, if the expanded form is another macro call, it is not further expanded (unless another expandMacro is called with the expanded form as its argument).

Arguments

g_form

Form that can be a macro call.

Value Returned

g_expandedForm

Expanded form or the original form if the given argument is not a macro call.

Examples

mprocedure( testMsg(args)
‘(printf "test %s -- %L\n" ,(cadr args)progn(,@(cddr args))) )
=> testMsg
expandMacro( '(testMsg "alpha1" y = f(x) g(y 100)) )
=> printf("test %s -- %L\n" "alpha1"
progn((y = (f x)) (g y 100)))

Related Topics

Function and Program Structure

defmacro


Return to top
 ⠀
X