From: "Dr. Arne Babenhauserheide" <arne_bab@web.de>
To: Sascha Ziemann <ceving@gmail.com>
Cc: guile-user@gnu.org
Subject: Re: Does declaration order matter in guile?
Date: Mon, 13 Feb 2023 11:44:23 +0100 [thread overview]
Message-ID: <87zg9hlu0a.fsf@web.de> (raw)
In-Reply-To: <CAGUt3y6hGkNKpgM_26cPr6obOmLxmLjRUgBTJ1VWWhAhPNqMzA@mail.gmail.com>
[-- Attachment #1: Type: text/plain, Size: 1332 bytes --]
Sascha Ziemann <ceving@gmail.com> writes:
> Am So., 12. Feb. 2023 um 20:52 Uhr schrieb Taylan Kammer
> <taylan.kammer@gmail.com>:
>>
>> On 12.02.2023 19:46, wolf wrote:
>>
>> > 1. When does order matter? What is going on here?
>>
>> The order matters in this case because the SRFI-9 implementation in Guile defines
>> syntax (macros) rather than just variables bound to procedures.
>
> This is a huge problem of Scheme in general, that you can not
> distinguish between
> procedures and macros just by looking at the code. You have to know it
> or you have
> to look it up in the manual.
I see this as a strength, because it allows me to start with a procedure
and switch it to be a macro later on if I need to.
That way I can start with the weaker but easier to reason about
construct and move to the stronger one when needed.
> You also can not ask Scheme about macros, because macros are not
> first-class-citizens.
Actually you can, though you need to take a detour through modules:
(define-syntax-rule (foo) #f)
(define (bar) #f)
(macro? (module-ref (current-module) 'foo))
;; => #t
(macro? (module-ref (current-module) 'bar))
;; => #f
(that’s from the info reference manual)
Best wishes,
Arne
--
Unpolitisch sein
heißt politisch sein,
ohne es zu merken.
draketo.de
[-- Attachment #2: signature.asc --]
[-- Type: application/pgp-signature, Size: 1125 bytes --]
next prev parent reply other threads:[~2023-02-13 10:44 UTC|newest]
Thread overview: 8+ messages / expand[flat|nested] mbox.gz Atom feed top
2023-02-12 18:46 Does declaration order matter in guile? wolf
2023-02-12 19:52 ` Taylan Kammer
2023-02-13 8:05 ` Sascha Ziemann
2023-02-13 10:44 ` Dr. Arne Babenhauserheide [this message]
2023-02-13 17:07 ` Maxime Devos
2023-02-14 20:00 ` wolf
2023-02-14 20:26 ` Dr. Arne Babenhauserheide
2023-02-13 17:10 ` Maxime Devos
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=87zg9hlu0a.fsf@web.de \
--to=arne_bab@web.de \
--cc=ceving@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).