[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: [r6rs-discuss] [Scheme-reports] [scheme-reports] Scheme pattern matching & R*RS
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
> 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.
r6rs-discuss mailing list