|
|
|
|
|
by monssoen
1527 days ago
|
|
A feature that Haxe offers could help here. Abstracts are compile time only types of which the implementation is fully inlined. Meaning we could define an abstract over ArrayBuffer which has an iterator of abstracts over Float64Array which define the x and y property getters. Once compiled the code will look very similar to the example given. It's one of the things I miss the most in TypeScript, coming from haxe. https://haxe.org/manual/types-abstract.html
https://code.haxe.org/category/abstract-types/color.html |
|