> Here's my nutty idea for the day: > instead of treating data like code, > use code as data. ...
and Hehner's nutty idea (expressed in his unification of algebra, boolean algebra, and a few other things*) is to treat them (at least notationally) identically: > A list L is very similar to the function <n: (0,...#L) -> Ln>. > Indexing a list is the same as function application, and the same > notation Ln is used. List composition is the same as function > composition, and the same notation LM is used. List length is the > same as function size, and the same notation is used. It is useful > to mix lists and other functions in a composition. For example, > suc [3; 5; 2] = [4; 6; 33] > We can also mix lists and functions in a selective union. With > function 1->21 as left operand, and list [10; 11; 12] as right operand, > we get > 1->21 | [10;11;12] = [10;21;12] > just as we defined it for lists. And +L conveniently expresses the > sum of the list. So I really want to unify lists and functions. but unfortunately, list inclusion and function inclusion don't vary in the same direction. Maybe he needs some sort of transpose-like relationship? -Dave * Hehner, "Unified Algebra" <http://www.cs.toronto.edu/~hehner/UA.pdf>
