3 ms·
To me, the argument to convince oneself that Haskell's = "assigmnent" is not the same beast as C's and Python's is the following: the binding it defines is also
by tripa 16y ago
To me, the argument to convince oneself that Haskell's = "assigmnent" is not the same beast as C's and Python's is the following: the binding it defines is also valid in code before it.
- shadowfox 16y agoI think I didn't get this :( Care to explain?
- klodolph 16y agoIn 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]
- tripa 16y agomain=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.