Re: [rust-dev] Proposal: rename sequence concatenation operator to ++

2012-01-26 Thread Marijn Haverbeke
You're right that the impls can be static, in which case interfaces don't enter into it. Also, method names can overlap in Rust (unlike in Haskell) without causing conflicts. So I guess this is not a direct issue. And yes, I do intend to implement support for super-interfaces, they seem to be

[rust-dev] Proposal: rename sequence concatenation operator to ++

2012-01-25 Thread Marijn Haverbeke
Currently it is simply '+'. The thing that prompted this is issue #1520 -- operator overloading. Delegating + on non-builtin-numeric types to a `num` interface that implements methods add/sub/mult/div/rem/neg methods seems elegant, and similar to Haskell's approach. Vector-concatenation + messes

Re: [rust-dev] Proposal: rename sequence concatenation operator to ++

2012-01-25 Thread Patrick Walton
On 1/25/12 11:46 AM, Marijn Haverbeke wrote: Currently it is simply '+'. The thing that prompted this is issue #1520 -- operator overloading. Delegating + on non-builtin-numeric types to a `num` interface that implements methods add/sub/mult/div/rem/neg methods seems elegant, and similar to

Re: [rust-dev] Proposal: rename sequence concatenation operator to ++

2012-01-25 Thread Marijn Haverbeke
What about an add interface? That works, but doesn't provide the conceptual simplicity of a number interface, and if you want to write a generic over any numeric type, it could end up taking a T: add, mult, sub, div type parameter. ___ Rust-dev mailing

Re: [rust-dev] Proposal: rename sequence concatenation operator to ++

2012-01-25 Thread Alex R.
There are cases in math or physics when the granularity is needed. For example, when implementing vectors (in the math or physics sense), it doesn't make sense to define a division operator, and what you mean by multiplication depends on if you mean dot product, cross product, or whatever. It'd

Re: [rust-dev] Proposal: rename sequence concatenation operator to ++

2012-01-25 Thread Niko Matsakis
On 1/25/12 12:18 PM, Marijn Haverbeke wrote: That works, but doesn't provide the conceptual simplicity of a number interface, and if you want to write a generic over any numeric type, it could end up taking aT: add, mult, sub, div type parameter. It seems to me that if impls did not have to