3 ms·
> The only way I can think of making this sound and well-typed, is that null supports any fields and any methods, returning always null. This doesn't fit well h
by latte 8y ago
> The only way I can think of making this sound and well-typed, is that null supports any fields and any methods, returning always null. This doesn't fit well how many of the languages actually do.
This is what Clojure does to an extent - in Clojure, it is called nil-punning and implicitly handling nil values by using the functions that return null on null input makes the code concise and is considered idiomatic practice. In other Lisp dialects, this is even more common, as far as I know.