DenkzeitWiki

Suchen:

Aktuelle Änderungen Printable View Änderungen Bearbeiten

DynamicTyping > ClojureMacros > BarbaraLiskov > DestroyJavaVM > ClojureIdioms > Homoiconicity > LazyEvaluation > EmacsSolutions > RichardGabriel > CodeCompletion > AutoCompletion > TotalCommander > UsefulTools > XmlWithClojure > GuidoVanRossum > ImplicitTyping > HygienicMacrosClear Trail
Main /

Hygienic Macros

CommonLisp
Clojure

LispMacros
ClojureMacros
No problem in Lisp-2 (like CommonLisp) - problem in Lisp-1 (like Scheme).

Hygienic macros are macros whose expansion is guaranteed not to cause collisions with existing symbol definitions. [1]


An hygienic macro is one where the meanings of symbols that aren't parameters to the macro are bound at the de!nition site rather than the expansion site.



CommonLisp is a Lisp-2:
   (let ( (list 42))
    (list 'hi 'mom))
... works fine and produces '(HI MOM) because CL is a Lisp-2 and shrugs off the variable name (in the operator position, variables do not apply (ugh, pun not intended).
   (defun xxx ()
     (flet ((list (&rest args)
              (car args)))
        (list 'hi 'mom)))
 ; While compiling XXX in C:\DOCUME~1\Kenny\LOCALS~1\Temp\cda9402357291.cl: 
 Warning: Compiling a FUNCTION definition for the name LIST
 as a FLET. This name is in the COMMON-LISP package and
 defining it will be a violation for portable programs.
 The package COMMON-LISP has PACKAGE-DEFINITION-LOCK set,
 which causes the system to signal this violation.





Edit - BackLinks - Tags - Page Hist - Print - Changes - Home - Orphans - Help

Zuletzt geändert am 05.12.2011 10:55 Uhr und seit 7. April 2005 874 aufgerufen.