Re: [rust-dev] parameterizing types and functions by integers

2013-08-23 Thread Brendan Zabarauskas
This would be amazing. At the moment the [T,..n] types are pretty damn useless when it comes to generics. Mathematics, science and units of measure libs would find constant parametrisation most useful. I could imagine something like: fn dotT: Ring, N: uint(a: [T, ..N], b: [T, ..N]) - T { … }

[rust-dev] parameterizing types and functions by integers

2013-08-22 Thread Geoffrey Irving
Does rust have compile time sized arrays, equivalent to the following C++ definition? templateint d,class T struct array { T x[d]; }; More generally, is it possible to parameterize types by integers, so that types like the above can be built up? Finally, is it possible to

Re: [rust-dev] parameterizing types and functions by integers

2013-08-22 Thread Geoffrey Irving
Thanks for the quick reply (also adding back the list). Geoffrey On Thu, Aug 22, 2013 at 10:28 PM, John jmgro...@gmail.com wrote: For the moment, no, that's not possible. On Aug 22, 2013 10:23 PM, Geoffrey Irving irv...@naml.us wrote: Does rust have compile time sized arrays, equivalent