fix failing macro-as-parameter tests in eval.test

* module/ice-9/psyntax.scm (chi-lambda-clause): Strip the docstring
  before passing it on to the continuation.

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

* test-suite/tests/eval.test (exception:failed-match): New exception, for
  syntax-case failed matches.
  ("evaluator"): Fix macro-as-parameter tests. They pass now :)
This commit is contained in:
Andy Wingo 2009-05-20 18:11:23 +02:00
commit 8bb0b3cc9d
3 changed files with 28 additions and 23 deletions

File diff suppressed because one or more lines are too long

View file

@ -1431,7 +1431,7 @@
(new-vars (map gen-var ids)))
(k (map syntax->datum ids)
new-vars
docstring
(and docstring (syntax->datum docstring))
(chi-body (syntax (e1 e2 ...))
e
(extend-var-env labels new-vars r)
@ -1451,7 +1451,7 @@
(if (null? ls1)
ls2
(f (cdr ls1) (cons (car ls1) ls2))))
docstring
(and docstring (syntax->datum docstring))
(chi-body (syntax (e1 e2 ...))
e
(extend-var-env labels new-vars r)

View file

@ -24,6 +24,9 @@
(define exception:bad-expression
(cons 'syntax-error "Bad expression"))
(define exception:failed-match
(cons 'syntax-error "failed to match any pattern"))
;;;
;;; miscellaneous
@ -85,17 +88,19 @@
;; Macros are accepted as function parameters.
;; Functions that 'apply' macros are rewritten!!!
(expect-fail-exception "macro as argument"
exception:wrong-type-arg
(let ((f (lambda (p a b) (p a b))))
(f and #t #t)))
(pass-if-exception "macro as argument"
exception:failed-match
(primitive-eval
'(let ((f (lambda (p a b) (p a b))))
(f and #t #t))))
(expect-fail-exception "passing macro as parameter"
exception:wrong-type-arg
(let* ((f (lambda (p a b) (p a b)))
(foo (procedure-source f)))
(f and #t #t)
(equal? (procedure-source f) foo)))
(pass-if-exception "passing macro as parameter"
exception:failed-match
(primitive-eval
'(let* ((f (lambda (p a b) (p a b)))
(foo (procedure-source f)))
(f and #t #t)
(equal? (procedure-source f) foo))))
))