smaller sample app for cut&pasting, debug junk
[swf2.git] / compile / macro.lisp
blobe2ce0c8f121b697d629b8f67bee5d52ba8a933ba
1 (in-package :avm2-compiler)
3 ;;; swf-defmacro etc.
6 ;; old macro -> special form hack
7 #+nil(defmacro swf-defmacro (name (&rest args) &body body)
8 `(defmethod scompile-cons ((car (eql ',name)) cdr)
9 (destructuring-bind (,@args) cdr
10 (scompile
11 (progn ,@body)))))
13 (defmacro swf-defmacro (name (&rest args) &body body)
14 (let ((form (gensym))
15 (environment (gensym)))
16 `(add-swf-macro-function
17 ',name
18 (lambda (,form ,environment)
19 (declare (ignore ,environment))
20 (destructuring-bind ,args (cdr ,form)
21 ,@body)))))