2011-08-15 17:34:47 -05:00
|
|
|
use std;
|
2011-08-15 18:38:23 -05:00
|
|
|
import std::vec;
|
2011-08-15 17:34:47 -05:00
|
|
|
|
|
|
|
fn main() {
|
2011-08-19 17:16:48 -05:00
|
|
|
let v =
|
2011-09-12 04:27:30 -05:00
|
|
|
std::vec::map2({|i, b| if b { -i } else { i } }, [1, 2, 3, 4, 5],
|
2011-08-19 17:16:48 -05:00
|
|
|
[true, false, false, true, true]);
|
2011-08-15 17:34:47 -05:00
|
|
|
log_err v;
|
2011-08-19 17:16:48 -05:00
|
|
|
assert (v == [-1, 2, 3, -4, -5]);
|
2011-08-15 17:34:47 -05:00
|
|
|
}
|