[Newbies] getters, setters, attr?

David Pollak dpp at athena.com
Thu Sep 7 17:04:44 UTC 2006


I'm coming to Smalltalk from Ruby (from Java.)

Ruby has a nice construct:
attr :attribute_name[,true]

The construct generates a getter (and an optional setter if the true  
flag is included) for the named attribute (instance variable.)

Is there a similar shortcut to generating getters and setters in  
Smalltalk/Squeak?  I'm not interested in turning on #autoAccessors as  
I want control over the getters and setters.

Thanks in advance.


More information about the Beginners mailing list