From: Mikael Djurfeldt <mikael@djurfeldt.com>
To: Maxime Devos <maximedevos@telenet.be>
Cc: "Attila Lendvai" <attila@lendvai.name>,
"Tommi Höynälänmaa" <tommi.hoynalanmaa@gmail.com>,
"Jonas Hahnfeld via Developers list for Guile,
the GNU extensibility library" <guile-devel@gnu.org>
Subject: Re: Exporting a nonexistent variable
Date: Thu, 14 Nov 2024 11:27:52 +0100 [thread overview]
Message-ID: <CAA2XvwJ8eJSkNVn4G_LgKkod1HpTxiiO58N0+X8-7y3Qgou5Uw@mail.gmail.com> (raw)
In-Reply-To: <20241114104224.cZiN2D00o2o9iX101ZiPo0@xavier.telenet-ops.be>
[-- Attachment #1: Type: text/plain, Size: 2841 bytes --]
I think the wording in the Guile manual is unfortunate.
What RnRS says is that an identifier which is bound to a location is a
variable.
What the Guile manual is then discussing is our implementation details of
this, where "bound" is used in a different sense than in RnRS.
Den tors 14 nov. 2024 10:42Maxime Devos via Developers list for Guile, the
GNU extensibility library <guile-devel@gnu.org> skrev:
> (My current e-mail client keeps corrupting guile-devel@gnu.org and
> refuses access to the contact list, please ignore wrong address)
>
>
>
> >there are various use-cases where one wants to export a symbol [sic] from
> a module without binding [sic] any value to it in the module where it is
> being exported from.
>
>
>
> Symbol -> variable, without binding any value -> without defining it to
> some value, see
> https://www.gnu.org/software/guile/manual/html_node/Variables.html.
> Definedness and boundness are not the same thing.
>
> (It’s annoying that after the introduction where it talks about
> definedness / boundness distinction, it gets things wrong again in the
> first procedure `make-undefined-variable` and later `variable-bound?’.)
>
>
>
> What use cases would this be?
>
>
>
> All I can think of is:
>
>
>
> >(define-module (a) #:export (b) (=>))
>
> >(define b)
>
> >(define-syntax => [something that makes compile-time error about this
> needing a syntax-parameterize)
>
>
>
> In the first case, the variable ‘b’ is ‘undefined’. But it is still bound:
> an undefined variable is bound the symbol ‘b’ In the module ‘a’. In the
> second case, a variable with the name ‘=>’ is defined (and has the status
> of a macro), but only as a placeholder and except for error messages, it
> might as well have been undefined instead.
>
>
>
> Neither of these is the situation in the original code, where the symbol
> wasn’t bound to any variable – no corresponding variable exists, whether
> defined or undefined (unless the ‘export’ implicitly creates variables, but
> that’s rather implicit and undocumented). And I don’t see any use case for
> that.
>
>
>
> Would be interesting to investigate what RnRS has to say about the
> situation.
>
>
>
> > WARNING: (guile-user): `myproc' imported from both (mod1) and (mod2)
>
>
>
> >this^ is key, never ignore such warnings! i'd go as far as to suggest
> that this warning should be turned into an error. that would force the
> author to fix his package definitions to explicitly resolve such collisions.
>
>
>
> Unless ‘myproc’ isn’t used (and it’s a whole module being compiled at
> once, not a REPL situation), then the import conflict wouldn’t matter.
> Could use a somewhat subtler approach.
>
>
>
> Best regards,
>
> Maxime Devos
>
[-- Attachment #2: Type: text/html, Size: 5209 bytes --]
prev parent reply other threads:[~2024-11-14 10:27 UTC|newest]
Thread overview: 9+ messages / expand[flat|nested] mbox.gz Atom feed top
2024-11-04 12:26 Exporting a nonexistent variable Tommi Höynälänmaa
2024-11-04 20:43 ` Maxime Devos
2024-11-05 7:25 ` Tommi Höynälänmaa
2024-11-05 9:23 ` Maxime Devos
2024-11-05 9:26 ` Maxime Devos
2024-11-05 10:00 ` Tommi Höynälänmaa
2024-11-13 22:22 ` Attila Lendvai
2024-11-14 9:42 ` Maxime Devos via Developers list for Guile, the GNU extensibility library
2024-11-14 10:27 ` Mikael Djurfeldt [this message]
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=CAA2XvwJ8eJSkNVn4G_LgKkod1HpTxiiO58N0+X8-7y3Qgou5Uw@mail.gmail.com \
--to=mikael@djurfeldt.com \
--cc=attila@lendvai.name \
--cc=guile-devel@gnu.org \
--cc=maximedevos@telenet.be \
--cc=tommi.hoynalanmaa@gmail.com \
/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).