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: felix . winkelmann
Subject: Re: [Chicken-hackers] read/write invariance of #!
Date: Sun, 13 Jan 2019 22:28:00 +0100

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

That's intentional, to handle shebang lines as comments.


felix




reply via email to

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