* Jonathan S. Shapiro: > On Sun, Jun 17, 2012 at 11:43 AM, Florian Weimer <[email protected]> wrote: > >> Ada supports variable-sized arrays as values, without indirection, so >> I would say it permits both. Ada's arrays seem closer to vectors in >> your terminology. >> > > By "without indirection", do you mean that they are unboxed? You're going > to have to prove that to me by a pointer to the Ada standard.
The language is designed in such a way that arrays with variable length (and other objects whose size is not statically known) can be created without resorting to dynamic storage and pointers. So you can write function "&" (Left, Right : String) returns String; and declare operator that takes two unconstrained strings and returns their concatenation as a new unconstrained String. The language does not require a specific implementation model, of course. GCC-based GNAT has always gone to great lengths to avoid heap allocations, driving up implementation complexity. (In the core language, you only get a heap allocation when you explicitly write an allocator.) There are implementations which use the heap more freely where convenient. And on the JVM, you've got no choice but to box arrays. _______________________________________________ bitc-dev mailing list [email protected] http://www.coyotos.org/mailman/listinfo/bitc-dev
