2 ms·
nil is weird in Go, and in most languages with an equivalent concept. It's a "hole in the type system" In Smalltalk, nil just contains the sole instance of the
by stcredzero 8y ago
nil is weird in Go, and in most languages with an equivalent concept. It's a "hole in the type system"
In Smalltalk, nil just contains the sole instance of the UndefinedObject class. It's not a hole in the type system. Instead, it becomes a paradox in the inheritance system, because it's used as a superclass.
Here's a WAT. Smalltalk is actually strongly typed. It's just that everything has the same type of Object. (The type system has no holes. However, it's the size of a thimble!)