The less-familiar parts of Lisp for beginners — dynamic-extent

Another obscure Lisp feature that the newcomer might not have encountered is dynamic-extent.  This is used as part of a declare operation.  It is purely a compiler hint, the Lisp implementation is free to ignore dynamic-extent entirely.

What a dynamic-extent declaration does is to indicate to the compiler that one or more symbols are entirely local to the form.  Their values do not return to the caller, they are not inserted into objects or lists, they live and die completely in the form where the dynamic-extent declaration appears.  They are local storage.  When this is known, the compiler has the option of stack-allocating the objects referenced by the symbols, rather than throwing them into the garbage-collected heap.  This can reduce computational overhead in the maintenance of the heap, and so speed up execution.

Leave a Reply

Your email address will not be published. Required fields are marked *

You may use these HTML tags and attributes: <a href="" title=""> <abbr title=""> <acronym title=""> <b> <blockquote cite=""> <cite> <code> <del datetime=""> <em> <i> <q cite=""> <s> <strike> <strong>


反垃圾邮件 / Anti-spam question * Time limit is exhausted. Please reload CAPTCHA.