Hacker News
new
|
past
|
comments
|
ask
|
show
|
jobs
|
submit
login
earthboundkid
on July 29, 2007
|
parent
|
context
|
favorite
| on:
PG: If starting Viaweb today, would you use Lisp?
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
portLAN
on July 30, 2007
[–]
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.
Guidelines
|
FAQ
|
Lists
|
API
|
Security
|
Legal
|
Apply to YC
|
Contact
Search: