Skip to content
Ashok Khanna edited this page Aug 12, 2021 · 2 revisions

What is the purpose of GENSYM in #'(lambda (,(gensym)) ,expression))?

[Per PJB, paraphased] This is to accept a parameter but avoid shadowing a free variable of the expression. Sometimes we need our lambda forms to accept a parameter (e.g. in a FUNCALL), and in such situations, within our macros we do not want to use a specific symbol that may accidentally shadow that symbol. Thus, we use GENSYM to avoid shadowing free variables of expressions in such forms.

Clone this wiki locally