Skip to content

Front page example doesn't compile. #3773

New issue

Have a question about this project? # for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “#”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? # to your account

Closed
chrisdew opened this issue Oct 15, 2012 · 2 comments
Closed

Front page example doesn't compile. #3773

chrisdew opened this issue Oct 15, 2012 · 2 comments
Milestone

Comments

@chrisdew
Copy link

The front page example doesn't compile. http://www.rust-lang.org/

chris@chris-linux-desktop:/tmp$ rustc tmp.rs 
tmp.rs:7:30: 7:31 error: expecting '{' but found '('
tmp.rs:7                 io::print(fmt!("%s says: '%d'\n", name, *num))
chris@chris-linux-desktop:/tmp$ cat tmp.rs 
fn main() {
    for ["Alice", "Bob", "Carol"].each |name| {
        let name = copy *name;
        do task::spawn {
            let v = rand::Rng().shuffle([1, 2, 3]);
            for v.each |num| {
                io::print(fmt!("%s says: '%d'\n", name, *num))
            }
        }
    }
}
@catamorphism
Copy link
Contributor

Works for me with the 0.4 release. Is there a way we can make it clearer what version of rustc you need for the front page example? This question seems to come up a lot.

@chrisdew
Copy link
Author

When I looked at the Rust index page yesterday, the left-hand side said "Release 0.3.1", so I downloaded and compiled that version of rustc, which then failed to compile the program on the index page of the Rust website. It was not a good first experience of the language.

Works for me with the 0.4 release though.

# for free to join this conversation on GitHub. Already have an account? # to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants