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

Convenient singleton types are quite interesting—what limitations do they have? Clearly this can become a massive thorny issue quickly if you try to achieve singletons in a general fashion.


The main issue with them is that they require that the object be ==, not just =. But given that almost every use that I know of for them in the core libraries is for integers or symbols, this isn't a big issue at all.

Other than that, they seem to work out fine.




Consider applying for YC's Summer 2026 batch! Applications are open till May 4

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

Search: