unofficial mirror of guile-user@gnu.org 
 help / color / mirror / Atom feed
* Using R7RS symbol syntax in guile
@ 2017-04-28 14:14 sidhu1f
  2017-04-28 15:36 ` Stefan Israelsson Tampe
  0 siblings, 1 reply; 3+ messages in thread
From: sidhu1f @ 2017-04-28 14:14 UTC (permalink / raw)
  To: Guile user

Could someone please explain the following seemingly counterintuitive
behavior regarding the r7rs syntax for symbols (symbol #foo is
expressed as |#foo| using r7rs syntax, more info in sec.6.6.6.6 of guile
ref. manual).

When I invoke 'guile -s' on a file containing:

  (read-enable 'r7rs-symbols)
  (display (symbol->string '|#foo|)) (newline)
  (use-modules (test-r7rs))
  (display (symbol->string '|#foo|)) (newline)

guile 2.2 outputs:

  |#foo|
  #foo

Why the discrepancy? The module (test-r7rs) file contains:

  (define-module (test-r7rs))
  (read-enable 'r7rs-symbols)

Essentially, I'm asking why guile displays the symbol incorrectly (|#foo|)
in the first case but correctly (#foo) in the second.

Thanks
Reetinder



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

* Re: Using R7RS symbol syntax in guile
  2017-04-28 14:14 Using R7RS symbol syntax in guile sidhu1f
@ 2017-04-28 15:36 ` Stefan Israelsson Tampe
  2017-05-05 13:32   ` sidhu1f
  0 siblings, 1 reply; 3+ messages in thread
From: Stefan Israelsson Tampe @ 2017-04-28 15:36 UTC (permalink / raw)
  To: sidhu1f; +Cc: Guile user

Iäm unsure but if the first pass of the files is
1. read in form by form
2. macro expand

then evaluated. If read-enable is a function it will not be executed at the
macro expansion of the file. However for the use-module part
guile will load the module at expansion time.

Regards
Stefan


On Fri, Apr 28, 2017 at 4:14 PM, sidhu1f <sidhu1f@gmail.com> wrote:

> Could someone please explain the following seemingly counterintuitive
> behavior regarding the r7rs syntax for symbols (symbol #foo is
> expressed as |#foo| using r7rs syntax, more info in sec.6.6.6.6 of guile
> ref. manual).
>
> When I invoke 'guile -s' on a file containing:
>
>   (read-enable 'r7rs-symbols)
>   (display (symbol->string '|#foo|)) (newline)
>   (use-modules (test-r7rs))
>   (display (symbol->string '|#foo|)) (newline)
>
> guile 2.2 outputs:
>
>   |#foo|
>   #foo
>
> Why the discrepancy? The module (test-r7rs) file contains:
>
>   (define-module (test-r7rs))
>   (read-enable 'r7rs-symbols)
>
> Essentially, I'm asking why guile displays the symbol incorrectly (|#foo|)
> in the first case but correctly (#foo) in the second.
>
> Thanks
> Reetinder
>
>


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

* Re: Using R7RS symbol syntax in guile
  2017-04-28 15:36 ` Stefan Israelsson Tampe
@ 2017-05-05 13:32   ` sidhu1f
  0 siblings, 0 replies; 3+ messages in thread
From: sidhu1f @ 2017-05-05 13:32 UTC (permalink / raw)
  To: Stefan Israelsson Tampe; +Cc: Guile user

Thanks Stefan, what you say does give me a vague idea of what may be
happening, but delving into the guile ref. manual has not clarified
the picture, and its not important enough to try tackling the source
code directly. I'll stick to the standard guile symbol syntax
(#{...}#) for now :).

Regards
Reetinder

On Fri, Apr 28, 2017 at 9:06 PM, Stefan Israelsson Tampe
<stefan.itampe@gmail.com> wrote:
> Iäm unsure but if the first pass of the files is
> 1. read in form by form
> 2. macro expand
>
> then evaluated. If read-enable is a function it will not be executed at the
> macro expansion of the file. However for the use-module part
> guile will load the module at expansion time.
>
> Regards
> Stefan
>
>
> On Fri, Apr 28, 2017 at 4:14 PM, sidhu1f <sidhu1f@gmail.com> wrote:
>>
>> Could someone please explain the following seemingly counterintuitive
>> behavior regarding the r7rs syntax for symbols (symbol #foo is
>> expressed as |#foo| using r7rs syntax, more info in sec.6.6.6.6 of guile
>> ref. manual).
>>
>> When I invoke 'guile -s' on a file containing:
>>
>>   (read-enable 'r7rs-symbols)
>>   (display (symbol->string '|#foo|)) (newline)
>>   (use-modules (test-r7rs))
>>   (display (symbol->string '|#foo|)) (newline)
>>
>> guile 2.2 outputs:
>>
>>   |#foo|
>>   #foo
>>
>> Why the discrepancy? The module (test-r7rs) file contains:
>>
>>   (define-module (test-r7rs))
>>   (read-enable 'r7rs-symbols)
>>
>> Essentially, I'm asking why guile displays the symbol incorrectly (|#foo|)
>> in the first case but correctly (#foo) in the second.
>>
>> Thanks
>> Reetinder
>>
>



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

end of thread, other threads:[~2017-05-05 13:32 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2017-04-28 14:14 Using R7RS symbol syntax in guile sidhu1f
2017-04-28 15:36 ` Stefan Israelsson Tampe
2017-05-05 13:32   ` sidhu1f

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