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

C'mon, (condp = ...) was not that bad :)


condp was rough for me. It requires too much shifting around of the pieces to figure out what it was doing.


I don't believe there is very much gain in code clarity here.

The core benefit of case over condp is efficiency. The condp is linear (goes over each clause until one matches) and case builds a very efficient dispatch function during compile time. This is why case only takes compile-time constant expressions.




Consider applying for YC's Winter 2026 batch! Applications are open till Nov 10

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

Search: