Quoth Oleg Goldshmidt on Sat, Jun 07, 2003: > "Andre E. Bar'yudin" <[EMAIL PROTECTED]> writes: > > Well, Pascal has an ability to regard functions as legal arguments for > > other functions. In general, however, Pascal doesn't qualify to be > > called a full fledged functional programming language, of course. > > My indignation flared up too, but then I thought that "functional" > probably meant "viable" in the context.
No, I meant "functional" as opposed to OO and other paradigms. But why is Pascal not a full fledged functional language, and what is the definition of one? (Examples of such languages are welcome as well.)
Awaiting enlightenment,
I think what you're referring to here is "procedural", not "functional". A functional language is a language in which functions are first-class citizens - they can be created at runtime, passed as arguments to other functions, returned by other functions, be held in lists or whatever else you're used to doing with "ordinary" data types. Scheme and LISP are functional languages, for example.
Here's a convoluted example of a function in Scheme. Try to guess what is does :-)
(define foo
(lambda (n) (if (= n 0)
"Hello World!"
(lambda () (function (- n 1))))))
Alexander (aka Sasha) Maryanovsky.
================================================================= To unsubscribe, send mail to [EMAIL PROTECTED] with the word "unsubscribe" in the message body, e.g., run the command echo unsubscribe | mail [EMAIL PROTECTED]
