That is not to say, however, that they cannot contain literal values.
Void and Null
The Void type is a placeholder for no type or value . Very often, a type is required within areas of your code
that allow the compiler and virtual machine to understand the flow of data in your program. Using the
Void type tells the compiler that no data is to be expected at a particular juncture, so no type checking is
required. The usual location for such a type is as the return value of ??” or lack of ??” a function, though
you will also find the Void type useful when you tackle creating extensions for Neko in C.
The null type is not a type at all, but a kind of constant that means empty of value . Any variable can be
equal to null , which means that, although they are of a set type, they do not yet have a value, whereas a
variable of type Void would always be null , as it can have no value. This can get a little confusing when
you start using pointers to C structures that you would store in a variable of type Void , but would not
otherwise perform haXe - based comparisons upon such a value.
Pages:
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103