In which case, would special-casing == and !=, as you mentioned earlier, be a bad thing to do? (Sincere question; from a user pov it would make sense, but I don't know whether it would make operator overloading conceptually more ugly to have that special case in there)
martin On Sun, Apr 28, 2013 at 12:49 PM, Patrick Walton <[email protected]> wrote: > On 4/28/13 12:45 PM, [email protected] wrote: >> >> It is very easy to create a language that is unwieldy, but hard to >> create something KISS simple that can be adopted, and that will be >> praised for its cleanliness and elegance. >> >> If the basic things are not simple, a language will be relegated to >> academia, and will not be as popular as hoped. >> >> We really need to take a look into this one, and come up with something >> workable. That won't be easy considering what Patrick has mentioned. > > > As Daniel pointed out, it isn't so bad. I didn't realize that we already > borrow on the left hand side, so you can write: > > fn main() { > let x = ~"foo"; > if "foo" == x { > println("yep"); > } > } > > We just need to borrow on the right hand side too, so that `x == "foo"` > works. I can think of ways to do it; none are particularly pretty, but I > suspect we could make it work. But the situation is not so dire now. > > Patrick > > > _______________________________________________ > 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
