Prev | Current Page 667 | Next

L. McColl-Sylvester and F. Ponticelli

"Professional haXe and Neko"


Object initializer: {}
(F6??“9)
{ /* field definitions */ } or Reflect.empty()
If the object is initialized with some fields, then the behavior is the same
as in ActionScript. When a new empty object is needed (no fields at creation
time), use the method Reflect.empty(). The { } in haXe means
an empty block of code that returns Void.
var a = { name : ???John??? };
type(a); // type is { name : String }
var b = Reflect.empty();
type(b); // type is {}
var c = { };
type(c); // type is Void
Regular expression:
/pattern/flag
(F9)
??/pattern/flag
The ActionScript regular expression operator instantiates a new RegExp
object while the haXe operator instantiates an EReg object. They are functionally
equivalent.
Type operator: :
(F6??“9)
The operator works in the same way in ActionScript and haXe; however
declaring types in haXe is in many cases superfluous because the
compiler correctly infers types from the context.
typeof
(F6??“9)
Std.typeof()
XML operators
(F9)
Not implemented in haXe.
Part II: Server Side, JavaScript, and Flash: Oh My!
354
Table 12-5
ActionScript Keyword
(Flash Version) haXe Equivalent
arguments
(F6??“9)
haXe does not have a unified way to access to the arguments of a function
as an array of values.


Pages:
655 656 657 658 659 660 661 662 663 664 665 666 667 668 669 670 671 672 673 674 675 676 677 678 679