Home Segments Index Top Previous Next

93: Mainline

You can include comments in Smalltalk methods, using double-quotation marks, at any point. Whenever Smalltalk encounters a double-quotation mark, Smalltalk ignores both the double-quotation mark and all other characters up to and including the next double-quotation mark, as in the following examples:

" A short comment " 
" 
  A comment ... 
  that just goes on ... 
  and on ... 
  and on ... 
" 

Traditionally, a comment explaining what the method does appears immediately inside the definition, as shown in Segment 90.