On 04/01/2012 10:34 AM, Mohd. Bilal Husain wrote:
I am following the tutorial at http://doc.rust-lang.org/doc/tutorial.html

3. Section 5.2 Bind. I understand that I can option::unwrap(daynum("do")) to get back the uint.
What is the difference if I skip the bind keyword.
The llvm bitcode files that are generated w/ and w/o appear to be the name.

The bind keyword here is redundant. Any time you have a function call where one of the parameters is `_`, that's a bind. The only time that bind is currently necessary is when you want to bind all the arguments. In that case there's no way to discern that it's a bind without the keyword.

Sidenote: Is the item 'do' a joke amidst 'mo', 'tu', ... which appear to be weekdays

'do' is the German abbreviation.

4. Suggesting a few edits
a) Section 8.6 - The map functions should read
vec::map([1, 2, 3], plus1);

b) Section 11, line 8 should declare acc mutable
    let mut acc = "";

c) Similary, in section 13 Testing, the variable i must be mutable so line 7 should read
    let mut i = -100;

And again, I am feeling intimidated for posting this on dev mailing list.

Thanks. I checked in these fixes.
_______________________________________________
Rust-dev mailing list
[email protected]
https://mail.mozilla.org/listinfo/rust-dev

Reply via email to