Changes between Version 3 and Version 4 of Delegates
- Timestamp:
- 11/07/12 13:25:43 (12 years ago)
Legend:
- Unmodified
- Added
- Removed
- Modified
-
Delegates
v3 v4 1 = Delegates =1 = Delegates and Signatures = 2 2 3 ( also known as typesafe (function) method pointers).3 (These are also known as typesafe (function) method pointers). 4 4 5 A delegateis a type that safely encapsulates a method of a specific signature5 A '''delegate''' is a type that safely encapsulates a method of a specific signature 6 6 (method return type and parameters). 7 7 … … 10 10 11 11 Once a delegate is assigned a method, it behaves exactly like that method 12 and can be used like any other method, with parameters and12 and can be used like any other method, i.e called with parameters and giving 13 13 a return value. 14 14 15 15 The type of a delegate is defined by the name of the delegate. 16 16 17 In cobra, delegates are declared as "method signatures" and define a type: 17 In cobra, delegates are declared as a "method '''signature'''" and define a type:[[BR]] 18 18 19 e.g 19 20 {{{