3 ms·
Isn't this copied from Haskell? Being a lazy language, Haskell has the advantage that the underscored variable is not even evaluated.
by adiM 14y ago
Isn't this copied from Haskell? Being a lazy language, Haskell has the advantage that the underscored variable is not even evaluated.
- jbri 14y agoYes, _ 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.
- sp332 14y agoHaskell 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.
- zaptheimpaler 14y agoML, a functional programming language developed in early 1970 used underscores as wildcards too.
- freyrs3 14y ago> 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.