Prev | Current Page 274 | Next

L. McColl-Sylvester and F. Ponticelli

"Professional haXe and Neko"

If the two were declared in the same file or in the same package,
??‘
??‘
??‘
??‘
??‘
??‘
??‘
140
Part I: The Core Language
there would be a conflict and the compiler simply cannot proceed but if they exist in different packages,
and thus they can be easily distinguished, the compiler can do its job without a glitch.
Packages in haXe resemble the Java model and to some extent the namespaces as implemented in .Net.
Using Packages
The naming convention for packages is the same that applies to variables (alphanumeric sequence
starting with a lowercase letter) and their names must match the directories that contain the package
files; a package file normally has the same name of the main type defined in it with the conventional
haXe extension .hx . When files and directories are named after types and packages, the compiler can do
its job and easily find the position of each type definition.
When the haXe compiler is invoked, it is always necessary to point to an entry type definition, and if the
corresponding file is encountered (type name + .


Pages:
262 263 264 265 266 267 268 269 270 271 272 273 274 275 276 277 278 279 280 281 282 283 284 285 286