On 6/18/07, felix winkelmann <[EMAIL PROTECTED]> wrote:

Should there be bugs, or if the code generated is too big, compiler macros
(which implement this feature) can be disabled via the
"-disable-compiler-macros"
option to chicken/csc.

Nice!  I've been wanting compiler macros for a while :)

Among other things, they can be used to implement
another feature I've wanted, first-class inlined procedures:

(define-compiler-macro (define-inline* params . body)
 (let ((body `(begin ,@body)))
   `(begin
      (define ,params ,body)
      (define-compiler-macro ,params
        `,,body))))

(define-inline* (foo x) ...)

This way FOO is inlined when applied directly, but is still
available as a normal procedure for first class usages
(e.g. with APPLY) and at runtime.

--
Alex


_______________________________________________
Chicken-users mailing list
[email protected]
http://lists.nongnu.org/mailman/listinfo/chicken-users

Reply via email to