errors4.scm 476 B

12345678910111213
  1. ;; test r7rs's syntax-error
  2. (define-syntax simple-let
  3. (syntax-rules ()
  4. ((_ (head ... ((x . y) val) . tail)
  5. body1 body2 ...)
  6. (syntax-error "expected an identifier but got" (x . y)))
  7. ((_ ((name val) ...) body1 body2 ...)
  8. ((lambda (name ...) body1 body2 ...)
  9. val ...))))
  10. (list (simple-let (((a . b) 12)) (format #t "x:~w~%" x)))
  11. (simple-let ((x 12)) (format #t "x:~w~%" x))
  12. ;; Diagnostic: errors4.scm:10:7: expected an identifier but got (a . b)