seriously - unsophisticated is exactly what it needs to be.
would you be so kind as to explain what .perform() refers to and also why the “_” is appended before converting to a symbol? this is a really cool way of folding up those functions.
this is probably the hackiest thing in the pile. two parts:
(1) perform is a method of Object (the base class of all things.) it accepts a symbol, and if the receiver has a method with the same name as the symbol, that method is invoked with the remaining arguments passed along. relevant helpfile.
(2) when you set the value of a member variable, you are actually invoking a method with that variable’s name followed by an underscore. a default version of this method is generated automatically when you add > to the variable declaration in the class, but setters can also be customized. (like here.)
[not shown: same applies to getters, which are methods with the variable’s name alone - no underscore - and the declaration shortcut is <.]
relevant helpfile.
so those lines are just an inscrutable way of saying, “for each of these strings, add a command that calls the setter method for a variable with the same name as the string, on this object.” (maybe there is even a better way of doing this, but that is what i came up with.)
[aside: the difference between strings (mutable) and symbols (iummutable) is relevant here. it’s one of many places in SC where the string must be “made immutable” with .asSymbol.]