From: Mark H Weaver <mhw@netris.org>
To: Panicz Maciej Godek <godek.maciek@gmail.com>
Cc: guile-devel <guile-devel@gnu.org>
Subject: Re: Fwd: Guile interpeter crash
Date: Tue, 01 Oct 2013 16:34:22 -0400 [thread overview]
Message-ID: <8761tghgs1.fsf@netris.org> (raw)
In-Reply-To: <CAMFYt2bKn=xNEMWODZ_gJ=3F5RBftK3MVxe7bHknHgpK5+G4Xw@mail.gmail.com> (Panicz Maciej Godek's message of "Tue, 1 Oct 2013 18:42:57 +0200")
Panicz Maciej Godek <godek.maciek@gmail.com> writes:
> ---------- Forwarded message ----------
> From: Panicz Maciej Godek <godek.maciek@gmail.com>
> Date: 2013/10/1
> Subject: Re: Guile interpeter crash
> To: Dmitry Bogatov <KAction@gnu.org>
>
> 2013/10/1 Dmitry Bogatov <KAction@gnu.org>
>
> Here is code that results crash (return 134). Hope it is
> interesting.
>
> The code you gave is not a proper Scheme program.
> C.f.
> http://www.schemers.org/Documents/Standards/R5RS/HTML/r5rs-Z-H-8.html#%_
> sec_5.3, excerpt:
>
> Although macros may expand into definitions and syntax definitions in
> any context that permits them, it is an error for a definition or
> syntax definition to shadow a syntactic keyword whose meaning is
> needed to determine whether some form in the group of forms that
> contains the shadowing definition is in fact a definition, or, for
> internal definitions, is needed to determine the boundary between the
> group and the expressions that follow the group
>
> In other words, you cannot redefine define.
It can be done safely using the module system, by calling it something
other than 'define' in the module, and then renaming it on export. For
example, see:
http://git.savannah.gnu.org/gitweb/?p=guile.git;a=blob;f=module/ice-9/curried-definitions.scm;h=fa369906ccd222b6aa2f3692f17638ca02eb2a41;hb=HEAD
In practice, there are ways to redefine 'define' within the same module
in Guile 2.0, but it depends on implementation details and might not be
future proof.
> That being said, I don't think it's fortunate to use the # character
> within a symbol.
Yes, it's probably best to avoid that character in symbols. The fact
that it happens to work is a quirk of our reader, and is undocumented.
For the documented characters that are allowed in symbols, see:
http://www.gnu.org/software/guile/manual/html_node/Symbol-Read-Syntax.html
Regards,
Mark
next prev parent reply other threads:[~2013-10-01 20:34 UTC|newest]
Thread overview: 4+ messages / expand[flat|nested] mbox.gz Atom feed top
2013-10-01 15:15 Guile interpeter crash Dmitry Bogatov
[not found] ` <CAMFYt2avxvU_Vd-oBObtNq43qaU9wCLq=K=AHaLWJMmvrzq=pA@mail.gmail.com>
2013-10-01 16:42 ` Fwd: " Panicz Maciej Godek
2013-10-01 20:34 ` Mark H Weaver [this message]
2013-10-02 7:13 ` Dmitry Bogatov
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=8761tghgs1.fsf@netris.org \
--to=mhw@netris.org \
--cc=godek.maciek@gmail.com \
--cc=guile-devel@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).