In article <[EMAIL PROTECTED]> [EMAIL PROTECTED] writes:
>In any case, I think it is high time that we free ourselves of an
>imperative view of arrays and functions, and the differences between
You are right that too much of an imperative view *is* taken of
functional programming. Most textbooks implicitly promote this view.
Of course we get the platitudes at the beginning of textbooks - a few
lines saying that functional programs are based on maths (the *most*
important thing, IMHO), they are not "instruction-based", there are no
assignments, they have referential transparency. Then, off they go
throughout the rest of the book giving us a very "instruction-based"
view of functions and functional programming!
Regarding the `set of ordered pairs' view of functions, the syntax may
not be too clever, but you can get something similar by saying (for an
example `double' function):
double 0 = 0
double 1 = 2
double 2 = 4
double 3 = 6
Rob Turner, Dept. of Computer Science, University of Hull, UK.
Internet: [EMAIL PROTECTED] Phone: (0482) 465212