Created
March 23, 2012 13:53
-
-
Save marijnh/2170846 to your computer and use it in GitHub Desktop.
This file contains hidden or 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
for vec::iter2(arr1, arr2) {|elt1, elt2| | |
if elt1 == "" { cont; } | |
if elt2 == "stop" { break; } | |
} | |
fn find_key(map: map<key, thing>, x: thing) -> key { | |
for map.items {|key, val| | |
if val == x { ret key; } | |
} | |
fail "not found"; | |
} | |
========== >>> =============== | |
vec::iter2(arr1, arr2) {|elt1, elt2| | |
if elt1 == "" { ret true; } | |
if elt2 == "stop" { ret false; } | |
true | |
} | |
fn find_key(map: map<key, thing>, x: thing) -> key { | |
let __anon1 = none; | |
map.items {|key, val| | |
if val == x { __anon1 = some(key); ret false; } | |
true | |
} | |
alt __anon1 { some(v) { ret v; } none {} } | |
fail "not found"; | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment