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
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
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
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());
}
}
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
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
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
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