Hacker Newsnew | past | comments | ask | show | jobs | submitlogin

Isn't this copied from Haskell? Being a lazy language, Haskell has the advantage that the underscored variable is not even evaluated.


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.


ML, a functional programming language developed in early 1970 used underscores as wildcards too.


> 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.




Guidelines | FAQ | Lists | API | Security | Legal | Apply to YC | Contact

Search: