1
Fork 0
mirror of https://git.savannah.gnu.org/git/guile.git synced 2025-05-03 05:20:16 +02:00

fix hygiene + modules + local macros

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

* module/ice-9/psyntax.scm (syntax-type): Look up the type of the car of
  a form relative to its module, if it is a syntax object. Fixes hygiene
  wrt modules and private macros.

* module/ice-9/syncase.scm (sc-macro): Add a comment.

* module/system/base/pmatch.scm: The big test case: just export pmatch,
  not ppat too.
This commit is contained in:
Andy Wingo 2009-04-06 22:48:03 -07:00
parent 196b40932e
commit c5cc65ac0c
4 changed files with 17 additions and 9472 deletions

File diff suppressed because one or more lines are too long

View file

@ -972,7 +972,9 @@
(let ((first (car e))) (let ((first (car e)))
(if (id? first) (if (id? first)
(let* ((n (id-var-name first w)) (let* ((n (id-var-name first w))
(b (lookup n r mod)) (b (lookup n r (or (and (syntax-object? first)
(syntax-object-module first))
mod)))
(type (binding-type b))) (type (binding-type b)))
(case type (case type
((lexical) ((lexical)

View file

@ -42,6 +42,8 @@
(lambda (exp env) (lambda (exp env)
(save-module-excursion (save-module-excursion
(lambda () (lambda ()
;; Because memoization happens lazily, env's module isn't
;; necessarily the current module.
(set-current-module (eval-closure-module (car (last-pair env)))) (set-current-module (eval-closure-module (car (last-pair env))))
(strip-expansion-structures (sc-expand exp))))))) (strip-expansion-structures (sc-expand exp)))))))

View file

@ -1,6 +1,6 @@
(define-module (system base pmatch) (define-module (system base pmatch)
#:use-module (ice-9 syncase) #:use-module (ice-9 syncase)
#:export (pmatch ppat)) #:export (pmatch))
;; FIXME: shouldn't have to export ppat... ;; FIXME: shouldn't have to export ppat...
;; Originally written by Oleg Kiselyov. Taken from: ;; Originally written by Oleg Kiselyov. Taken from: