BlockPointer
The BlockPointer
aspect can be attached to a C#, Swift or Java delegate type declaration in order to indicate that the type represents a true block/delegate, not a function pointer. Since this is the default behavior of the delegate
syntax, this aspect is not really needed, and is provided mainly for symmetry with the related FunctionPointer
aspect.
In Oxygene, this distinction is made based on the keyword used to declare the type – the block
and (deprecated) delegate
keywords declare a block, while the method
and (also deprecated) function
and procedure
keywords declare a function pointer.
type
SomeBlock = public block(aString: String): Integer;
[BlockPointer]
public delegate int SomeBlock(string aString);
@BlockPointer public typealias SomeBlock = (String) -> (Int);
// delegates are not supported in Java (yet)
Defined by the core compiler.
See Also
FunctionPointer
Aspect