From: Pascal Bourguignon
Subject: Re: static typing
Date: 
Message-ID: <87bqqwiwxx.fsf@thalassa.informatimago.com>
·····@rogers.com writes:

> Forgive glitches evident in this reply, as my posts to Usenet are in
> the range of 'almost never'.
>
> Newly fascinated with Lisp as I am, this phrase strikes me ... "First,
> if you're processing lists, you shouldn't use NULL, CONS, CAR or
> CDR!"... particularly were I to thumb a page or two of the "The Little
> Lisper", or it's kin.
>
> Data abstraction (and program efficiency) notwithstanding, at times are
> not the above primitives still the natural choice for 'nuts & bolts'
> computation of list structure?

The question is whether you are _implementing_ lists (for example, you
may be implementing a new list function, like ELEMENT-IN-THE-MIDDLE),
or whether you are _using_ lists.

Lisp "lists" are _implemented_ using CONS cells, so naturally, when
you write a function working _on_ lists, you use NULL, CONS, CAR, CDR.

But when you write a function working _with_ lists, you should use
list operators: ENDP, LIST, FIRST, REST, ELEMENT-IN-THE-MIDDLE.


Of course, the choice of considering ELEMENT-IN-THE-MIDDLE as a
function working _on_ lists or a function working _with_ lists is a
nuance that depends on you.  Is it a function that can belong the the
interface of the abstract data type list?  Or is it an application
specific function?  

-- 
__Pascal Bourguignon__                     http://www.informatimago.com/

READ THIS BEFORE OPENING PACKAGE: According to certain suggested
versions of the Grand Unified Theory, the primary particles
constituting this product may decay to nothingness within the next
four hundred million years.