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

>Making a subclass for every string type strikes me as being a bit heavy, since usually you don't necessarily want new string behavior, you just want to classify it and define conversions.

Many languages can optimize such a construct away so that it only exists at compile time, or have another construct that declares "represented as type X, but treat it as a different type at compile time" (e.g. Haskell's newtype)



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

Search: