From: Damien Mattei <damien.mattei@gmail.com>
To: guile-user <guile-user@gnu.org>
Subject: strange error message in macro
Date: Thu, 1 Jul 2021 09:34:54 +0200 [thread overview]
Message-ID: <CADEOade_WNp2jNc13V=WSEfZLWZ7+rYOFtp0Nbw2o=uesxotAQ@mail.gmail.com> (raw)
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
next reply other threads:[~2021-07-01 7:34 UTC|newest]
Thread overview: 2+ messages / expand[flat|nested] mbox.gz Atom feed top
2021-07-01 7:34 Damien Mattei [this message]
2021-07-01 8:02 ` strange error message in macro Linus Björnstam
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
List information: https://www.gnu.org/software/guile/
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to='CADEOade_WNp2jNc13V=WSEfZLWZ7+rYOFtp0Nbw2o=uesxotAQ@mail.gmail.com' \
--to=damien.mattei@gmail.com \
--cc=guile-user@gnu.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).