Hacker News new | ask | show | jobs
by edu 6909 days ago
I don't think it matters. If you know Lisp you should be able to decide wheter it's the right tool for your project or not. If you don't know Lisp you should do a little effort and try to learn it. Whatever the Pauls answer is (but I imagine the it will be something like "Yes" or "Arc").

I'm learning Lisp right now. Reading the Practical Common Lisk on the web http://www.gigamonkeys.com/book/ until my dead-tree copy arrives (I'm also waiting for my copy of ANSI Common Lisp. Paul, if I manage to get to the face-to-face interview on Boston for that Y-Combinator round, do you mind if I ask you to sign to book? pleeease ^_^), and so I currently better building a website with Perl+Catalyst+MySQL than with Lisp. Probably when I get more confidence with Lisp it will change.

So, although Paul is a great writter and a really great hacker his answer to that concrete question has not really a lot of value. And, I've previously said I bet a beer-token that the answer will be something that evaluates to true.

1 comments

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

> In my very biased and unlearned view the simplest readable versions are Javascript and Lua.

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:

  def foo(n): return lambda (i): n+i
Which is essentially identical to the Common Lisp version.
If it's supposed to be an accumulator, I take it they want the value of n to be changed each time. I'd do:

    def acc(n):
        while True:
            n += yield n
But emphasizing correctness makes my one-liner not work! And reading the original I can see this whole issue was already covered!

BTW, generators are non-callable.