/rust-dev
___
Rust-dev mailing list
Rust-dev@mozilla.org
https://mail.mozilla.org/listinfo/rust-dev
--
Rémi Fontan : remifon...@yahoo.fr
mobile: +64 21 855 351
93 Otaki Street, Miramar 6022
Wellington, New Zealand
mailing list
Rust-dev@mozilla.org
https://mail.mozilla.org/listinfo/rust-dev
--
Rémi Fontan : remifon...@yahoo.fr
mobile: +64 21 855 351
93 Otaki Street, Miramar 6022
Wellington, New Zealand
___
Rust-dev mailing list
Rust-dev@mozilla.org
https
Hi,
when compiling following code I get following error:
use std::num;
struct vec2d { a:f32, b:f32 }
impl num::Zero for vec2d {
fn zero() - vec2d {
vec2d{a:0.0, b:0.0}
}
fn is_zero(self) - bool {
self.a==0.0 self.b==0.0
}
}
test.rs:4:1: 12:2 error: failed to
test.rs:6 cmp::max(self.a, self.b)
^~~~
make: *** [test-test] Error 101
have I missed something?
cheers,
Rémi
--
Rémi Fontan : remifon...@yahoo.fr
mobile: +64 21 855 351
93 Otaki Street, Miramar 6022
Wellington, New Zealand
general solution that will support
all types implementing Float (i.e. what the generic impl is doing).
On Tue, Dec 3, 2013 at 1:09 AM, Rémi Fontan remifon...@yahoo.fr wrote:
Hi,
I think I already asked this question in the past and I'm not very sure
what was the answer and whether it is still
;
println!(result: {}, data.a);
}
cheers,
Rémi
--
Rémi Fontan : remifon...@yahoo.fr
mobile: +64 21 855 351
93 Otaki Street, Miramar 6022
Wellington, New Zealand
___
Rust-dev mailing list
Rust-dev@mozilla.org
https://mail.mozilla.org/listinfo
Hi,
would you know what is the cost of implementing the double dispatch
technique as described on following link? (section What if I want
overloading?)
http://smallcultfollowing.com/babysteps/blog/2012/10/04/refining-traits-slash-impls/
does using traits means making used of something similar
good to know that.
thanks
Rémi
On Thu, Nov 28, 2013 at 11:00 PM, Huon Wilson dbau...@gmail.com wrote:
On 28/11/13 20:26, Rémi Fontan wrote:
Hi,
would you know what is the cost of implementing the double dispatch
technique as described on following link? (section What if I want
, 2013 at 11:35 PM, Daniel Micay danielmi...@gmail.com wrote:
On Sun, Oct 6, 2013 at 5:09 AM, Rémi Fontan remifon...@yahoo.fr wrote:
Hi,
I have just moved some of my code from 0.6 to rust 0.8 and was
surprisingly not too difficult, great!
however I noticed while converting copy to clone
Hi,
I have just moved some of my code from 0.6 to rust 0.8 and was surprisingly
not too difficult, great!
however I noticed while converting copy to clone that I have to use a lot
of explicit calls to .clone() in my templated code. In non templated
code, the compiler is apparently more
self.data[r*4+c]
^~~~
cheers,
Remi
--
Rémi Fontan : remifon...@yahoo.fr
mobile: +64 21 855 351
93 Otaki Street, Miramar 6022
Wellington, New Zealand
___
Rust-dev mailing list
Rust-dev@mozilla.org
https://mail.mozilla.org
great, that works. I guess I need to read a bit more about how scoping
works in rust.
thanks,
Rémi
On Sat, Jun 15, 2013 at 5:58 PM, Daniel Micay danielmi...@gmail.com wrote:
On Fri, Jun 14, 2013 at 7:11 PM, Rémi Fontan remifon...@yahoo.fr wrote:
Hi,
I have difficulties understanding
, component by component
let v1: Vec2d = ...;
let v2: Vec2d = ...;
v1*v2;
but I also would like to be able to multiply a vec2d with a scalar.
let v3 = v1*-1f;
I tried implementing the trait Mul twice but the compiler complains. How
would you do it?
cheers,
Rémi
--
Rémi Fontan : remifon
it = a.iter().enumerate();
Would you know what I need to do to simply enumerate a vector?
cheers,
Remi
--
Rémi Fontan : remifon...@yahoo.fr
mobile: +64 21 855 351
93 Otaki Street, Miramar 6022
Wellington, New Zealand
___
Rust-dev mailing list
Rust-dev
describes how you would achieve this:
http://smallcultfollowing.com/babysteps/blog/2012/10/04/refining-traits-slash-impls/
See the section entitled What if I want overloading?
On Sat, Jun 15, 2013 at 5:52 AM, Rémi Fontan remifon...@yahoo.fr wrote:
Hi,
I read that rust does not handle
--
Rémi Fontan : remifon...@yahoo.fr
mobile: +64 21 855 351
93 Otaki Street, Miramar 6022
Wellington, New Zealand
___
Rust-dev mailing list
Rust-dev@mozilla.org
https://mail.mozilla.org/listinfo/rust-dev
-Numeric-Traits
cheers,
Rémi
--
Rémi Fontan : remifon...@yahoo.fr
mobile: +64 21 855 351
93 Otaki Street, Miramar 6022
Wellington, New Zealand
___
Rust-dev mailing list
Rust-dev@mozilla.org
https://mail.mozilla.org/listinfo/rust-dev
{
pub fn new(a:T, b:T) - Vec2xT { Vec2x{x:a, y:b} }
}
}
#[test]
fn test_Vec2x() {
// let v = math::Vec2x::new(1f, 2f);
type Vec2f = math::Vec2xfloat;
let v2 = Vec2f::new(1f, 2f); // does not compile
}
cheers,
Rémi
--
Rémi Fontan : remifon...@yahoo.fr
mobile: +64 21 855
18 matches
Mail list logo