Re: [rust-dev] Rust philosophy and OOP

2012-10-08 Thread Eddy Cizeron
Hi everyone 2012/10/6 Tim Chevalier catamorph...@gmail.com Traits and impls in Rust are based on type classes, which originated in Haskell. You may find it interesting to read about type classes: Type classes: exploring the design space by Simon Peyton Jones, Mark Jones, and Erik Meijer, is a

Re: [rust-dev] Rust philosophy and OOP

2012-10-08 Thread Lindsey Kuper
On Mon, Oct 8, 2012 at 6:19 PM, Eddy Cizeron eddycize...@gmail.com wrote: 2012/10/6 Tim Chevalier catamorph...@gmail.com (Interfaces have been renamed to traits in the soon-to-be-released Rust 0.4 release, by the way; it looks like you may be looking at the docs from Rust 0.3.) Right, I was

[rust-dev] Assertion failure while compiling

2012-10-08 Thread Amitava Shee
I get an assertion failure while trying to compile the following use io::println; fn main() { trait Text { fn to_str(self) - ~str; } fn to_string(t: Text) { println(t.to_str()); } } amitava:l2 amitava$ rustc -g trait.rs Assertion failed: (Ty Invalid GetElementPtrInst indices

Re: [rust-dev] Assertion failure while compiling

2012-10-08 Thread Tim Chevalier
On Mon, Oct 8, 2012 at 5:14 PM, Amitava Shee amitava.s...@gmail.com wrote: I get an assertion failure while trying to compile the following use io::println; fn main() { trait Text { fn to_str(self) - ~str; } fn to_string(t: Text) { println(t.to_str()); } }

Re: [rust-dev] Rust philosophy and OOP

2012-10-08 Thread Joe Groff
On Mon, Oct 8, 2012 at 3:19 PM, Eddy Cizeron eddycize...@gmail.com wrote: Sorry I have not made myself clear enough. My point is absolulety not say that inheritance is a good/bad/required/unnecessary feature. My point is that if you're not using it (or at least if you're not using dynamic

Re: [rust-dev] Assertion failure while compiling

2012-10-08 Thread Amitava Shee
Here's the issue report - https://github.com/mozilla/rust/issues/3702 Amitava On Mon, Oct 8, 2012 at 8:15 PM, Tim Chevalier catamorph...@gmail.comwrote: On Mon, Oct 8, 2012 at 5:14 PM, Amitava Shee amitava.s...@gmail.com wrote: I get an assertion failure while trying to compile the

Re: [rust-dev] Rust philosophy and OOP

2012-10-08 Thread Bennie Kloosteman
Multiple parameter are very useful eg a collection and a second type , but it gets messy... it works ok provided its in a single compilation unit but else you get compilation unit dependency loops ,with generics ( which are similar) you can auto generate new libs to handle this not sure about

Re: [rust-dev] Rust philosophy and OOP

2012-10-08 Thread Sebastian Sylvan
On Mon, Oct 8, 2012 at 5:22 PM, Joe Groff arc...@gmail.com wrote: On Mon, Oct 8, 2012 at 3:19 PM, Eddy Cizeron eddycize...@gmail.com wrote: Sorry I have not made myself clear enough. My point is absolulety not say that inheritance is a good/bad/required/unnecessary feature. My point is that if