I came across the following in the Arc FAQ: Won't allowing <new possibility> confuse people reading code? E.g. (a i) could be a function call or an array reference. IMHO the fact that (a i) can be an array reference is one of the main attractions of Arc. Mathematically an array IS a function that takes integers in a certain range to values, and what could be more natural than using the function notation to express it? Most of my programming is in data mining and text processing, and I am usually stuck programming in perl because I like $a{b}++ better than (hash-table/put! a 'b (+ (hash-table/get a 'b) 1)). Now (++ (a 'b)) comes a lot closer to what I have always dreamt. Arc already has hashes and arrays being used in the function position. Structs are just functions that turn symbols into values. Files and streams can be seen as functions (with state) of no arguments that return consecutive lines, records etc. I am not sure about the treatment of strings with (str i) - the characters are not always the first thing you want. At least in my area splitting the string into tokens separated by tabs etc. is what is most frequently needed and (line i) is best defined as the i'th field in the line (think awk, or perl -a). Thinking about the most natural way to treat a data type in the function position is a very useful exercise and I'd like to thank Paul for leading the way. I've also been thinking about pushing the idea of treating data structures as functions to its limits. One could think of a generic data type that sometimes acts as a hash, sometimes an array, and sometimes as a priority queue depending on the demands of the application. The keys for which no explicit value has been defined can fall through to a lambda expression (sorry, fn expression), which further blurs the line between function and data. It may be a crazy idea that confuses the programmer, or impossible to implement, but I can see a great many situations where programs get shorter as a result. What do you think? Finally, here is a challenge to Arc from the text processing world; I'd love to stop using perl as soon as extracting word counts from a file in as many tokens as: while(<>) { $cnt{$_}++ for split; } |