Y
Hacker News
new
|
ask
|
show
|
jobs
by
shadowfox
5557 days ago
I think I didn't get this :( Care to explain?
2 comments
tripa
5556 days ago
main=print n n=42
In C or Python, this would print 0 or undef or some random contents. In Haskell, it prints 42. The "assignment" reaches back to instructions before itself. Which ought to hint it's not really an assignment in the (my) usual sense of the word.
link
klodolph
5557 days ago
In Haskell, I can:
x = 0:y y = 1:x main = print $ take 10 y
Producing output:
[1,0,1,0,1,0,1,0,1,0]
link