Re: [Scheme-reports] [r6rs-discuss] [scheme-reports] Scheme pattern matching & R*RS
Per Bothner 21 Dec 2010 17:01 UTC
On 12/21/2010 08:43 AM, Andre van Tonder wrote:
> On Tue, 21 Dec 2010, Jim Wise wrote:
>
>> FWIW, with John Cowan's and my changes to the MatchingWise proposal,
>> importing the (rnrs match) library overrides the following forms from
>> (rnrs core) and (rnrs control) with versions which do pattern matching
>> but are otherwise upwardly compatible with the non-pattern matching
>> versions:
>
> I don't like overriding. Experience with it in other languages that make
> a fetish of it shows that it almost always leads to code that is more
> difficult to understand. The meaning of any code snippet becomes highly
> contextual and nonlocal. It is one of the reasons for the failure of
> object-oriented languages to deliver on their initial promises in the
> industry. It is, in my opinion, a fashion that can't be over soon enough.
>
> There is a long, and in my experience excellent, tradition in Scheme of
> not using names in libraries that clash with core names.
IMO we're not talking about names that "clash" - rather we're talking
about *generalizing* the existing names. One option we have is to
just replace the traditional definitions of lambda etc with versions
extended to pattern-matching. For a standard I think we should be
conservative and not do that - yet. But it might be something we
might want to consider for, say, R8RS.
It is not helpful to have two functions or syntactic forms with different
names, where one is just an extension or generalization of the other.
If the extension is useful enough to put in the standard it is easier to
just use the single extended version.
--
--Per Bothner
per@bothner.com http://per.bothner.com/
_______________________________________________
Scheme-reports mailing list
Scheme-reports@scheme-reports.org
http://lists.scheme-reports.org/cgi-bin/mailman/listinfo/scheme-reports