unofficial mirror of bug-guile@gnu.org 
 help / color / mirror / Atom feed
* bug#38236: R7RS reader does not support datum labels
@ 2019-11-16 20:49 Andy Wingo
  2019-11-16 22:41 ` John Cowan
  2019-11-18 15:10 ` Mark H Weaver
  0 siblings, 2 replies; 5+ messages in thread
From: Andy Wingo @ 2019-11-16 20:49 UTC (permalink / raw)
  To: 38236

R7RS defines a lexical feature called "datum labels"; see section 2.4 in
the report.  An example would be:

   #0=(a b c . #0#)

Guile's reader doesn't support this feature and it's not clear if we
should, in general.  Note, datum literals appear to be incompatible with
array literals.  But we could of course use the R7RS layer as a place to
experiment with a `read' implemented in Scheme.





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

* bug#38236: R7RS reader does not support datum labels
  2019-11-16 20:49 bug#38236: R7RS reader does not support datum labels Andy Wingo
@ 2019-11-16 22:41 ` John Cowan
  2019-11-18 15:10 ` Mark H Weaver
  1 sibling, 0 replies; 5+ messages in thread
From: John Cowan @ 2019-11-16 22:41 UTC (permalink / raw)
  To: Andy Wingo; +Cc: 38236

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

I don't see where the incompatibility comes in, although more lookahead
would be required.  Per the Guile documentation, neither #n# nor #n= (where
n is a sequence of digits) is a valid array tag.

On Sat, Nov 16, 2019 at 3:50 PM Andy Wingo <wingo@pobox.com> wrote:

> R7RS defines a lexical feature called "datum labels"; see section 2.4 in
> the report.  An example would be:
>
>    #0=(a b c . #0#)
>
> Guile's reader doesn't support this feature and it's not clear if we
> should, in general.  Note, datum literals appear to be incompatible with
> array literals.  But we could of course use the R7RS layer as a place to
> experiment with a `read' implemented in Scheme.
>
>
>
>

