[Top][All Lists]

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

Re: [PATCH] add language/wisp to Guile?

From: Marc Nieper-Wißkirchen
Subject: Re: [PATCH] add language/wisp to Guile?
Date: Sun, 26 Feb 2023 12:02:04 +0100

Am So., 26. Feb. 2023 um 08:46 Uhr schrieb <>:

> Message: 1
> Date: Sun, 26 Feb 2023 02:45:12 -0500
> From: "Philip McGrath" <>
> To: "Maxime Devos" <>, Ludovic Courtès
>         <>, "Matt Wette" <>,
> Cc: "Christine Lemmer-Webber" <>
> Subject: Re: [PATCH] add language/wisp to Guile?
> Message-ID: <>
> Content-Type: text/plain;charset=utf-8


I would like to make two remarks, which I think are essential to get
the semantics right.

The R6RS comments of the form "#!r6rs" are defined to modify the
lexical syntax of the reader; possibly, they don't change the language
semantics (after reading).  In particular, "#!r6rs" also applies to
data files but does not affect the interpretation of the data after it
is read. It cannot because the reader otherwise ignores and does not
report comments.

Thus a comment of the form "#!r6rs" may be suitable for Wisp, but it
is not a substitute for Racket's "#lang" (or a similar mechanism).
Guile shouldn't confuse these two different levels of meaning.

The second comment concerns the shebang line in R6RS scripts (as
described in the non-normative appendices).  The shebang line is not a
comment in the R6RS lexical syntax; it does not even reach the reader
- at least, conceptionally.  The Scheme reader only sees the lines
following the shebang line.

For example, a conforming R6RS implementation must raise an exception
when trying to read (using get-datum, for example) a file that begins
with a shebang line.

Thus, the shebang line doesn't need to be considered when discussing
comment formats in lexical syntax.

This also shows how a mechanism like "#lang" can be made compatible
with R6RS, namely similar to scripts starting with a shebang line: Let
us define a "multi-language script" whose first line may be a shebang
and whose second line may be of the form "#lang ...".  If "..." is,
say, "r6rs", the following lines are then fed to the reader and
interpreted as an R6RS top-level program.



reply via email to

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