diff options
author | Ludovic Court`es | 2007-08-24 17:38:53 +0000 |
---|---|---|
committer | Ludovic Court`es | 2007-08-24 17:38:53 +0000 |
commit | d5be82fa1fd04dabe8a37358ca6a21c2ebf89564 (patch) | |
tree | 92c8703c6941dd133e8231eb06f28bd5c88bb437 /src/guile | |
parent | 18633236276746911868b98d35dab997df663ac8 (diff) | |
parent | c97f7cfe7137da1f91b4db94a00ce71a96adec62 (diff) | |
download | skribilo-d5be82fa1fd04dabe8a37358ca6a21c2ebf89564.tar.gz skribilo-d5be82fa1fd04dabe8a37358ca6a21c2ebf89564.tar.lz skribilo-d5be82fa1fd04dabe8a37358ca6a21c2ebf89564.zip |
Slightly improved AST classes and methods.
* src/guile/skribilo/ast.scm: For all simple getters, use GOOPS's
`:getter' rather than define functions that call `slot-ref'.
git-archimport-id: skribilo@sv.gnu.org--2006/skribilo--devo--1.2--patch-151
Diffstat (limited to 'src/guile')
-rw-r--r-- | src/guile/skribilo/ast.scm | 28 |
1 files changed, 12 insertions, 16 deletions
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) |