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

In some languages, a function can be defined multiple times with different signatures (multiple 'heads'). It will try each clause until it finds one that matches, allowing you to filter or change course on the basis of the value or characteristics of the arguments.

This allows you to easily create special logic for corner cases and is generally extremely useful.



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

Search: