2 ms·
Smalltalk has that: https://www.gnu.org/software/smalltalk/manual-base/html_node/Class_002dinstance-creation.html https://www.gnu.org/software/smalltalk/manual
by twic 10y ago
Smalltalk has that:
https://www.gnu.org/software/smalltalk/manual-base/html_node/Class_002dinstance-creation.html https://www.gnu.org/software/smalltalk/manual-base/html_node...
https://www.gnu.org/software/smalltalk/manual/html_node/Inside-Arrays.html https://www.gnu.org/software/smalltalk/manual/html_node/Insi...
Although see the footnote - "This is not always true for other Smalltalk implementations, who don't allow instance variables in variableByteSubclasses and variableWordSubclasses". So, in some implementations, you can have either normal fields or array slots, but not both. That said, i think if you have a base class with fields, you can always make a subclass with slots.