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

Re: What's so cool about Scheme?




   Date: Tue, 3 Jun 2003 10:27:02 -0500
   From: Matt Hellige <matt@immute.net>
   To: ll1-discuss@ai.mit.edu
   ...
   
   How did the label "functional" get stuck to Lisp/Scheme anyway?

It may have to do with the fact that many of the
"simple" functions on lists that are used as early
teaching examples are in fact purely functional:

(define (append x y)
  (if (null? x) y (cons (car x) (append (cdr x) y))))
  
(define (member? x y)
  (and (not (null? y))
       (or (equal? x (car y))
           (member? x (cdr y)))))

(define map (f x)
  (if (null? x) x (cons (f (car x)) (map f (cdr x)))))
  
and so on.  And by such examples one may be led into the
functional style of programming, which is *possible*
within Lisp/Scheme, though not *required*.

--Guy