Changes between Version 13 and Version 14 of squeak_faq_new


Ignore:
Timestamp:
03/25/2015 11:36:11 AM (9 years ago)
Author:
fabio.niephaus
Comment:

--

Legend:

Unmodified
Added
Removed
Modified
  • squeak_faq_new

    v13 v14  
    3434
    3535=== How do I leave a method without returning a value, e.g. early return? ===
    36 In !Smalltalk `^` behaves similar to return in other languages. If a method in !Smalltalk should return nothing, typically you return `self`. You should avoid to return `nil`.
     36In Smalltalk `^` behaves similar to return in other languages. If a method in Smalltalk should return nothing, typically you return `self`. You should avoid to return `nil`.
    3737
    3838=== How do I break inside a loop? ===
    3939A way to do so is to put the loop into its own method and to add another return. However, you should consider the collection protocol. Usually, there already is a method, that solves your problem. Possible methods could be: `#detect:ifFound:ifNone:` or `#detect:thenDo:ifNone:`.
    4040
    41 === Are there abstract classes in !Smalltalk and how should I name them? ===
    42 In !Smalltalk a class is abstract when a method is implemented with "self subclassResponsibility". However, you can still create objects of this class, but this method cannot be called. A typically idiom is to extend the name with the word "Abstract". Examples in the image are: AbstractEvent, AbstractFont, or AbstractSound.
     41=== Are there abstract classes in Smalltalk and how should I name them? ===
     42In Smalltalk a class is abstract when a method is implemented with "self subclassResponsibility". However, you can still create objects of this class, but this method cannot be called. A typically idiom is to extend the name with the word "Abstract". Examples in the image are: !AbstractEvent, !AbstractFont, or !AbstractSound.
    4343
    4444== Idioms and Patterns ==