Changes between Version 14 and Version 15 of CaseSensitivityArcfide


Ignore:
Timestamp:
09/07/10 06:08:05 (7 years ago)
Author:
cowan
Comment:

--

Legend:

Unmodified
Added
Removed
Modified
  • CaseSensitivityArcfide

    v14 v15  
    2727I would like to avoid creation of "compatibility" layers in Scheme implementations that intend to break the default case sensitivity defaults. Since most code that needs to run or most legacy code that is important can be counted on to still run under their same implementations in this proposal, this actually improves the conformance and maintains a large body of backwards compatible source code without requiring modification. Such source code can easily be moved to systems with different defaults by using flags or modules. This is no more difficult than requiring special encantations in the target Scheme implementation. It is also standardized, so the user can easily make a library entirely portable in this regard by either using a flag or providing a module. Doing so is superior to requiring each implementation to have a unique encantation for calling the code with the correct behavior.  
    2828 
    29 The use of a parameter allows for much nicer interactions with the reader at a Scheme Core level without complicating the semantics. It also means that you have more control at run-time of the reader without making this more complex. It permits an acceptable level of control in Scheme Core, while scaling up to phasing levels and procedural macros in Scheme 7.  
     29The use of a parameter allows for much nicer interactions with the reader at a Scheme Core level without complicating the semantics. It also means that you have more control at run-time of the reader without making this more complex. It permits an acceptable level of control in Scheme Core, while scaling up to phasing levels and procedural macros in Scheme 7. 
     30 
     31== Case-sensitive and Case-Folded Modules (by John Cowan) == 
     32 
     33What happens when a case-preserving module imports names from a case-folded module?  Since Unicode case folding is downcasing, the obvious answer is that all such names are implicitly exported in lower case.  Thus a case-preserving module must refer to case-folded names in lower case only, and an attempt to reference them in upper case will fail. 
     34 
     35The reverse situation is more difficult.  A case-preserving module may export `foo`, `Foo`, and `FOO` as three separate names; how can they be written in a case-folding module that imports them?  The answer is that case-folding affects only reading and printing; small Scheme identifiers may contain both lowercase and uppercase letters, thanks to the presence of escaping mechanisms in identifier syntax.  Consequently, the case-folding module can refer to these identifiers as `foo` (or `FOO`), `|Foo|`, and `|FOO|` respectively. 
     36 
     37The comparative straightforwardness of this style is the justification for adding the CL-ish `|...|` syntax (which is supported in at least PLT, Gauche, Gambit, Chicken, Bigloo, Kawa, SISC, and Chez already) to the R6RS Unicode escape syntax of `\x<hexdigits>;`.  Using only Unicode escapes in a case-folding system, `|Foo|` would be spelled `\x46;oo` or `\x46;OO`, and `|FOO|` would be spelled `\x46;\x4F;\x4F;`, all of which are hideous and unreadable.  
    3038 
    3139== Issues == 
     
    3745== Endorsements == 
    3846 
    39 John Cowan endorses this page, with the following exception: 
     47John Cowan endorses this page, with the following exceptions: 
    4048 
    41  * The Unicode folding algorithm should be used whether the Scheme is Unicode-based or not, as it's trivial to subset.  It maps about 1000 individual characters to other characters and about 100 more characters to two-character sequences (such as ß to ss). 
     49 * The Unicode folding algorithm should be used whether the Scheme is Unicode-based or not, as it's trivial to subset.  It maps about 1000 individual characters to other characters and about 100 more characters to two-character sequences (such as ß to ss).  In situations where this is excessively expensive, implementations MAY limit the characters permitted in a symbol/identifier, as discussed in UnicodeCowan. 
     50 
     51  * Per PortsCowan, I now think that the proper home of symbol/identifier case sensitivity is a port rather than a global parameter.