3 ms·
> How does your dynamic language tell its user an operation is invalid, based on argument type? It doesn't! That's exactly the point. If something is invalid,
by catnaroek 10y ago
> How does your dynamic language tell its user an operation is invalid, based on argument type?
It doesn't! That's exactly the point. If something is invalid, then it can't happen. At all.
- tempodox 10y agoIf only. What language are you talking about, exactly? This unicorn I have to see.
- catnaroek 10y agoAny memory-safe language? Say, Python. `[] / []` is a perfectly valid operation: its result is a raised exception misleadingly called `TypeError`. OTOH, in most typed languages, this is a genuinely invalid operation, and it can't happen at all.