diff options
author | Ludovic Courtès | 2009-03-05 00:37:59 +0100 |
---|---|---|
committer | Ludovic Courtès | 2009-03-05 00:38:22 +0100 |
commit | a64e787d13079f3ec809b35b09d3fac4484273cc (patch) | |
tree | c1ed20b4d63a9a81028ad002771f8c1bd3b38e6c /src/guile | |
parent | a1bef02845a6ec3572f600347eeeaa2fec1e6860 (diff) | |
download | skribilo-a64e787d13079f3ec809b35b09d3fac4484273cc.tar.gz skribilo-a64e787d13079f3ec809b35b09d3fac4484273cc.tar.lz skribilo-a64e787d13079f3ec809b35b09d3fac4484273cc.zip |
Use orthodox macrology for `new'.
* src/guile/skribilo/lib.scm (new): Use `@' and `@@' to by leave only
valid objects in the macro's result (i.e., no procedure or class). This
makes it more amenable to compilation.
Diffstat (limited to 'src/guile')
-rw-r--r-- | src/guile/skribilo/lib.scm | 17 |
1 files changed, 6 insertions, 11 deletions
diff --git a/src/guile/skribilo/lib.scm b/src/guile/skribilo/lib.scm index 8c4c382..b5e86f2 100644 --- a/src/guile/skribilo/lib.scm +++ b/src/guile/skribilo/lib.scm @@ -1,7 +1,7 @@ ;;; lib.scm -- Utilities. ;;; +;;; Copyright 2005, 2007, 2009 Ludovic Courtès <ludo@gnu.org> ;;; Copyright 2003, 2004 Erick Gallesio - I3S-CNRS/ESSI <eg@unice.fr> -;;; Copyright 2005, 2007 Ludovic Courtès <ludo@gnu.org> ;;; ;;; ;;; This program is free software; you can redistribute it and/or modify @@ -53,19 +53,14 @@ ;;; NEW ;;; -(define %types-module (current-module)) - (define-macro (new class . parameters) ;; Thanks to the trick below, modules don't need to import `(oop goops)' ;; and `(skribilo ast)' in order to make use of `new'. - (let* ((class-name (symbol-append '< class '>)) - (actual-class (module-ref %types-module class-name))) - `(let ((make ,make) - (,class-name ,actual-class)) - (make ,class-name - ,@(concatenate (map (lambda (x) - `(,(symbol->keyword (car x)) ,(cadr x))) - parameters)))))) + (let ((class-name (symbol-append '< class '>))) + `((@ (oop goops) make) (@@ (skribilo lib) ,class-name) + ,@(concatenate (map (lambda (x) + `(,(symbol->keyword (car x)) ,(cadr x))) + parameters))))) ;;; ;;; DEFINE-MARKUP |