[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: What's so cool about Scheme?
[Guy Steele - Sun Microsystems Labs <Guy.Steele@Sun.COM>]
>
> 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*.
>
Yes, that makes sense... I probably would've seen these examples in
Scheme first, as well, had I not considered myself "above" taking the
CS intro class in college (taught in Scheme). As it happened, I first
saw them in SML, and I rather with I had taken the intro class. But
that's life!
In any case, it's an unfortunate association, as calling Lisp
functional is unfair to both Lisp and functional programming!
Matt
--
Matt Hellige matt@immute.net
http://matt.immute.net