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

Re: [Scheme-reports] Legacy caar to cddddr

Andre van Tonder scripsit:

> For example, if I deconstruct using C*R 
> and decide to change the data structure from pairs to something else 
> (e.g. records that have some extra data), I can simply put the code in a 
> module parameterized over the C*R deconstructors and the code will 
> immediately work with the new data structure. This usually cannot be done 
> with an out of the box pattern matcher.

True.  However, you can of course put together your own C*R functions
if you want, and for that matter a pattern-matcher that only handles
pairs is easy to write too.

There's a more general point to this.  In languages with rigid
boundaries, what gets "put in the language" is critical, because
programmers can't change it: if your language doesn't have a C-style
switch statement, you can't easily add one.  In Scheme, however,
everything is flexible bar the lexical syntax.  So what needs to be
standardized other than absolute primitives?  Despite talk about
diamond-like standards, Scheme standards have *always* included
derived syntax and procedures.

The answer is, for the most part, that standards pave the wheel ruts.
R4/5/6/7RS has a lot of list procedures because people have written a lot
of programs involving lists.  (R7RS made a conscious effort to
rectify this somewhat, so vectors and strings now have many of
the same tools available.)

Schlingt dreifach einen Kreis vom dies!    John Cowan <cowan@x>
Schliesst euer Aug vor heiliger Schau,     http://www.ccil.org/~cowan
Denn er genoss vom Honig-Tau,
Und trank die Milch vom Paradies.            --Coleridge (tr. Politzer)

Scheme-reports mailing list