unofficial mirror of guile-user@gnu.org 
 help / color / mirror / Atom feed
* Using . in module names
@ 2016-06-03  7:57 Christopher Baines
  2016-06-03  8:44 ` Neil Jerram
  2016-06-03 11:54 ` Taylan Ulrich Bayırlı/Kammer
  0 siblings, 2 replies; 5+ messages in thread
From: Christopher Baines @ 2016-06-03  7:57 UTC (permalink / raw)
  To: guile-user

[-- Attachment #1: Type: text/plain, Size: 213 bytes --]

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?


[-- Attachment #2: OpenPGP digital signature --]
[-- Type: application/pgp-signature, Size: 949 bytes --]

^ permalink raw reply	[flat|nested] 5+ messages in thread

* Re: Using . in module names
  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
  1 sibling, 0 replies; 5+ messages in thread
From: Neil Jerram @ 2016-06-03  8:44 UTC (permalink / raw)
  To: guile-user

On 03/06/16 08:57, Christopher Baines wrote:
>  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?
>

I think you should provide the complete example of what isn't working.  
It's not clear to me if you mean

(define-module (.) ...)

or

(define-module (.something) ...)

or

(define-module (something . else) ...)

etc.

Regards,
     Neil




^ permalink raw reply	[flat|nested] 5+ messages in thread

* Re: Using . in module names
  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
  2016-06-03 12:03   ` Marko Rauhamaa
  1 sibling, 1 reply; 5+ messages in thread
From: Taylan Ulrich Bayırlı/Kammer @ 2016-06-03 11:54 UTC (permalink / raw)
  To: Christopher Baines; +Cc: guile-user

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



^ permalink raw reply	[flat|nested] 5+ messages in thread

* Re: Using . in module names
  2016-06-03 11:54 ` Taylan Ulrich Bayırlı/Kammer
@ 2016-06-03 12:03   ` Marko Rauhamaa
  2016-06-03 12:17     ` Taylan Ulrich Bayırlı/Kammer
  0 siblings, 1 reply; 5+ messages in thread
From: Marko Rauhamaa @ 2016-06-03 12:03 UTC (permalink / raw)
  To: Taylan Ulrich "Bayırlı/Kammer"; +Cc: guile-user

taylanbayirli@gmail.com (Taylan Ulrich "Bayırlı/Kammer"):

> By the way, R7RS has standardized the syntax |foo| to denote symbols,

What is the R7RS notation for the symbol "|" (without the quotes)?


Marko



^ permalink raw reply	[flat|nested] 5+ messages in thread

* Re: Using . in module names
  2016-06-03 12:03   ` Marko Rauhamaa
@ 2016-06-03 12:17     ` Taylan Ulrich Bayırlı/Kammer
  0 siblings, 0 replies; 5+ messages in thread
From: Taylan Ulrich Bayırlı/Kammer @ 2016-06-03 12:17 UTC (permalink / raw)
  To: Marko Rauhamaa; +Cc: guile-user

Marko Rauhamaa <marko@pacujo.net> writes:

> taylanbayirli@gmail.com (Taylan Ulrich "Bayırlı/Kammer"):
>
>> By the way, R7RS has standardized the syntax |foo| to denote symbols,
>
> What is the R7RS notation for the symbol "|" (without the quotes)?
>
> Marko

|\||

Akin to the string "\"".

Taylan



^ permalink raw reply	[flat|nested] 5+ messages in thread

end of thread, other threads:[~2016-06-03 12:17 UTC | newest]

Thread overview: 5+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
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
2016-06-03 12:03   ` Marko Rauhamaa
2016-06-03 12:17     ` Taylan Ulrich Bayırlı/Kammer

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).