News for hackers. Stuff that matters.
Re:Pissed off about functional programming by tripa on Saturday March 26, 2011 @08:46PM (#2373690)
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.
Re:Pissed off about functional programming by shadowfox on Sunday March 27, 2011 @01:05AM (#2374232)
I think I didn't get this :( Care to explain?
Re:Pissed off about functional programming by tripa on Sunday March 27, 2011 @04:32AM (#2374542)

    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.
Re:Pissed off about functional programming by klodolph on Sunday March 27, 2011 @01:24AM (#2374252)
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]