unofficial mirror of guile-user@gnu.org 
 help / color / mirror / Atom feed
* reading symbols containing apostrophe
@ 2020-12-30  4:51 Tom Gillespie
  2020-12-30 13:02 ` Taylan Kammer
  0 siblings, 1 reply; 4+ messages in thread
From: Tom Gillespie @ 2020-12-30  4:51 UTC (permalink / raw)
  To: guile-user

Hi,
   I'm in the processes of reviewing reader behavior for a number of
different lisp dialects and Guile has a quirk that I have been unable
to find any documentation about. Specifically, as far as I can tell
apostrophe is not allowed in identifiers according to the formal
grammars for r5rs through r7rs (I have not checked earlier versions).
In addition apostrophe is not included in the extended reader syntax
in the manual. However, 'a'b'c reads as a'b'c in guile 2.2.6. Am I
missing something? Is this a bug?

Best!
Tom



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

* Re: reading symbols containing apostrophe
  2020-12-30  4:51 reading symbols containing apostrophe Tom Gillespie
@ 2020-12-30 13:02 ` Taylan Kammer
  2021-01-04 23:12   ` Tom Gillespie
  0 siblings, 1 reply; 4+ messages in thread
From: Taylan Kammer @ 2020-12-30 13:02 UTC (permalink / raw)
  To: Tom Gillespie; +Cc: guile-user

On 30.12.2020 05:51, Tom Gillespie wrote:
> Hi,
>     I'm in the processes of reviewing reader behavior for a number of
> different lisp dialects and Guile has a quirk that I have been unable
> to find any documentation about. Specifically, as far as I can tell
> apostrophe is not allowed in identifiers according to the formal
> grammars for r5rs through r7rs (I have not checked earlier versions).
> In addition apostrophe is not included in the extended reader syntax
> in the manual. However, 'a'b'c reads as a'b'c in guile 2.2.6. Am I
> missing something? Is this a bug?

Hi Tom,

It's quite common for implementations to extend the standard, so 
something that's "an error" in the standard might be allowed in an 
implementation.

This is evidently one of those cases.

I would not *rely* on Guile supporting this either though.  Maybe in a 
future version the reader will be changed and it will stop working.


- Taylan




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

* Re: reading symbols containing apostrophe
  2020-12-30 13:02 ` Taylan Kammer
@ 2021-01-04 23:12   ` Tom Gillespie
  2021-01-05 13:23     ` Taylan Kammer
  0 siblings, 1 reply; 4+ messages in thread
From: Tom Gillespie @ 2021-01-04 23:12 UTC (permalink / raw)
  To: Taylan Kammer; +Cc: guile-user

Hi Taylan,
    Thank you for the explanation. Replies in line. Best!
Tom

> It's quite common for implementations to extend the standard, so
> something that's "an error" in the standard might be allowed in an
> implementation.

In this instance I think the situation is worse than if the standard
said this was an error. In fact the standard doesn't say this is an
error at all, which would be better than the current situation.
Where nearly all other implementations will read 'a'b'c as three
separate symbols, Guile reads it as a single symbol, silently
diverging from the standard without warning (until something
comes crashing down as a result of the difference later).

> This is evidently one of those cases.

Unfortunate that it does not seem to be documented anywhere.
Would it make sense to bring this up on the dev mailing list and
submit a patch to the documentation to indicate where guile is
incompatible with the standard?

> I would not *rely* on Guile supporting this either though.  Maybe in a
> future version the reader will be changed and it will stop working.

For now I will mark it as a quirk that will have to be tracked.



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

* Re: reading symbols containing apostrophe
  2021-01-04 23:12   ` Tom Gillespie
@ 2021-01-05 13:23     ` Taylan Kammer
  0 siblings, 0 replies; 4+ messages in thread
From: Taylan Kammer @ 2021-01-05 13:23 UTC (permalink / raw)
  To: Tom Gillespie; +Cc: guile-user

On 05.01.2021 00:12, Tom Gillespie wrote:
> In this instance I think the situation is worse than if the standard
> said this was an error. In fact the standard doesn't say this is an
> error at all, which would be better than the current situation.
> Where nearly all other implementations will read 'a'b'c as three
> separate symbols, Guile reads it as a single symbol, silently
> diverging from the standard without warning (until something
> comes crashing down as a result of the difference later).

Hmm, I'm looking at the R7RS-small BNF (haven't checked the other 
standards) and I think you're right.

The apostrophe is a token of its own, along with <identifier>, which I 
think would mean that 'foo'bar should be parsed as four tokens.

It might be worth taking this up with the devel mailing list then.


- Taylan



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

end of thread, other threads:[~2021-01-05 13:23 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2020-12-30  4:51 reading symbols containing apostrophe Tom Gillespie
2020-12-30 13:02 ` Taylan Kammer
2021-01-04 23:12   ` Tom Gillespie
2021-01-05 13:23     ` Taylan Kammer

unofficial mirror of guile-user@gnu.org 

This inbox may be cloned and mirrored by anyone:

	git clone --mirror https://yhetil.org/guile-user/0 guile-user/git/0.git

	# If you have public-inbox 1.1+ installed, you may
	# initialize and index your mirror using the following commands:
	public-inbox-init -V2 guile-user guile-user/ https://yhetil.org/guile-user \
		guile-user@gnu.org
	public-inbox-index guile-user

Example config snippet for mirrors.
Newsgroups are available over NNTP:
	nntp://news.yhetil.org/yhetil.lisp.guile.user
	nntp://news.gmane.io/gmane.lisp.guile.user


AGPL code for this site: git clone http://ou63pmih66umazou.onion/public-inbox.git