This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/home/maik/hello.rs:1:0: 1:0 error: multiple matching crates for `std` | |
/home/maik/hello.rs:1 use std::comm::{stream, Chan,Port}; | |
^ | |
note: candidates: | |
note: path: /usr/local/lib/libstd-c3ca5d77d81b46c1-0.7-pre.so | |
note: meta: name = "std" | |
note: meta: vers = "0.7-pre" | |
note: meta: uuid = "c70c24a7-5551-4f73-8e37-380b11d80be8" | |
note: meta: url = "https://github.com/mozilla/rust/tree/master/src/libcore" | |
note: path: /usr/local/lib/rustc/x86_64-unknown-linux-gnu/lib/libstd-c3ca5d77d81b46c1-0.7-pre.so |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
struct Handle{ | |
priv handle: uint | |
} | |
impl Handle { | |
fn getHandle(&self) -> uint{ | |
self.handle | |
} | |
fn setHandle(&mut self, handle: uint){ | |
self.handle = handle; | |
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
enum Shader { | |
VertexShader{shader: BaseShader}, | |
FragmentShader{shader: BaseShader} | |
} | |
impl Shader { | |
fn newVertexShader(source : ~str) -> VertexShader{ | |
VertexShader {shader: BaseShader::new(source)} | |
} | |
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
enum Shader { | |
VertexShader{shader: BaseShader}, | |
FragmentShader{shader: BaseShader} | |
} | |
impl Shader { | |
fn newVertexShader(source : ~str) -> VertexShader{ | |
VertexShader {shader: BaseShader::new(source)} | |
} | |
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
pub trait BaseVec2<T>{ | |
fn new(x: T, y: T) -> Self; | |
} | |
#[deriving(Eq)] | |
pub struct Vec2<T> { x: T, y: T } | |
impl<T> BaseVec2<T> for Vec2<T> { | |
pub fn new(x: T, y: T ) -> Vec2<T> { |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
trait Visior<T>{ | |
fn visit(&self, t: T); | |
} | |
struct PrintVisitor; | |
impl PrintVisitor { | |
fn print(&self, s: ~str){ | |
println(s); | |
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
trait Visitor<T>{ | |
fn visit(&self, t: T); | |
} | |
struct PrintVisitor; | |
impl PrintVisitor { | |
fn print(&self, s: ~str){ | |
println(s); | |
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
trait Visitor<T>{ | |
fn visit(&self, t: T); | |
} | |
struct PrintVisitor; | |
impl PrintVisitor { | |
fn print(&self, s: ~str){ | |
println(s); | |
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
trait Visitor<T>{ | |
fn visit(&self, t: T); | |
} | |
struct PrintVisitor; | |
struct PrintReverseVisitor; | |
impl Visitor<~str> for PrintVisitor { | |
fn visit(&self, s: ~str){ |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
trait Visitor<T>{ | |
fn visit(&self, t: T); | |
} | |
struct PrintVisitor; | |
struct PrintReverseVisitor; | |
impl Visitor<~str> for PrintVisitor { | |
fn visit(&self, s: ~str){ |