This site is a static rendering of the Trac instance that was used by R7RS-WG1 for its work on R7RS-small (PDF), which was ratified in 2013. For more information, see Home.

Ticket 106: conditional code selection

2011-01-24 06:54:00
WG1 - Core
alexshinn
major
alexshinn
fixed
source
closed
2010-11-30 13:04:16
defect

As discussed in

https://groups.google.com/group/scheme-reports-wg1/browse_thread/thread/99c05dcb6a500183

users invariably want some way to conditionally select code depending on the implementation and/or feature set available. SRFI-0 provides cond-expand, R6RS implementations informally provide a library naming hack, and numerous other personal hacks exist.

Do we want to include something along these lines in WG1 Scheme?

Definitely yes, we need a standard way to inspect the availability of optional features and select code accordingly. There already are many existing proposals, this is either a module feature or a meta-language feature:

  • SRFI-0 defines a registry of "feature identifiers" and a 'cond-expand' form.
  • SRFI-55 has 'require-extension'
  • SLIB has 'require / provided? / provide' forms
  • Modules systems have their import mechanism
  • There are also configuration languages such as Scheme48, Racket, etc.

I want to mention meta-cond which I think is a particularly nice and general solution. I think we could make it work.

resolutionfixed
statusnewclosed

WG1 decided to go with CondExpandCowan.