Sean Russell wrote:

> Mikael Brockman <phubuh / phubuh.org> wrote in message news:<87llhx2hec.fsf / phubuh.org>...
> 
>>Lots of functional languages lack pattern matching.  Scheme, for
>>example.  One can write Scheme-styled code in Ruby.
> 
> 
> In this, and following posts, you make the claim (directly and
> indirectly) that all languages are functional languages, rendering the
> term "functional language"  meaningless, or at least useless.  I
> oppose attempts to generalize words into meaninglessness.
> 
> There *are* good, useful definitions of what constitutes a functional
> languages, and Ruby does not match the criteria for most of them. 
> Probably the most fundamental of all criteria is that the language
> does not allow side-effects, such as assignment.

Interesting. Paul Graham, author of a few books on Lisp, has a new book 
out called Hackers and Painters. It's a collection of essays, most if 
not all of which are, I believe, on his web site (paulgraham.com).

There's an essay ("Revenge of the Nerds") toward the end of the book, 
part of sequence that sings the praises of (surprise) Lisp, and in it he 
mentions that many of the newer programming languages seem to follow a 
pattern of each one (perl -> python -> ruby ) being increasingly more 
like Lisp.  Ruby is mentioned only sporadically in his book, and mostly 
in the latter chapters, but in this essay he goes so far as to say that 
if you showed Lisp to hackers in 1975, and said it was a dialect of Lisp 
with some syntax added, no one would argue otherwise.

Later in the book he compares power/elegance in various languages, and 
uses an simple Lisp example of a function that returns another function, 
with the returned function parameterized by an argument passed tot he 
creating function.  His first example in another language is in Ruby; 
the code is nearly identical.  Other languages (perl, python, java, C) 
fair less well in accomplishing this task in a clean, straight-forward 
manner (if they can do it at all).

For me, the question is whether Ruby allows one to do proper functional 
programming, not that it forces one to do so.


James