Skip to content

Instantly share code, notes, and snippets.

View killballad's full-sized avatar

FRAU KOUJIRO killballad

View GitHub Profile
macro_rules! glcheck(
($e:expr) => (
let result = $e;
let err = gl::get_error();
if (err != gl::NO_ERROR) {
fail!(gl_error_to_str(err));
}
result
)
)
fn new_foo(a: &Path) -> Result<~Foo, ~str> {
// any way to flatten this?
do read_whole_file(a).map_move |b| {
do frob(b).map_move |c| {
do baz(c).map_move |d| {
~Foo { bar: d }
}
}
}
}