--- Begin Message ---
>ClassDefinition new
> superclass: Object; "optional. If not specified, Object by default ;-)"
> name: #A; "optional and create an anonymous class if not specified"
> instVars: 'a b c';
> traits: {TEquality};
> package: 'Plop';
> createClass. " this message sent might be hidden by the browser when
accepting"
I would like to suggest to consider replacing
instVars: 'a b c';
with
instVars: #(
b
a
c
);
That is, to replace the String with names separated by whitespace, by an
array of Symbols, one name per line.
This would make it possible to put comments right next to variable names
like this:
instVars: #(
b "comment about b"
a "comment about a"
c "comment about c"
);
Which is similar to what can be done in other object oriented languages
like Java or C++.
This would also make for nice diffs of changes to the class definition -
when put into git - when instance variables are added, removed or
renamed.
instVars: #(
b
- a
+ d
c
);
Best Regards,
Milan Vavra
--
View this message in context:
http://forum.world.st/Class-syntax-brainstorming-tp4947801p4947858.html
Sent from the Pharo Smalltalk Developers mailing list archive at Nabble.com.
--- End Message ---