[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
strange error message in macro
From: |
Damien Mattei |
Subject: |
strange error message in macro |
Date: |
Thu, 1 Jul 2021 09:34:54 +0200 |
hello,
'begin' complains of 'sequence of zero expressions in form (begin)'
in:
scheme@(guile-user)> ($ {x <- 7} {y <- 8} (+ x y))
While compiling expression:
Syntax error:
unknown file:2:0: sequence of zero expressions in form (begin)
but:
scheme@(guile-user)> (begin )
make no error !
basically $ is a sort of begin macro that call :
(define-syntax %parse-assignment
(syntax-rules ()
...
if i wrote:
(define-syntax %parse-assignment
(syntax-rules (<-)
there is no more error:
scheme@(guile-user)> ($ {x <- 7} {y <- 8} (+ x y))
;;; <stdin>:5:0: warning: possibly unbound variable `x'
;;; <stdin>:5:0: warning: possibly unbound variable `y'
15
result is 15 and good!
i think that the explanation is with syntax-rules parameters not with
begin that would not accept zero expression in form , so why this strange
message?
i suppose i have trouble understanding the behavior and use of syntax-rules
parameters anyway and can not find any reliable documentation about it.
Damien
- strange error message in macro,
Damien Mattei <=