www.delorie.com/gnu/docs/smalltalk/gst_60.html   search  
 
Buy GNU books!


GNU Smalltalk User's Guide

[ < ] [ > ]   [ << ] [ Up ] [ >> ]         [Top] [Contents] [Index] [ ? ]

4.4.2 Documenting the class

The next step is to associate a description with the class. You do this by sending a message to the new class:
 
   Account comment:
   'I represent a place to deposit and withdraw money' !

A description is associated with every Smalltalk class, and it's considered good form to add a description to each new class you define. To get the description for a given class:
 
   (Account comment) printNl !

And your string is printed back to you. Try this with class Integer, too:
 
   (Integer comment) printNl !


  webmaster     delorie software   privacy  
  Copyright 2003   by The Free Software Foundation     Updated Jun 2003