1
Fork 0
mirror of https://git.savannah.gnu.org/git/guile.git synced 2025-06-12 06:41:13 +02:00

* syncase.scm (guile-macro): Strip syntactic information from

expression before trying to treat it as a Guile macro call.
(Thanks to Kevin Ryde.)
This commit is contained in:
Mikael Djurfeldt 2003-01-27 08:46:18 +00:00
parent c2950e36ef
commit e963ac2c54
3 changed files with 23 additions and 15 deletions

1
THANKS
View file

@ -38,6 +38,7 @@ For fixes or providing information which led to a fix:
Ron Peterson Ron Peterson
David Pirotte David Pirotte
Ken Raeburn Ken Raeburn
Kevin Ryde
Bill Schottstaedt Bill Schottstaedt
Greg Troxel Greg Troxel
Momchil Velikov Momchil Velikov

View file

@ -1,3 +1,9 @@
2003-01-27 Mikael Djurfeldt <djurfeldt@nada.kth.se>
* syncase.scm (guile-macro): Strip syntactic information from
expression before trying to treat it as a Guile macro call.
(Thanks to Kevin Ryde.)
2003-01-24 Mikael Djurfeldt <djurfeldt@nada.kth.se> 2003-01-24 Mikael Djurfeldt <djurfeldt@nada.kth.se>
* threads.scm (parallel, letpar): Rewritten. * threads.scm (parallel, letpar): Rewritten.

View file

@ -157,21 +157,22 @@
(define guile-macro (define guile-macro
(cons 'external-macro (cons 'external-macro
(lambda (e r w s) (lambda (e r w s)
(if (symbol? e) (let ((e (syntax-object->datum e)))
;; pass the expression through (if (symbol? e)
e ;; pass the expression through
(let* ((eval-closure (fluid-ref expansion-eval-closure)) e
(m (variable-ref (eval-closure (car e) #f)))) (let* ((eval-closure (fluid-ref expansion-eval-closure))
(if (eq? (macro-type m) 'syntax) (m (variable-ref (eval-closure (car e) #f))))
;; pass the expression through (if (eq? (macro-type m) 'syntax)
e ;; pass the expression through
;; perform Guile macro transform e
(let ((e ((macro-transformer m) ;; perform Guile macro transform
e (let ((e ((macro-transformer m)
(append r (list eval-closure))))) e
(if (null? r) (append r (list eval-closure)))))
(sc-expand e) (if (null? r)
(sc-chi e r w))))))))) (sc-expand e)
(sc-chi e r w))))))))))
(define generated-symbols (make-weak-key-hash-table 1019)) (define generated-symbols (make-weak-key-hash-table 1019))