guile-devel
[Top][All Lists]
Advanced

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

Are library names data or syntax?


From: Taylan Kammer
Subject: Are library names data or syntax?
Date: Mon, 22 Jul 2024 10:12:48 +0200
User-agent: Mozilla Thunderbird

Thank you for the comments. I agree especially with the part about RnRS needing 
to define a broad-ranging standard that allows writing useful libraries in a 
portable way. The lack of e.g. networking primitives is extremely limiting and 
this always greatly bothered me about RnRS.

I have questions about your point #4 though.

On 21.07.2024 11:54, Marc Nieper-Wißkirchen wrote:

> Allowing numbers in library names makes certain syntactic extensions (as some 
> found in Chez Scheme) impossible.

Do you have a pointer to some resource that explains this in more detail? It's 
the first time I'm hearing about it and would like to learn more.

> In the syntax-case model of R6RS (which is also the basis of Guile's 
> expander), only identifiers like ":1" carry lexical information (a set of 
> marks and substitutions in the R6RS model), numbers and other Scheme datums 
> do not.

I've always thought of library names as data, not identifiers...

In R7RS, both 'define-library' and 'import' kind of exist "outside" the rest of 
the language, in a sense, and treat library names as literals.

- 'define-library' must be the outermost form read from a file/stream/whatever, 
and neither the library name being defined nor any of the library names in 
'import' sub-forms are subject to variable lookup or any such mechanisms that 
otherwise affect Scheme program evaluation; the library names are all treated 
literally, like data.

- 'import' (when not used a 'define-library' subform) must appear one or more 
times at the start of a sequence of forms read from a file/stream/whatever that 
describes a program, and the library name operands are again not subject to 
variable lookup or such, but rather treated literally as if data.

- The only other entity in R7RS that deals with library names, if I remember 
correctly, is the 'environment' procedure, which expects library names in the 
form of data (lists).

In what kind of situation might a library name be made up of identifiers 
(syntax objects) that might need to carry lexical information?


Cheers,

- Taylan



reply via email to

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