Programmer Reference : Pragmas : Annotation pragmas : Including an Annotation Pragma in a Method
Including an Annotation Pragma in a Method
You can include one or more annotation pragmas in any method. If included, annotation pragmas must be the first expression(s) in the method following the selector, except for a comment. Keyword pragmas must have a literal value argument for each keyword.
Following the annotation pragma(s) is the normal Smalltalk code for the method. This code is evaluated as usual whenever the method is invoked, but can also be invoked when the annotation pragma is processed.
A method might include only one annotation pragma, for example:
Transcript cr; show: 'Stuff done'
In this case a unary selector annotation pragma was used, so no arguments are supplied. Similarly, a method might use multiple annotation pragmas, for example:
<doStuffWith: #this>
<doStuffWith: #this and: #that>
Transcript cr; show: 'More stuff done'
The arguments are literals and will be passed to the application that processes the annotation pragma.
Last modified date: 01/29/2015