Skip to content

Instantly share code, notes, and snippets.

@spider-mario
spider-mario / for_bool.rs
Created Jun 3, 2013
error: expected `for` closure to return `bool`, but found `bool`
View for_bool.rs
fn limited_while(nmax: uint, condition: &fn() -> bool, body: &fn() -> bool) {
for nmax.times {
if (!(condition() && body())) {
break
}
}
}
macro_rules! limited_while(
($condition: expr, nmax: $nmax: expr) => (
You can’t perform that action at this time.