From a64e787d13079f3ec809b35b09d3fac4484273cc Mon Sep 17 00:00:00 2001 From: Ludovic Courtès Date: Thu, 5 Mar 2009 00:37:59 +0100 Subject: 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. --- src/guile/skribilo/lib.scm | 17 ++++++----------- 1 file changed, 6 insertions(+), 11 deletions(-) (limited to 'src') 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 ;;; Copyright 2003, 2004 Erick Gallesio - I3S-CNRS/ESSI -;;; Copyright 2005, 2007 Ludovic Courtès ;;; ;;; ;;; 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 -- cgit v1.2.3