3 ms·
I like the way static extensions are done in Haxe https://haxe.org/manual/lf-static-extension.html https://haxe.org/manual/lf-static-extension.html Using macro
by taraparo 3y ago
I like the way static extensions are done in Haxe https://haxe.org/manual/lf-static-extension.html https://haxe.org/manual/lf-static-extension.html
Using macros you can auto enable them for all types in a project, package, or module.
And opposite to Dart you don't need to define the extension methods in special extension classes but regular utility classes or modules.
- rogerkeays 3y agoInteresting. Do you need to put the extension method in a utility class at all though? Could we put it in the Main class in the example?
- taraparo 3y agoThe static method can be anywhere afaik.