royale-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Harbs <>
Subject Arrays and types
Date Fri, 29 Jun 2018 08:12:58 GMT
There is something I’ve been struggling with:

AS3 does not have “typed” arrays. The closest it has is Vectors. The problem with vectors
is two-fold. First of all, the cross compiler uses Language to construct the vector rather
than simply declaring an array. This could probably be fixed though. The second problem is
that it’s awkward converting between arrays and vectors. This is especially problematic
when you want to “cast” an array retrieved from say JSON to a typed Vector. It’s also
a problem if you want to use Array features such as map and the like.

I’m not sure what the right solution to improving this would be. Expand Vector to allow
arrays and Vectors to be cast as each other? Create a new “array type" declaration (i.e.
var arr:String[] = [“foo”,”baz”];)? Something else?


View raw message