summaryrefslogtreecommitdiff
path: root/module/language/scheme/compile-ghil.scm
diff options
context:
space:
mode:
authorAndy Wingo <wingo@pobox.com>2009-02-14 00:24:32 +0100
committerAndy Wingo <wingo@pobox.com>2009-02-14 00:24:32 +0100
commitabd6af11cd1ab62c2f337dcd23a9d9c37b9d169e (patch)
tree0f3d56c1c703e96fd509fee652f75db6f237a0b5 /module/language/scheme/compile-ghil.scm
parente177058bc4599c68308e6d7fcfbd3f2a0e695f84 (diff)
downloadguile-abd6af11cd1ab62c2f337dcd23a9d9c37b9d169e.tar.gz
generate the fixed-offset accessors at compile-time
* module/language/scheme/compile-ghil.scm (define-scheme-translator): Only add an else clause if the transformer didn't have one. * module/oop/goops.scm (min-fixnum, max-fixnum): Define at compile-time as well. (@slot-ref, @slot-set!): Only define transformers for these at compile-time. Avoids loading up the compiler unnecessarily. Also, allow for the `n' to be determined lexically, in which case we dispatch to the primitive. (num-standard-pre-cache, define-standard-accessor-method) (bound-check-get, standard-get, standard-set): Rework the fixed-offset getters and setters so that they can be computed at compile-time. Accessors to fields with n > num-standard-pre-cache will be dispatched to the primitive instead of within the VM.
Diffstat (limited to 'module/language/scheme/compile-ghil.scm')
-rw-r--r--module/language/scheme/compile-ghil.scm5
1 files changed, 3 insertions, 2 deletions
diff --git a/module/language/scheme/compile-ghil.scm b/module/language/scheme/compile-ghil.scm
index f27ae7a43..2821c1e70 100644
--- a/module/language/scheme/compile-ghil.scm
+++ b/module/language/scheme/compile-ghil.scm
@@ -174,8 +174,9 @@
(define syntax-error (@ (system base compile) syntax-error))
(pmatch (cdr exp)
,@clauses
- (else
- (syntax-error l (format #f "bad ~A" ',sym) exp))))))
+ ,@(if (assq 'else clauses) '()
+ '((else
+ (syntax-error l (format #f "bad ~A" ',sym) exp))))))))
(define-scheme-translator quote
;; (quote OBJ)