diff options
| author | bors <bors@rust-lang.org> | 2013-06-08 10:25:15 -0700 |
|---|---|---|
| committer | bors <bors@rust-lang.org> | 2013-06-08 10:25:15 -0700 |
| commit | b8fa9d3be10e952fbcaf14f3098aebf13dedd7ec (patch) | |
| tree | f99d1c8374844ccf7a3368110d3e33c0e51f18bb /doc/tutorial-tasks.md | |
| parent | e2ec8e71cec0373616953f8188cf7c4953269af0 (diff) | |
| parent | 98ba91f81bea38d8fc8bd5bc0cb44ac3e173a53c (diff) | |
| download | rust-b8fa9d3be10e952fbcaf14f3098aebf13dedd7ec.tar.gz rust-b8fa9d3be10e952fbcaf14f3098aebf13dedd7ec.zip | |
auto merge of #7015 : huonw/rust/each-fn-kill, r=thestinger
Continuation of #6995/#6999.
Diffstat (limited to 'doc/tutorial-tasks.md')
| -rw-r--r-- | doc/tutorial-tasks.md | 3 |
1 files changed, 2 insertions, 1 deletions
diff --git a/doc/tutorial-tasks.md b/doc/tutorial-tasks.md index 2f150755fc2..892908dc0a0 100644 --- a/doc/tutorial-tasks.md +++ b/doc/tutorial-tasks.md @@ -351,10 +351,11 @@ a single large vector of floats. Each task needs the full vector to perform its # use std::vec; # use std::uint; # use std::rand; +# use std::iterator::IteratorUtil; use extra::arc::ARC; fn pnorm(nums: &~[float], p: uint) -> float { - (vec::foldl(0.0, *nums, |a,b| a+(*b).pow(p as float) )).pow(1f / (p as float)) + nums.iter().fold(0.0, |a,b| a+(*b).pow(p as float) ).pow(1f / (p as float)) } fn main() { |
