The value null itself has the type
unknown .
It is important to know the difference between Void and null , so that they are used in the correct
context. It can often help to consider null as an absence of a value and Void as a value that is not native
to haXe or as a signifier that null should be passed in its place, though strictly speaking, null is
actually a value unto itself.
The Dynamic Type
The Dynamic type is like the haXe Swiss Army Knife. You ??™ d say it ??™ s one of the most useful types in the
language, but on consideration, what kind of program can you create without Int s and String s?
You ??™ ll look at only one use of the Dynamic type now, as some of its more advanced uses will have to wait
until later in the book.
Contrary to what you have learned throughout the beginning of this chapter, there are several ways
haXe can be treated as a type - less ??” or dynamic ??” language. The Dynamic type is one of those ways.
Those of you who are already proficient with ActionScript 2.0 can liken the Dynamic type to the Flash
Object type, though there are a number of differences that make programming with the Dynamic type a
little cleaner.
Pages:
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104