|
|
|
|
|
by andersholtsberg
6907 days ago
|
|
It is rather interesting to look at Paul's list of
implementations of an accmulator in different languages: http://www.paulgraham.com/accgen.html In my very biased and unlearned view the simplest readable
versions are Javascript and Lua. And Lua has server side
libraries for CGI and SQL and other goodies (search for
Xavante on the net). Just a tip for those poking around
for readable and clean language alternatives. And Lua just
got up to position 18 on the Tiobe index this month. http://www.tiobe.com/tpci.htm Hackers and Paiter page 161, The hundred years language: "How far will this flattening of data structures go? I can
think of possibilities that shock even me, with my
consiously broadened mind. Will we get rid of arrays for
example? After all, they're just a subset of hash tables
where the keys are vectors of integers." Lua does exactly this. And is quite efficient anyway. Anders Holtsberg |
|
The Python version listed there doesn't actually meet the requirement (it doesn't return a function, it returns a class instance, and it keeps modifying n every time it's called).
Corrected version:
Which is essentially identical to the Common Lisp version.