News for hackers. Stuff that matters.
Re:Ruby’s magic underscore by adiM on Saturday September 22, 2012 @11:02AM (#4557974)
Isn't this copied from Haskell? Being a lazy language, Haskell has the advantage that the underscored variable is not even evaluated.
Re:Ruby’s magic underscore by jbri on Saturday September 22, 2012 @11:29AM (#4558028)
Yes, _ indicating that a parameter is not relevant is how it's used in Haskell.

Though I do feel obligated to point out that, being lazy-evaluated, even if you do give a parameter a name it still won't be evaluated until you actually use it.

Re:Ruby’s magic underscore by sp332 on Saturday September 22, 2012 @12:08PM (#4558146)
Haskell is a relatively recent language; I know that Prolog (a completely different paradigm) did the same for underscores back in 1972, and I wouldn't be surprised if there is an even earlier example.
Re:Ruby’s magic underscore by zaptheimpaler on Saturday September 22, 2012 @06:27PM (#4559201)
ML, a functional programming language developed in early 1970 used underscores as wildcards too.
Re:Ruby’s magic underscore by freyrs3 on Sunday September 23, 2012 @09:43AM (#4560906)
> Haskell is a relatively recent language

Not really, it's older than both Ruby and Python. Compared to Prolog and C, yes I suppose so.