Abstract type: Difference between revisions
Content added Content deleted
Line 2,944: | Line 2,944: | ||
</lang> |
</lang> |
||
=={{header|Smalltalk}}== |
=={{header|Smalltalk}}== |
||
A class is declared abtract by responding to the query <tt>isAbstract</tt> with true, and defining the required protocol for subclasses to raise an error notification. Optionally, instance creation can be blocked. Typically, the IDE provides a menu function to generate these definitions automatically: |
A class is declared abtract by responding to the query <tt>isAbstract</tt> with true, and defining the required protocol for subclasses to raise an error notification. Optionally, instance creation can be blocked (but seldom done, as you will hit a subclassResponsibility anyway soon). Typically, the IDE provides a menu function to generate these definitions automatically: |
||
<lang smalltalk>someClass class >> isAbstract |
<lang smalltalk>someClass class >> isAbstract |
||
^ true |
^ true |