1
Fork 0
mirror of https://git.savannah.gnu.org/git/guile.git synced 2025-06-16 16:50:21 +02:00

support source-level annotations in syncase

* module/ice-9/annotate.scm (<annotation>): Slightly more concise
  printing.
  (annotate): Don't create annotations if we have no source info.

* module/ice-9/psyntax.scm (annotation?): Remove this definition, as we
  now provide annotation support.

* module/ice-9/psyntax-pp.scm: Regenerated.

* module/ice-9/syncase.scm: Use (ice-9 annotate).

* module/language/scheme/expand.scm (eval-when): Define the eval-when
  transformer.
This commit is contained in:
Andy Wingo 2009-03-06 17:01:47 +01:00
parent 25d8cd3a0c
commit 52381a17c4
5 changed files with 29 additions and 25 deletions

View file

@ -284,11 +284,13 @@
((,modname ,sym)
x))
(define-scheme-expander eval-case
(,clauses
(-> `(eval-case . ,(map (lambda (x)
(-> `(,(acar x) . ,(map re-expand (acdr x)))))
clauses)))))
(define-scheme-expander eval-when
((,when . ,body) (guard (list? when) (and-map symbol? when))
(if (memq 'compile when)
(primitive-eval `(begin . ,body)))
(if (memq 'load when)
(-> `(begin . ,body))
(-> `(begin)))))
;;; Hum, I don't think this takes imported modifications to `define'
;;; properly into account. (Lexical bindings are OK because of alpha