Search code examples
smalltalkpharo

Why instanceVariableNames is a String and not a more structured collection


I'm a Smalltalk beginner, currently playing with Pharo and I'm curious about a choice in the subclass message: the keyword instanceVariableNames wants something able to answer to the subStrings message. I wonder why it doesn't expect something more structured like an array, since what is needed is a collection of symbols.

Object subclass: #Experiment instanceVariableNames: #(#foo #bar).

My only guessing at this is some historical reason: maybe not all Smalltalks have arrays or their syntax differs to much to slip into an inner message as subclass. Is there any other explanation?


Solution

  • In the Pharo vision document, one of the points is to change that and have a real notion of instance variables. Check these links if you are interested: