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

case sensitivity



In this note I describe a problem with the following paragraph
of Marc Feeley's original draft of SRFI 0:

    When writing portable code, the case used for the feature
    identifier should match the one in the SRFI registry.  This
    is to ensure that the feature identifier will be correctly
    recognized whether or not the Scheme system is case-sensitive.
    To support case-insensitive Scheme systems, the feature
    identifiers in the SRFI registry are guaranteed to be unique
    even when ignoring the case.

The last sentence of this paragraph is certainly important, but
it goes without saying because all implementations of IEEE/ANSI
or R5RS Scheme are case-insensitive.

I don't think an SRFI should be cluttered by explicit consideration
of every possible way in which an implementation of Scheme can be
in conflict with the SRFI because the implementation is already in
conflict with the IEEE/ANSI or R5RS specifications of Scheme, but
I do understand why known problems should be addressed.  In my
opinion, the paragraph quoted above fails to address a known problem.

For this particular SRFI, it is easy to foresee that systems that
violate the IEEE/ANSI/R5RS requirements for case-insensitivity may
be unable to recognize that the following are equivalent:

    (write (if-implements SRFI-0 1 2))
    (WRITE (IF-IMPLEMENTS SRFI-0 1 2))
    (Write (iF-iMPLeMeNTS SRFI-0 1 2))

I do not, however, see why such a system should have any problem
with

    (write (if-implements SRFI-0 1 2))
    (write (if-implements srfi-0 1 2))
    (write (if-implements SrFi-0 1 2))

because the IF-IMPLEMENTS special form can convert the feature
identifier to a canonical case before processing it.  So the
paragraph in question addresses a non-problem, but does not
address the real problem that arises in case-sensitive
implementations.  The real problem is recognition of the
IF-IMPLEMENTS special form, not the recognition of feature
identifiers.

The paragraph quoted at the beginning of this message therefore
serves no purpose, except perhaps to mislead some readers into
thinking that SRFI 0 was designed to work with case-sensitive
implementations of Scheme.

Will