2011-08-15 17:34:47 -05:00
|
|
|
use std;
|
2011-12-13 18:25:51 -06:00
|
|
|
import vec;
|
2011-08-15 17:34:47 -05:00
|
|
|
|
|
|
|
fn main() {
|
2011-08-19 17:16:48 -05:00
|
|
|
let v =
|
2011-12-16 08:27:50 -06:00
|
|
|
vec::map2([1, 2, 3, 4, 5],
|
|
|
|
[true, false, false, true, true],
|
|
|
|
{|i, b| if b { -i } else { i } });
|
2011-12-22 16:42:52 -06:00
|
|
|
log_full(core::error, v);
|
2011-08-19 17:16:48 -05:00
|
|
|
assert (v == [-1, 2, 3, -4, -5]);
|
2011-08-15 17:34:47 -05:00
|
|
|
}
|