iter pairs() -> tup(int,int) { let int i = 0; let int j = 0; while (i < 10) { put tup(i, j); i += 1; j += i; } } fn main() { let int i = 10; let int j = 0; for each (tup(int,int) p in pairs()) { log p._0; log p._1; check (p._0 + 10 == i); i += 1; j = p._1; } check(j == 45); } iter pairs() -> tup(int,int) { let int i = 0; let int j = 0; while (i < 10) { put tup(i, j); i += 1; j += i; } } fn main() { let int i = 10; let int j = 0; for each (tup(int,int) p in pairs()) { log p._0; log p._1; assert (p._0 + 10 == i); i += 1; j = p._1; } assert (j == 45); } iter pairs() -> tup(int,int) { let int i = 0; let int j = 0; while (i < 10) { put tup(i, j); i += 1; j += i; } } fn main() { let int i = 10; let int j = 0; for each (tup(int,int) p in pairs()) { log p._0; log p._1; check (p._0 + 10 == i); i += 1; j = p._1; } check(j == 45); } iter pairs() -> tup(int,int) { let int i = 0; let int j = 0; while (i < 10) { put tup(i, j); i += 1; j += i; } } fn main() { let int i = 10; let int j = 0; for each (tup(int,int) p in pairs()) { log p._0; log p._1; assert (p._0 + 10 == i); i += 1; j = p._1; } assert (j == 45); } iter pairs() -> tup(int, int) { let int i = 0; let int j = 0; while (i < 10) { put tup(i, j); i += 1; j += i; } } fn main() { let int i = 10; let int j = 0; for each (tup(int, int) p in pairs()) { log p._0; log p._1; assert (p._0 + 10 == i); i += 1; j = p._1; } assert (j == 45); } iter pairs() -> rec(int _0, int _1) { let int i = 0; let int j = 0; while (i < 10) { put rec(_0=i, _1=j); i += 1; j += i; } } fn main() { let int i = 10; let int j = 0; for each (rec(int _0, int _1) p in pairs()) { log p._0; log p._1; assert (p._0 + 10 == i); i += 1; j = p._1; } assert (j == 45); } iter pairs() -> {_0: int, _1: int} { let i: int = 0; let j: int = 0; while i < 10 { put {_0: i, _1: j}; i += 1; j += i; } } fn main() { let i: int = 10; let j: int = 0; for each p: {_0: int, _1: int} in pairs() { log p._0; log p._1; assert (p._0 + 10 == i); i += 1; j = p._1; } assert (j == 45); } iter pairs() -> {_0: int, _1: int} { let i: int = 0; let j: int = 0; while i < 10 { put {_0: i, _1: j}; i += 1; j += i; } } fn main() { let i: int = 10; let j: int = 0; for each p: {_0: int, _1: int} in pairs() { log p._0; log p._1; assert (p._0 + 10 == i); i += 1; j = p._1; } assert (j == 45); } fn pairs(it: block((int, int))) { let i: int = 0; let j: int = 0; while i < 10 { it((i, j)); i += 1; j += i; } } fn main() { let i: int = 10; let j: int = 0; pairs() {|p| let (_0, _1) = p; log _0; log _1; assert (_0 + 10 == i); i += 1; j = _1; }; assert (j == 45); } fn pairs(it: block((int, int))) { let i: int = 0; let j: int = 0; while i < 10 { it((i, j)); i += 1; j += i; } } fn main() { let i: int = 10; let j: int = 0; pairs() {|p| let (_0, _1) = p; log_full(core::debug, _0); log_full(core::debug, _1); assert (_0 + 10 == i); i += 1; j = _1; }; assert (j == 45); } fn pairs(it: block((int, int))) { let i: int = 0; let j: int = 0; while i < 10 { it((i, j)); i += 1; j += i; } } fn main() { let i: int = 10; let j: int = 0; pairs() {|p| let (_0, _1) = p; log(debug, _0); log(debug, _1); assert (_0 + 10 == i); i += 1; j = _1; }; assert (j == 45); } fn pairs(it: fn((int, int))) { let i: int = 0; let j: int = 0; while i < 10 { it((i, j)); i += 1; j += i; } } fn main() { let i: int = 10; let j: int = 0; pairs() {|p| let (_0, _1) = p; log(debug, _0); log(debug, _1); assert (_0 + 10 == i); i += 1; j = _1; }; assert (j == 45); } fn pairs(it: fn((int, int))) { let mut i: int = 0; let mut j: int = 0; while i < 10 { it((i, j)); i += 1; j += i; } } fn main() { let mut i: int = 10; let mut j: int = 0; pairs() {|p| let (_0, _1) = p; log(debug, _0); log(debug, _1); assert (_0 + 10 == i); i += 1; j = _1; }; assert (j == 45); } fn pairs(it: fn((int, int))) { let mut i: int = 0; let mut j: int = 0; while i < 10 { it((i, j)); i += 1; j += i; } } fn main() { let mut i: int = 10; let mut j: int = 0; do pairs() {|p| let (_0, _1) = p; log(debug, _0); log(debug, _1); assert (_0 + 10 == i); i += 1; j = _1; }; assert (j == 45); } fn pairs(it: fn((int, int))) { let mut i: int = 0; let mut j: int = 0; while i < 10 { it((i, j)); i += 1; j += i; } } fn main() { let mut i: int = 10; let mut j: int = 0; do pairs() |p| { let (_0, _1) = p; log(debug, _0); log(debug, _1); assert (_0 + 10 == i); i += 1; j = _1; }; assert (j == 45); } // Copyright 2012 The Rust Project Developers. See the COPYRIGHT // file at the top-level directory of this distribution and at // http://rust-lang.org/COPYRIGHT. // // Licensed under the Apache License, Version 2.0 <LICENSE-APACHE or // http://www.apache.org/licenses/LICENSE-2.0> or the MIT license // <LICENSE-MIT or http://opensource.org/licenses/MIT>, at your // option. This file may not be copied, modified, or distributed // except according to those terms. fn pairs(it: fn((int, int))) { let mut i: int = 0; let mut j: int = 0; while i < 10 { it((i, j)); i += 1; j += i; } } fn main() { let mut i: int = 10; let mut j: int = 0; do pairs() |p| { let (_0, _1) = p; log(debug, _0); log(debug, _1); assert (_0 + 10 == i); i += 1; j = _1; }; assert (j == 45); } // Copyright 2012 The Rust Project Developers. See the COPYRIGHT // file at the top-level directory of this distribution and at // http://rust-lang.org/COPYRIGHT. // // Licensed under the Apache License, Version 2.0 <LICENSE-APACHE or // http://www.apache.org/licenses/LICENSE-2.0> or the MIT license // <LICENSE-MIT or http://opensource.org/licenses/MIT>, at your // option. This file may not be copied, modified, or distributed // except according to those terms. fn pairs(it: fn((int, int))) { let mut i: int = 0; let mut j: int = 0; while i < 10 { it((i, j)); i += 1; j += i; } } pub fn main() { let mut i: int = 10; let mut j: int = 0; do pairs() |p| { let (_0, _1) = p; log(debug, _0); log(debug, _1); assert (_0 + 10 == i); i += 1; j = _1; }; assert (j == 45); } // Copyright 2012 The Rust Project Developers. See the COPYRIGHT // file at the top-level directory of this distribution and at // http://rust-lang.org/COPYRIGHT. // // Licensed under the Apache License, Version 2.0 <LICENSE-APACHE or // http://www.apache.org/licenses/LICENSE-2.0> or the MIT license // <LICENSE-MIT or http://opensource.org/licenses/MIT>, at your // option. This file may not be copied, modified, or distributed // except according to those terms. fn pairs(it: fn((int, int))) { let mut i: int = 0; let mut j: int = 0; while i < 10 { it((i, j)); i += 1; j += i; } } pub fn main() { let mut i: int = 10; let mut j: int = 0; do pairs() |p| { let (_0, _1) = p; log(debug, _0); log(debug, _1); fail_unless!((_0 + 10 == i)); i += 1; j = _1; }; fail_unless!((j == 45)); } // Copyright 2012 The Rust Project Developers. See the COPYRIGHT // file at the top-level directory of this distribution and at // http://rust-lang.org/COPYRIGHT. // // Licensed under the Apache License, Version 2.0 <LICENSE-APACHE or // http://www.apache.org/licenses/LICENSE-2.0> or the MIT license // <LICENSE-MIT or http://opensource.org/licenses/MIT>, at your // option. This file may not be copied, modified, or distributed // except according to those terms. fn pairs(it: &fn((int, int))) { let mut i: int = 0; let mut j: int = 0; while i < 10 { it((i, j)); i += 1; j += i; } } pub fn main() { let mut i: int = 10; let mut j: int = 0; do pairs() |p| { let (_0, _1) = p; log(debug, _0); log(debug, _1); fail_unless!((_0 + 10 == i)); i += 1; j = _1; }; fail_unless!((j == 45)); } // Copyright 2012 The Rust Project Developers. See the COPYRIGHT // file at the top-level directory of this distribution and at // http://rust-lang.org/COPYRIGHT. // // Licensed under the Apache License, Version 2.0 <LICENSE-APACHE or // http://www.apache.org/licenses/LICENSE-2.0> or the MIT license // <LICENSE-MIT or http://opensource.org/licenses/MIT>, at your // option. This file may not be copied, modified, or distributed // except according to those terms. fn pairs(it: &fn((int, int))) { let mut i: int = 0; let mut j: int = 0; while i < 10 { it((i, j)); i += 1; j += i; } } pub fn main() { let mut i: int = 10; let mut j: int = 0; do pairs() |p| { let (_0, _1) = p; debug!(_0); debug!(_1); fail_unless!((_0 + 10 == i)); i += 1; j = _1; }; fail_unless!((j == 45)); } // Copyright 2012 The Rust Project Developers. See the COPYRIGHT // file at the top-level directory of this distribution and at // http://rust-lang.org/COPYRIGHT. // // Licensed under the Apache License, Version 2.0 <LICENSE-APACHE or // http://www.apache.org/licenses/LICENSE-2.0> or the MIT license // <LICENSE-MIT or http://opensource.org/licenses/MIT>, at your // option. This file may not be copied, modified, or distributed // except according to those terms. fn pairs(it: &fn((int, int))) { let mut i: int = 0; let mut j: int = 0; while i < 10 { it((i, j)); i += 1; j += i; } } pub fn main() { let mut i: int = 10; let mut j: int = 0; do pairs() |p| { let (_0, _1) = p; debug!(_0); debug!(_1); assert!((_0 + 10 == i)); i += 1; j = _1; }; assert!((j == 45)); } // Copyright 2012 The Rust Project Developers. See the COPYRIGHT // file at the top-level directory of this distribution and at // http://rust-lang.org/COPYRIGHT. // // Licensed under the Apache License, Version 2.0 <LICENSE-APACHE or // http://www.apache.org/licenses/LICENSE-2.0> or the MIT license // <LICENSE-MIT or http://opensource.org/licenses/MIT>, at your // option. This file may not be copied, modified, or distributed // except according to those terms. fn pairs(it: &fn((int, int))) { let mut i: int = 0; let mut j: int = 0; while i < 10 { it((i, j)); i += 1; j += i; } } pub fn main() { let mut i: int = 10; let mut j: int = 0; do pairs() |p| { let (_0, _1) = p; debug!(_0); debug!(_1); assert_eq!(_0 + 10, i); i += 1; j = _1; }; assert_eq!(j, 45); } // Copyright 2012 The Rust Project Developers. See the COPYRIGHT // file at the top-level directory of this distribution and at // http://rust-lang.org/COPYRIGHT. // // Licensed under the Apache License, Version 2.0 <LICENSE-APACHE or // http://www.apache.org/licenses/LICENSE-2.0> or the MIT license // <LICENSE-MIT or http://opensource.org/licenses/MIT>, at your // option. This file may not be copied, modified, or distributed // except according to those terms. fn pairs(it: &fn((int, int))) { let mut i: int = 0; let mut j: int = 0; while i < 10 { it((i, j)); i += 1; j += i; } } pub fn main() { let mut i: int = 10; let mut j: int = 0; do pairs() |p| { let (_0, _1) = p; info!(_0); info!(_1); assert_eq!(_0 + 10, i); i += 1; j = _1; }; assert_eq!(j, 45); } // Copyright 2012 The Rust Project Developers. See the COPYRIGHT // file at the top-level directory of this distribution and at // http://rust-lang.org/COPYRIGHT. // // Licensed under the Apache License, Version 2.0 <LICENSE-APACHE or // http://www.apache.org/licenses/LICENSE-2.0> or the MIT license // <LICENSE-MIT or http://opensource.org/licenses/MIT>, at your // option. This file may not be copied, modified, or distributed // except according to those terms. fn pairs(it: &fn((int, int))) { let mut i: int = 0; let mut j: int = 0; while i < 10 { it((i, j)); i += 1; j += i; } } pub fn main() { let mut i: int = 10; let mut j: int = 0; do pairs() |p| { let (_0, _1) = p; info2!("{}", _0); info2!("{}", _1); assert_eq!(_0 + 10, i); i += 1; j = _1; }; assert_eq!(j, 45); } // Copyright 2012 The Rust Project Developers. See the COPYRIGHT // file at the top-level directory of this distribution and at // http://rust-lang.org/COPYRIGHT. // // Licensed under the Apache License, Version 2.0 <LICENSE-APACHE or // http://www.apache.org/licenses/LICENSE-2.0> or the MIT license // <LICENSE-MIT or http://opensource.org/licenses/MIT>, at your // option. This file may not be copied, modified, or distributed // except according to those terms. fn pairs(it: &fn((int, int))) { let mut i: int = 0; let mut j: int = 0; while i < 10 { it((i, j)); i += 1; j += i; } } pub fn main() { let mut i: int = 10; let mut j: int = 0; do pairs() |p| { let (_0, _1) = p; info!("{}", _0); info!("{}", _1); assert_eq!(_0 + 10, i); i += 1; j = _1; }; assert_eq!(j, 45); } // Copyright 2012 The Rust Project Developers. See the COPYRIGHT // file at the top-level directory of this distribution and at // http://rust-lang.org/COPYRIGHT. // // Licensed under the Apache License, Version 2.0 <LICENSE-APACHE or // http://www.apache.org/licenses/LICENSE-2.0> or the MIT license // <LICENSE-MIT or http://opensource.org/licenses/MIT>, at your // option. This file may not be copied, modified, or distributed // except according to those terms. fn pairs(it: |(int, int)|) { let mut i: int = 0; let mut j: int = 0; while i < 10 { it((i, j)); i += 1; j += i; } } pub fn main() { let mut i: int = 10; let mut j: int = 0; do pairs() |p| { let (_0, _1) = p; info!("{}", _0); info!("{}", _1); assert_eq!(_0 + 10, i); i += 1; j = _1; }; assert_eq!(j, 45); } // Copyright 2012 The Rust Project Developers. See the COPYRIGHT // file at the top-level directory of this distribution and at // http://rust-lang.org/COPYRIGHT. // // Licensed under the Apache License, Version 2.0 <LICENSE-APACHE or // http://www.apache.org/licenses/LICENSE-2.0> or the MIT license // <LICENSE-MIT or http://opensource.org/licenses/MIT>, at your // option. This file may not be copied, modified, or distributed // except according to those terms. fn pairs(it: |(int, int)|) { let mut i: int = 0; let mut j: int = 0; while i < 10 { it((i, j)); i += 1; j += i; } } pub fn main() { let mut i: int = 10; let mut j: int = 0; pairs(|p| { let (_0, _1) = p; info!("{}", _0); info!("{}", _1); assert_eq!(_0 + 10, i); i += 1; j = _1; }); assert_eq!(j, 45); } // Copyright 2012 The Rust Project Developers. See the COPYRIGHT // file at the top-level directory of this distribution and at // http://rust-lang.org/COPYRIGHT. // // Licensed under the Apache License, Version 2.0 <LICENSE-APACHE or // http://www.apache.org/licenses/LICENSE-2.0> or the MIT license // <LICENSE-MIT or http://opensource.org/licenses/MIT>, at your // option. This file may not be copied, modified, or distributed // except according to those terms. fn pairs(it: |(int, int)|) { let mut i: int = 0; let mut j: int = 0; while i < 10 { it((i, j)); i += 1; j += i; } } pub fn main() { let mut i: int = 10; let mut j: int = 0; pairs(|p| { let (_0, _1) = p; println!("{}", _0); println!("{}", _1); assert_eq!(_0 + 10, i); i += 1; j = _1; }); assert_eq!(j, 45); } // Copyright 2012 The Rust Project Developers. See the COPYRIGHT // file at the top-level directory of this distribution and at // http://rust-lang.org/COPYRIGHT. // // Licensed under the Apache License, Version 2.0 <LICENSE-APACHE or // http://www.apache.org/licenses/LICENSE-2.0> or the MIT license // <LICENSE-MIT or http://opensource.org/licenses/MIT>, at your // option. This file may not be copied, modified, or distributed // except according to those terms. fn pairs<F>(mut it: F) where F: FnMut((int, int)) { let mut i: int = 0; let mut j: int = 0; while i < 10 { it((i, j)); i += 1; j += i; } } pub fn main() { let mut i: int = 10; let mut j: int = 0; pairs(|p| { let (_0, _1) = p; println!("{}", _0); println!("{}", _1); assert_eq!(_0 + 10, i); i += 1; j = _1; }); assert_eq!(j, 45); } // Copyright 2012 The Rust Project Developers. See the COPYRIGHT // file at the top-level directory of this distribution and at // http://rust-lang.org/COPYRIGHT. // // Licensed under the Apache License, Version 2.0 <LICENSE-APACHE or // http://www.apache.org/licenses/LICENSE-2.0> or the MIT license // <LICENSE-MIT or http://opensource.org/licenses/MIT>, at your // option. This file may not be copied, modified, or distributed // except according to those terms. fn pairs<F>(mut it: F) where F: FnMut((isize, isize)) { let mut i: isize = 0; let mut j: isize = 0; while i < 10 { it((i, j)); i += 1; j += i; } } pub fn main() { let mut i: isize = 10; let mut j: isize = 0; pairs(|p| { let (_0, _1) = p; println!("{}", _0); println!("{}", _1); assert_eq!(_0 + 10, i); i += 1; j = _1; }); assert_eq!(j, 45); }