From: taylanbayirli@gmail.com (Taylan Ulrich Bayırlı/Kammer)
To: Christopher Baines <mail@cbaines.net>
Cc: guile-user@gnu.org
Subject: Re: Using . in module names
Date: Fri, 03 Jun 2016 14:54:18 +0300 [thread overview]
Message-ID: <87shwua3o5.fsf@T420.taylan> (raw)
In-Reply-To: <3813b138-93f1-a451-82fc-58d57c977274@cbaines.net> (Christopher Baines's message of "Fri, 3 Jun 2016 08:57:27 +0100")
Christopher Baines <mail@cbaines.net> writes:
> From reading the documentation, I would expect this to work, as . is
> valid in symbols? But from trying this out, it does not seem to (the
> module cannot be loaded).
>
> Does anyone have information about this?
While "." is valid in symbols, using it alone as a symbol is difficult,
since it's part of s-expression syntax denoting pairs.
In Guile, the syntax #{foo}# can be used to force something to be parsed
as a symbol. For instance, #{abcd}# and abcd are the same, but #{123}#
is a symbol whereas 123 is parsed as a number. Similarly, #{.}# can be
used to denote the symbol that consists of the sole character ".".
(define-module (foo #{.}# bar) ...)
(use-modules (foo #{.}# bar) ...)
By the way, R7RS has standardized the syntax |foo| to denote symbols,
which Guile already supports in a branch, though I don't know when it
will make it into a release. With that, the above examples would be
(define-module (foo |.| bar) ...)
(use-modules (foo |.| bar) ...)
which is somewhat cleaner.
There is no way to avoid using something like #{}# or || here, since in
the s-expression
(define-module (foo . bar) ...)
the "(foo . bar)" part parses as a pair object whose car is foo and cdr
is bar.
Taylan
next prev parent reply other threads:[~2016-06-03 11:54 UTC|newest]
Thread overview: 5+ messages / expand[flat|nested] mbox.gz Atom feed top
2016-06-03 7:57 Using . in module names Christopher Baines
2016-06-03 8:44 ` Neil Jerram
2016-06-03 11:54 ` Taylan Ulrich Bayırlı/Kammer [this message]
2016-06-03 12:03 ` Marko Rauhamaa
2016-06-03 12:17 ` Taylan Ulrich Bayırlı/Kammer
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=87shwua3o5.fsf@T420.taylan \
--to=taylanbayirli@gmail.com \
--cc=guile-user@gnu.org \
--cc=mail@cbaines.net \
/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).