[Openmcl-devel] Where is the source of LET* macro

Shannon Spires svs at bearlanding.com
Fri Apr 14 14:07:20 PDT 2023

The example you cite does work but I personally find it an ugly coding 
style. If it's absolutely necessary to update a variable, I find it 
clearer to do so with setf.

In any case,

(let* ((it 7)
        (it (list it it))
        (it (length it)))

effectively expands to:

(let ((it 7))
   (let ((it (list it it)))
     (let ((it (length it)))

Both let and let* are special operators that are handled internally by 
the compiler. (The compiler macros are just shortcuts for the rare 
degenerate case of a let or let* with no bindings or only one binding.)


On 4/14/23 2:17 PM, Arthur Cater wrote:
> I can only find a define-compiler-macro, I want to see how LET* handle declarations.
> It surprises me that it is apparently legal to say
>   ? (let* ((it 7) (it (list it it)) (it (length it))) it)
> 2
> ?
> and I wondered how declarations (if present) are treated - but I can’t find the source code.
> TIA for any hep

More information about the Openmcl-devel mailing list