[gtk-cffi-cvs] CVS gtk-cffi/utils
CVS User rklochkov
rklochkov at common-lisp.net
Mon Feb 20 16:51:38 UTC 2012
Update of /project/gtk-cffi/cvsroot/gtk-cffi/utils
In directory tiger.common-lisp.net:/tmp/cvs-serv21507/utils
Modified Files:
package.lisp utils.lisp
Log Message:
Finished GtkWindow
Made global clean-up. Now it compiles all from scratch with asdf:compile-op
Add version-dependent functions (for ex. "since gtk 3.2")
--- /project/gtk-cffi/cvsroot/gtk-cffi/utils/package.lisp 2012/01/21 18:35:00 1.3
+++ /project/gtk-cffi/cvsroot/gtk-cffi/utils/package.lisp 2012/02/20 16:51:38 1.4
@@ -8,5 +8,4 @@
#:debug-out
#:bitmask
- #:template
- #:param))
+ #:template))
--- /project/gtk-cffi/cvsroot/gtk-cffi/utils/utils.lisp 2012/01/21 18:35:00 1.4
+++ /project/gtk-cffi/cvsroot/gtk-cffi/utils/utils.lisp 2012/02/20 16:51:38 1.5
@@ -38,11 +38,18 @@
(collect `(when ,flag
,(make-keyword flag)))))))
-(defmacro template (args &body body)
- (with-gensyms (%template %do)
- `(macrolet ((,%do ()
- (flet ((,%template (param) , at body))
- `(progn
- ,@(mapcar #',%template ',args)))))
- (,%do))))
+(defmacro template (vars args &body body)
+ (with-gensyms (%do %vars)
+ (cond
+ ((null vars)
+ `(macrolet ((,%do () , at body))
+ (,%do)))
+ ((consp vars)
+ `(template ,%vars ,args
+ (destructuring-bind ,vars ,%vars
+ , at body)))
+ (t `(macrolet ((,%do ()
+ `(progn
+ ,@(mapcar (lambda (,vars) , at body) ',args))))
+ (,%do))))))
More information about the gtk-cffi-cvs
mailing list