Renewed erratum call for ‘library’ as an export from (scheme base)

5 views
Skip to first unread message

Daphne Preston-Kendal

unread,
Apr 1, 2022, 1:19:51 PM4/1/22
to scheme-re...@googlegroups.com
Marc raised this issue in 2016:
<https://groups.google.com/g/scheme-reports-wg1/c/sMNF8k0h3So/m/za3TtykeEAAJ>

Since this is apparently ambiguous, I was intending to not support (library …) in cond-expand outside of import declarations in my WIP implementation.

But today I noticed that there is a sample implementation of cond-expand in terms of ‘syntax-rules’ in section 7.3. (Derived expression types) which lists ‘library’ as a pattern literal, meaning it is matched by free-identifier=?, meaning ‘library’ has to be bound to something for it to work properly.

I realize that even by the standards of the sample implementations in 7.3, the cond-expand sample implementation is impractical. Nonetheless it is part of the normative text of the standard. Much as in the case of identifiers as field names in define-record-type, identifier matching is thus the only semantic that makes sense when the entire report is read in context. Thus ‘library’ must be exported from somewhere, and (scheme base) must be the place to do it.

(‘r7rs’ and ‘scheme’ and ‘base’ are also considered pattern literals by that implementation, but this seems to me to be a result of shoehorning in the fundamentally un-syntax-rules-able cond-expand into cond-expand, a truly Procrustean effort.)


Daphne

Alex Shinn

unread,
Apr 1, 2022, 7:02:23 PM4/1/22
to scheme-re...@googlegroups.com
1. Matching does _not_ require the identifier be bound to work, so
your observation adds nothing new to the discussion.
2. In the absence of something like SRFI 206 (not included in the
small language) many people prefer not to use auxiliary syntax.
3. The cond-expand inside define-library must of necessity match
non-hygienically, so it's arguably better to keep these consistent.
4. Adding a new binding would break any code currently defining
`library' so is beyond the scope of an erratum.

--
Alex
> --
> You received this message because you are subscribed to the Google Groups "scheme-reports-wg1" group.
> To unsubscribe from this group and stop receiving emails from it, send an email to scheme-reports-...@googlegroups.com.
> To view this discussion on the web visit https://groups.google.com/d/msgid/scheme-reports-wg1/A011D916-DF54-48AE-808C-52AF49178C06%40nonceword.org.
Reply all
Reply to author
Forward
0 new messages