mirror of
https://github.com/ashinn/chibi-scheme.git
synced 2025-05-19 05:39:18 +02:00
Friendlier error message for misuse of standard macros
This commit is contained in:
parent
770b4d367b
commit
e97a2debe1
1 changed files with 9 additions and 1 deletions
|
@ -143,13 +143,21 @@
|
|||
(lambda (expr use-env mac-env)
|
||||
(f expr mac-env))))
|
||||
|
||||
(define er-macro-transformer
|
||||
(define er-macro-transformer*
|
||||
(lambda (f)
|
||||
(lambda (expr use-env mac-env)
|
||||
(f expr
|
||||
(make-renamer mac-env)
|
||||
(lambda (x y) (identifier=? use-env x use-env y))))))
|
||||
|
||||
(define er-macro-transformer
|
||||
(lambda (f)
|
||||
(er-macro-transformer*
|
||||
(lambda (expr rename compare)
|
||||
(if (not (pair? expr))
|
||||
(error "invalid use of non-identifier macro outside operator postion" expr)
|
||||
(f expr rename compare))))))
|
||||
|
||||
(define-syntax cond
|
||||
(er-macro-transformer
|
||||
(lambda (expr rename compare)
|
||||
|
|
Loading…
Add table
Reference in a new issue