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
var comm = new EasyComm(); | |
var CMD_HOME = 3; | |
var CMD_TOPBALL = 6; | |
comm.addCommand(CMD_TOPBALL, EasyComm.VALUE_BOOL, function(onOrOff) { | |
if (onOrOff) { | |
turnOnIndicator(); | |
} else { | |
turnOffIndicator(); | |
} |
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 Thing; | |
fn do_stuff<'a>(thing: &'a Thing) -> &'a fn() { | |
let cloned_thing = thing.clone(); | |
|| { | |
let cloned_cloned_thing = cloned_thing.clone(); | |
} | |
} | |
fn main() {} |
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 Thing; | |
fn do_stuff<'a>(thing: &'a Thing) -> &'a fn() { | |
let cloned_thing = thing.clone(); | |
|| { | |
let cloned_cloned_thing = cloned_thing.clone(); | |
} | |
} | |
fn main() {} |
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
use std::hashmap::HashMap; | |
enum Thing { Foo, Bar } | |
struct Context<'self> { | |
scope: HashMap<&'self str, Thing>, | |
parent: &'self Option<Context<'self>> | |
} | |
impl<'self> Context<'self> { |
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
use std::os; | |
fn tokenize(raw: &str) -> ~[&str] { | |
let replaced: ~str = raw.replace("(", " ( ").replace(")", " ) "); | |
replaced.split_iter(' ').collect() | |
} | |
fn main() { | |
printfln!("%?", tokenize(os::args()[1])); | |
} |
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
main.rs:159:13: 196:5 error: capture of moved value: `chans` | |
main.rs:159 do task::spawn { | |
main.rs:160 let iotask = uv_global_loop::get(); | |
main.rs:161 let localhost = net::ip::v4::parse_addr("127.0.0.1"); | |
main.rs:162 println("um"); | |
main.rs:163 | |
main.rs:164 let listen_result = do net::tcp::listen(localhost, 7654, 1, &iotask, | |
... | |
main.rs:165:54: 195:9 note: `chans` moved into closure environment here because it has type `~fn:Send(extra::net::tcp::TcpNewConnection, std::comm::SharedChan<std::option::Option<extra::net::tcp::TcpErrData>>)`, which is non-copyable (perhaps you meant to use clone()?) | |
main.rs:165 |_| ()) |new_conn, kill_ch| { |
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
gl/camera.rs:6:4: 6:9 error: unresolved import. maybe a missing `extern mod extra`? | |
gl/camera.rs:6 use extra::arc; | |
^~~~~ | |
gl/camera.rs:6:4: 6:14 error: failed to resolve import `extra::arc` | |
gl/camera.rs:6 use extra::arc; | |
^~~~~~~~~~ | |
error: aborting due to 2 previous errors |
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
use std::vec; | |
struct IndexableThing; | |
impl Index<uint, ~str> for IndexableThing { | |
fn index(&self, rhs: &uint) -> ~str { | |
(*rhs).to_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
struct Foo { | |
value: uint | |
} | |
impl Sub<Foo, Foo> for Foo { | |
fn sub(&self, rhs: &Foo) -> Foo { | |
Foo {value: self.value - rhs.value} | |
} | |
} |
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
use std::libc::{size_t, c_long, c_void}; | |
use std::vec; | |
use std::str; | |
enum CurlCode { | |
CURLE_OK = 0, | |
CURLE_UNSUPPORTED_PROTOCOL, /* 1 */ | |
CURLE_FAILED_INIT, /* 2 */ | |
CURLE_URL_MALFORMAT, /* 3 */ |
NewerOlder