On Tue, 2009-02-24 at 12:13 -0600, Alan Watson wrote: > Please show me the algorithm that translates "ESTA" to "ésta" in my > programs and "ESTA" to "esta" in Guillermo's programs. Now please tell > me if you want this algorithm to be part of the next Scheme standard.
It's not *that* hard and yes, I think it is worth exploring for Scheme standard. The problem arises because as things stand now Scheme has only a single, global (as in planetary) flat name-space of symbols. Thus, there can be only one rule for downcasing ESTA, even though two rules are needed. If it were the case that Guillermo's ESTA and your ESTA were distinct symbols, and if each of those symbols contained additional information, then (perhaps) two distinct downcasing rules could be applied. What "additional information" should a symbol contain? Well, perhaps a global namespace identifier such as a URI. For example, when you write "ESTA" this might be understood (from lexical context) to mean "scheme-id://alan-watsons-world/ESTA" whereas Guillermo's means "scheme-id://guillermos-world/ESTA". Of course, those specific URIs would not necessarily be good choices. They are just there to illustrate the concept. Elsewhere could be declared the conversion rules for the two "worlds" - the two name-spaces. Done right, this would afford a third party to combine your two programs in a controlled way. Someone could write a single file containing both versions of ESTA without ambiguity. There are other reasons to like the idea of "lifting" symbol names in this way. It can contribute to modularity in more ways than just having two case conversion rules for ESTA. It also suggests a parsimonious representation in Scheme for URI's and for XML's fully qualified element names. -t _______________________________________________ r6rs-discuss mailing list [email protected] http://lists.r6rs.org/cgi-bin/mailman/listinfo/r6rs-discuss
