diff --git a/Examples.md b/Examples.md index 30a634d..6f47cfc 100644 --- a/Examples.md +++ b/Examples.md @@ -910,7 +910,7 @@ fn main #### for loops -This subsection introduces the three ways of converting collections into iterators. For convenience, we combine them into a single example here. Note that Husht will provide three different prepositions for looping as syntactic sugar for the three methods of obtaining an iterator from the collection. The proposal below uses `in` as Rust does, `from` for borrowing, and `on` for borrowing mutably. We should also consider `in`, `&in`, and `&mut in`, as that might be more Rust-y. +This subsection introduces the three ways of converting collections into iterators. For convenience, we combine them into a single example here. Note that in Husht you can select the mode of conversion by decorating the looping preposition `in`. @@ -958,7 +958,7 @@ fn main() { fn main let mut names = vec!["Bob", "Frank", "Ferris"] - for name from names + for name &in names match name &"Ferris" => println! "Rustacean alert!" _ => println! "Hello {}", name @@ -967,7 +967,7 @@ fn main - for name on names + for name &mut in names *name = match name &mut "Ferris" => "Rustacean alert!" _ => "Hello"