1
Fork 0
mirror of https://git.savannah.gnu.org/git/guile.git synced 2025-06-17 09:10:22 +02:00

Replace eval-case with eval-when

* module/ice-9/boot-9.scm (eval-when): Replace eval-case with eval-when.
  Eval-when is *much* simpler, and more expressive to boot. Perhaps in
  the future we'll get 'visit and 'revisit too.

* module/ice-9/deprecated.scm (eval-case): Provide mostly-working
  deprecated version of eval-case.

* module/ice-9/boot-9.scm (defmacro, define-macro): Relax condition: we
  can make defmacros that are not at the toplevel now. But in the future
  we should replace this implementation of defmacros with one written in
  syntax-case.
  (define-module, use-modules, use-syntax): Allow at non-toplevel.
  (define-public, defmacro-public, export, re-export): Don't evaluate at
  compile-time, I can't see how that helps things. Allow `export' and
  `re-export' at non-toplevel.

* module/ice-9/getopt-long.scm:
* module/ice-9/i18n.scm:
* module/oop/goops.scm:
* module/oop/goops/compile.scm:
* module/oop/goops/dispatch.scm: Switch to use eval-when, not
  eval-case.

* module/language/scheme/compile-ghil.scm (eval-when): Replace eval-case
  transformer with eval-when transformer. Sooooo much simpler, and it
  will get better once we separate expansion from compilation.

* module/language/scheme/expand.scm (quasiquote): Hm, expand quasiquote
  properly. Not hygienic. Syncase needed.
  (lambda): Handle internal defines with docstrings propertly.
This commit is contained in:
Andy Wingo 2009-03-06 13:29:13 +01:00
parent 07e01c4cf9
commit b15dea6857
9 changed files with 104 additions and 147 deletions

View file

@ -78,9 +78,8 @@
(define *goops-module* (current-module))
;; First initialize the builtin part of GOOPS
(eval-case
((load-toplevel compile-toplevel)
(%init-goops-builtins)))
(eval-when (eval load compile)
(%init-goops-builtins))
;; Then load the rest of GOOPS
(use-modules (oop goops util)
@ -88,10 +87,9 @@
(oop goops compile))
(eval-case
((load-toplevel compile-toplevel)
(eval-when (eval load compile)
(define min-fixnum (- (expt 2 29)))
(define max-fixnum (- (expt 2 29) 1))))
(define max-fixnum (- (expt 2 29) 1)))
;;
;; goops-error
@ -1039,8 +1037,7 @@
;; the idea is to compile the index into the procedure, for fastest
;; lookup. Also, @slot-ref and @slot-set! have their own bytecodes.
(eval-case
((compile-toplevel)
(eval-when (compile)
(use-modules ((language scheme compile-ghil) :select (define-scheme-translator))
((language ghil) :select (make-ghil-inline make-ghil-call))
(system base pmatch))
@ -1061,11 +1058,10 @@
(make-ghil-inline #f #f 'slot-set
(list (retrans obj) (retrans index) (retrans val))))
(else
(make-ghil-call e l (retrans (car exp)) (map retrans (cdr exp)))))))
(make-ghil-call e l (retrans (car exp)) (map retrans (cdr exp))))))
(eval-case
((load-toplevel compile-toplevel)
(define num-standard-pre-cache 20)))
(eval-when (eval load compile)
(define num-standard-pre-cache 20))
(define-macro (define-standard-accessor-method form . body)
(let ((name (caar form))

View file

@ -19,7 +19,7 @@
;; There are circularities here; you can't import (oop goops compile)
;; before (oop goops). So when compiling, make sure that things are
;; kosher.
(eval-case ((compile-toplevel) (resolve-module '(oop goops))))
(eval-when (compile) (resolve-module '(oop goops)))
(define-module (oop goops compile)
:use-module (oop goops)

View file

@ -19,7 +19,7 @@
;; There are circularities here; you can't import (oop goops compile)
;; before (oop goops). So when compiling, make sure that things are
;; kosher.
(eval-case ((compile-toplevel) (resolve-module '(oop goops))))
(eval-when (compile) (resolve-module '(oop goops)))
(define-module (oop goops dispatch)
:use-module (oop goops)