diff options
-rw-r--r-- | ChangeLog | 17 | ||||
-rw-r--r-- | src/guile/skribilo/ast.scm | 28 |
2 files changed, 29 insertions, 16 deletions
@@ -2,6 +2,23 @@ # arch-tag: automatic-ChangeLog--skribilo@sv.gnu.org--2006/skribilo--devo--1.2 # +2007-08-24 17:38:53 GMT Ludovic Court`es <ludovic.courtes@laas.fr> patch-151 + + Summary: + Slightly improved AST classes and methods. + Revision: + skribilo--devo--1.2--patch-151 + + * src/guile/skribilo/ast.scm: For all simple getters, use GOOPS's + `:getter' rather than define functions that call `slot-ref'. + + modified files: + ChangeLog src/guile/skribilo/ast.scm + + new patches: + lcourtes@laas.fr--2006-libre/skribilo--devo--1.2--patch-93 + + 2007-08-24 17:38:16 GMT Ludovic Court`es <ludovic.courtes@laas.fr> patch-150 Summary: diff --git a/src/guile/skribilo/ast.scm b/src/guile/skribilo/ast.scm index 930ec60..3ed33c9 100644 --- a/src/guile/skribilo/ast.scm +++ b/src/guile/skribilo/ast.scm @@ -219,12 +219,11 @@ ;;; ;;; ====================================================================== (define-class <command> (<ast>) - (fmt :init-keyword :fmt) - (body :init-keyword :body)) + (fmt :init-keyword :fmt :getter command-fmt) + (body :init-keyword :body :getter command-body)) (define (command? obj) (is-a? obj <command>)) -(define (command-fmt obj) (slot-ref obj 'fmt)) -(define (command-body obj) (slot-ref obj 'body)) + ;;; ====================================================================== ;;; @@ -232,10 +231,9 @@ ;;; ;;; ====================================================================== (define-class <unresolved> (<ast>) - (proc :init-keyword :proc)) + (proc :init-keyword :proc :getter unresolved-proc)) (define (unresolved? obj) (is-a? obj <unresolved>)) -(define (unresolved-proc obj) (slot-ref obj 'proc)) ;;; ====================================================================== ;;; @@ -246,8 +244,7 @@ (ast :init-keyword :ast :init-value #f :getter handle-ast)) (define (handle? obj) (is-a? obj <handle>)) -(define (handle-ast obj) (slot-ref obj 'ast)) -(define (handle-body h) (slot-ref h 'body)) +(define (handle-body h) (slot-ref h 'body)) ;; FIXME: Looks suspicious! ;;; ====================================================================== ;;; @@ -281,13 +278,13 @@ ;;; ;;; ====================================================================== (define-class <processor> (<node>) - (combinator :init-keyword :combinator :init-value (lambda (e1 e2) e1)) - (engine :init-keyword :engine :init-value 'unspecified) + (combinator :init-keyword :combinator :init-value (lambda (e1 e2) e1) + :getter processor-combinator) + (engine :init-keyword :engine :init-value 'unspecified + :getter processor-engine) (procedure :init-keyword :procedure :init-value (lambda (n e) n))) (define (processor? obj) (is-a? obj <processor>)) -(define (processor-combinator obj) (slot-ref obj 'combinator)) -(define (processor-engine obj) (slot-ref obj 'engine)) @@ -437,10 +434,9 @@ ;;; ;;; ====================================================================== (define-class <container> (<markup>) - (env :init-keyword :env :init-value '())) + (env :init-keyword :env :init-value '() :getter container-env)) (define (container? obj) (is-a? obj <container>)) -(define (container-env obj) (slot-ref obj 'env)) (define container-options markup-options) (define container-ident markup-ident) (define container-body node-body) @@ -461,8 +457,8 @@ (define (document? obj) (is-a? obj <document>)) -(define (document-ident obj) (slot-ref obj 'ident)) -(define (document-body obj) (slot-ref obj 'body)) +(define document-ident container-ident) +(define document-body container-body) (define document-options markup-options) (define document-env container-env) |