Or you could repurpose a keyword inline [ int ]
to indicate interior allocation. Brendan Eich wrote: > On May 19, 2011, at 8:28 AM, Graydon Hoare wrote: > >> On 18/05/2011 6:46 PM, Sebastian Sylvan wrote: >> >>> In fact, in that case all you'd need to change, as far as I can tell, >>> is the vector type constructor syntax to be "[T]" instead of T[] which >>> would avoid any ambiguous associativity issues (that last example >>> would then be "mutable @ [ @ mutable int ]"). >> Yeah. I'm sympathetic to this and have discussed exactly this point a fair >> bit already; the problem is that we'd like to reserve room in the syntax for >> a type of vecs that have a specific interior allocation reserved for them >> rather than pointing to the heap. I.e. int[10] or such. >> >> This could still be done by [int](10) or [10]int or even [10 int] it's just >> a matter of ... alienness of convention? > Presumably if the natives are C/C++ hackers, int[10] would be non-alien. But > type in the middle or on the right would be more consistent, ceteris paribus. > > I think [10 int] reads well. Can the constant expression sub-grammar compose > this way? > > /be > _______________________________________________ > Rust-dev mailing list > [email protected] > https://mail.mozilla.org/listinfo/rust-dev _______________________________________________ Rust-dev mailing list [email protected] https://mail.mozilla.org/listinfo/rust-dev
