[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: functional programming is great, but why lists?
> X-Authentication-Warning: fast.cs.utah.edu: majordom set sender to owner-plt-scheme@flux.cs.utah.edu using -f
> Date: Thu, 11 Oct 2001 20:10:58 -0500
> From: Bill Richter <richter@math.nwu.edu>
> Cc: plt-scheme@fast.cs.utah.edu
> Sender: owner-plt-scheme@fast.cs.utah.edu
> Precedence: bulk
>
> In Olin Shivers' memorable phrase,
>
> Minimalism and elegance will guide design, but we should bear in
> mind the dictum that "things should be made as simple as
> possible, but no simpler." Lambda is not a universally sufficient
> value constructor.
>
> Sounds good, Shriram. Would (I almost said "could" :)) you explain
> why it's not, why we need lists too?
>
>
Of course, if you have lambda you _already_ have lists. Here's an example
from SICP (apologies to those who've seen this before):
(define (cons x y)
(lambda (m) (m x y)))
(define (car z)
(z (lambda (p q) p)))
(define (cdr z)
(z (lambda (p q) q)))
Thus, I don't understand Olin's comment about lambda not being sufficient,
unless lambda + lists are also not sufficient. I'm not being facetious; I
know this is hopelessly inefficient, but we're talking about what's
necessary in principle.
Mike