2 ms·
There's a difference between "having a destructor" and having a first-class representation of it. For instance, basically every language has a destructor for bo
by tel 12y ago
There's a difference between "having a destructor" and having a first-class representation of it. For instance, basically every language has a destructor for booleans—it's just if.
The trick is that unless you have first-class functions you probably cannot reify such a destructor. It always just lives in your syntax.
On the flip side, that's really what it means for a language to, say, lack sum types. It's not that the language doesn't have the ability to have choice, it's that it lacks the ability to represent choice in data. In other words, you probably can eliminate choice using if/switch/case/what-have-you but you can't construct it.