In order to actually use the identifier, it must first be defined. Surprisingly, you do this using the
DEFINE_KIND macro:
DEFINE_KIND( MY_ABSTRACT_KIND );
Unlike the DECLARE_KIND , DEFINE_KIND must only occur once within your C/C++ library, so it
wouldn ??™ t normally appear inside a header file.
Part III: Extending the Possibilities
564
Handling Abstract Values in Neko
Once you have your nicely packaged abstract value in C/C++, you ??™ re probably going to want to pass it
back to Neko. In haXe, an abstract value doesn ??™ t have a type, per se, but as all values in haXe have a
type, even if inferred, it is then important to tell the haXe compiler that the variable container holding
the abstract value is of a nonmanageable type or placeholder if you will. This is especially true if the
variable container exists as a class member variable, whereby failing to specify a type results in a
compiler error. So, you make your value safe and type the variable as type Void :
var myAbstract : Void = hello( neko.
Pages:
1023
1024
1025
1026
1027
1028
1029
1030
1031
1032
1033
1034
1035
1036
1037
1038
1039
1040
1041
1042
1043
1044
1045
1046
1047