~ chicken-core (chicken-5) 606461bd250245cac4a8a8738a9cc8a98ea28057
commit 606461bd250245cac4a8a8738a9cc8a98ea28057 Author: felix <felix@call-with-current-continuation.org> AuthorDate: Wed Nov 18 10:17:24 2009 +0100 Commit: felix <felix@call-with-current-continuation.org> CommitDate: Wed Nov 18 10:17:24 2009 +0100 documented compiler syntax diff --git a/manual/Non-standard macros and special forms b/manual/Non-standard macros and special forms index 430e981c..44708faa 100644 --- a/manual/Non-standard macros and special forms +++ b/manual/Non-standard macros and special forms @@ -303,6 +303,23 @@ be helpful when you want to define support procedures for use in macro-transform for example. +==== define-compiler-syntax + + [syntax] (define-compiler-syntax NAME TRANSFORMER) + [syntax] (define-compiler-syntax (NAME VAR ...) BODY ...) + +Defines what is usually called a ''compiler macro'': {{NAME}} should be the +name of a globally or locally bound procedure. Any direct call to this procedure +will be transformed before compilation, which allows arbitrary rewritings +of function calls. +{{TRANSFORMER}} can be a {{syntax-rules}} expression or an explicit-renaming transforme +procedure. Returning the original form in an explicit-renaming macro or simply +"falling trough" all patterns in a {{syntax-rules}} form will keep the original +expression and compile it normally. + +In the interpreter this form does nothing and returns an unspecified value. + + === Conditional forms ==== selectTrap