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.
[ Parent
| on HN ]
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.
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.