-
Notifications
You must be signed in to change notification settings - Fork 8
Augments
Abe Pralle edited this page Nov 22, 2023
·
5 revisions
class XYZ<<$DataType>> ...
augment XYZ [: BaseClassOrAspect, Aspect2, ...]
# Modifies every template instance (XYZ<<Int32>>, XYZ<<String>>, etc.)
PROPERTIES
# Additional properties
METHODS
method alpha
# Adds a new method alpha(). Replaces alpha() if it already exists.
method alpha [insert]
# If alpha() already exists, inserts this code at the beginning.
# If alpha() does not exist, this method is defined as alpha().
method alpha [append]
# Similar to [insert] but appends code at the end.
endAugment
augment XYZ<<Int32>>
# Modifies only the XYZ<<Int32> template instance.
METHODS
method alpha [replace]
...
endAugment
augment
METHODS
method TypeName1.alpha(...) ...
method TypeName2.beta(...) ...
...
endAugment
# The above is equivalent to:
augment TypeName1
METHODS
method alpha(...) ...
endAugment
augment TypeName2
METHODS
method beta(...) ...
endAugment
Augment a routine by writing a new routine definition and giving it the attribute [append]
, [insert]
, or [replace]
. Any existing routine with a matching signature will be modified or replaced accordingly.