chicken-hackers
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [Chicken-hackers] read/write invariance of #!


From: Evan Hanson
Subject: Re: [Chicken-hackers] read/write invariance of #!
Date: Mon, 14 Jan 2019 09:16:18 +1300

Hi Jim,

On 2019-01-12 10:04, Jim Ursetto wrote:
> 
> > On Jan 11, 2019, at 9:47 PM, Jim Ursetto <address@hidden> wrote:
> > 
> >> On Jan 11, 2019, at 3:12 PM, Evan Hanson <address@hidden 
> >> <mailto:address@hidden>> wrote:
> >> 
> >> In case someone decides to apply this patch, there's an unnecessary (and 
> >> ...)
> >> around the conditional that can be removed.
> > 
> > Hi Evan,
> > Sorry for the delay. I happened to be testing this out earlier today—it 
> > appears to be fine, applied to HEAD from today. (With the and clause 
> > intact.)
> 
> Looks like I tested this with core from a few days ago, prior to #1077 being 
> applied, which touched the same code. Therefore the patch needs to be updated 
> slightly. Unfortunately it missed 5.0.1. :(

No worries, here's an updated version of the patch that should apply
nicely to HEAD.

I don't think this change fixes the example you gave as a "certain
strange combination" in ticket #1572, i.e. (#! (foo bar)). ISTM that
happens because any whitespace after a "#!" token causes the reader to
skip everything until the end of the line (and the same goes for a
forward slash); see the first clause at library.scm:4242:

    (cond ((and (char? c)
                (or (char-whitespace? c) (char=? #\/ c)))
           (skip-to-eol)
           (readrec) )
          (else
           (let ([tok (r-token)])
             (cond [(string=? "eof" tok) #!eof]

Does anyone know what that's about? I can't figure out what feature that
code is there to support. It's been there since the first check-in to
Git (I didn't look any further back than that).

Cheers,

Evan

Attachment: 0001-Preserve-read-write-invariance-for-symbols-prefixed-.patch
Description: Text Data


reply via email to

[Prev in Thread] Current Thread [Next in Thread]