Any tips for the Haxe GC?

I am learning Haxe for Flash recently and have experience with ActionScript 3.

I noticed that there is an operation in AS3 delete, is there something like that deletein Haxe? Is it deleteabout GC? Are there any tips for Haxe newbies on memory management?

+3
source share
2 answers

Marcus has already explained what the operator is doing delete. For use with Haxe, please refer to this page .

So the equivalent of Haxe for delete foo.b untyped __delete__(foo, "b"). In case you are going to use it a lot, I suggest you include this in a function;)

+6

Haxe, delete AS3 . AS3. delete . :

var foo:Object {
    a: "Hello, ",
    b: "world!",
    toString: function () { return a + b; }
}

foo.toString() // Hello, world!

, . -. :

delete foo.b;
foo.toString(); // Hello, undefined

, foo b, undefined. b . - , , , . , delete , , .

+10

Source: https://habr.com/ru/post/1765415/


All Articles