[-- Attachment #2: Type: text/html, Size: 1034 bytes --]

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

* bug#38236: R7RS reader does not support datum labels
  2019-11-16 20:49 bug#38236: R7RS reader does not support datum labels Andy Wingo
  2019-11-16 22:41 ` John Cowan
@ 2019-11-18 15:10 ` Mark H Weaver
  2019-11-18 18:35   ` Andy Wingo
  1 sibling, 1 reply; 5+ messages in thread
From: Mark H Weaver @ 2019-11-18 15:10 UTC (permalink / raw)
  To: Andy Wingo; +Cc: 38236

Hi Andy,

Andy Wingo <wingo@pobox.com> writes:

> R7RS defines a lexical feature called "datum labels"; see section 2.4 in
> the report.  An example would be:
>
>    #0=(a b c . #0#)
>
> Guile's reader doesn't support this feature and it's not clear if we
> should, in general.

FYI, I already implemented R7RS datum labels on the 'r7rs-wip' branch
(not to be confused with your new 'wip-r7rs' branch):

  https://git.savannah.gnu.org/cgit/guile.git/commit/?h=r7rs-wip&id=92408ac20e921583b8e4ee26463dc5805ef01153

It depends on the preceding commit on the same branch:

  https://git.savannah.gnu.org/cgit/guile.git/commit/?h=r7rs-wip&id=f687871eceb94bded109569880e696d8862d84fd

There was also a later commit on that branch that enabled compilation of
cyclic literals, but it's no longer applicable to the 'master' branch.

> Note, datum literals appear to be incompatible with array literals.

Can you elaborate on why you believe they're incompatible?  I haven't
looked closely in a while, but I didn't see any incompatibility when I
implemented this before.  Datum labels have '#' or '=' after the
numeral, and I'm not aware of any Guile array syntax that does.

I'm also a bit puzzled why you're apparently planning to rewrite
everything I already did on the 'r7rs-wip' branch.  The main issue on
that branch is that the implementation of *writing* cyclic data turned
out to be a mess, but it could be removed or replaced without affecting
much else.

       Mark





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

* bug#38236: R7RS reader does not support datum labels
  2019-11-18 15:10 ` Mark H Weaver
@ 2019-11-18 18:35   ` Andy Wingo
  2019-11-18 20:57     ` Arne Babenhauserheide
  0 siblings, 1 reply; 5+ messages in thread
From: Andy Wingo @ 2019-11-18 18:35 UTC (permalink / raw)
  To: Mark H Weaver; +Cc: 38236

Hey!

On Mon 18 Nov 2019 16:10, Mark H Weaver <mhw@netris.org> writes:

> Andy Wingo <wingo@pobox.com> writes:
>
>> R7RS defines a lexical feature called "datum labels"; see section 2.4 in
>> the report.  An example would be:
>>
>>    #0=(a b c . #0#)
>>
>> Guile's reader doesn't support this feature and it's not clear if we
>> should, in general.
>
> FYI, I already implemented R7RS datum labels on the 'r7rs-wip' branch
> (not to be confused with your new 'wip-r7rs' branch):
>
>   https://git.savannah.gnu.org/cgit/guile.git/commit/?h=r7rs-wip&id=92408ac20e921583b8e4ee26463dc5805ef01153
>
> It depends on the preceding commit on the same branch:
>
>   https://git.savannah.gnu.org/cgit/guile.git/commit/?h=r7rs-wip&id=f687871eceb94bded109569880e696d8862d84fd
>
> There was also a later commit on that branch that enabled compilation of
> cyclic literals, but it's no longer applicable to the 'master' branch.

Neat!  I had entirely forgotten about this branch.

>> Note, datum literals appear to be incompatible with array literals.
>
> Can you elaborate on why you believe they're incompatible?  I haven't
> looked closely in a while, but I didn't see any incompatibility when I
> implemented this before.  Datum labels have '#' or '=' after the
> numeral, and I'm not aware of any Guile array syntax that does.

I was wrong.  Thanks for the correction!

> I'm also a bit puzzled why you're apparently planning to rewrite
> everything I already did on the 'r7rs-wip' branch.  The main issue on
> that branch is that the implementation of *writing* cyclic data turned
> out to be a mess, but it could be removed or replaced without affecting
> much else.

I had totally forgotten about it.  I am surprised no one on #guile
brought it up either when I was discussing this work!

As you can see, the the writing implementation currently uses srfi-38.

For what it's worth, I do not have future plans to work on R7RS -- I
just wanted --r7rs so that I could have an easy way to benchmark against
other Scheme systems.  A strange reason, admittedly!

Andy





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

* bug#38236: R7RS reader does not support datum labels
  2019-11-18 18:35   ` Andy Wingo
@ 2019-11-18 20:57     ` Arne Babenhauserheide
  0 siblings, 0 replies; 5+ messages in thread
From: Arne Babenhauserheide @ 2019-11-18 20:57 UTC (permalink / raw)
  To: 38236

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


Andy Wingo <wingo@pobox.com> writes:
>> I'm also a bit puzzled why you're apparently planning to rewrite
>> everything I already did on the 'r7rs-wip' branch.  The main issue on
>> that branch is that the implementation of *writing* cyclic data turned
>> out to be a mess, but it could be removed or replaced without affecting
>> much else.
>
> I had totally forgotten about it.  I am surprised no one on #guile
> brought it up either when I was discussing this work!

I assumed that you built upon the r7rs-wip branch, but did not check
that assumption.

Best wishes,
Arne

[-- Attachment #2: signature.asc --]
[-- Type: application/pgp-signature, Size: 1076 bytes --]

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

end of thread, other threads:[~2019-11-18 20:57 UTC | newest]

Thread overview: 5+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2019-11-16 20:49 bug#38236: R7RS reader does not support datum labels Andy Wingo
2019-11-16 22:41 ` John Cowan
2019-11-18 15:10 ` Mark H Weaver
2019-11-18 18:35   ` Andy Wingo
2019-11-18 20:57     ` Arne Babenhauserheide

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