Skip to content

New array syntax pt2 #20387

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

Merged
merged 5 commits into from
Jan 2, 2015
Merged

New array syntax pt2 #20387

merged 5 commits into from
Jan 2, 2015

Conversation

nrc
Copy link
Member

@nrc nrc commented Jan 1, 2015

Closes #19999

@rust-highfive
Copy link
Contributor

r? @alexcrichton

(rust_highfive has picked a reviewer for you, use r? to override)

```

There's a shorthand for initializing each element of an array to the same
value. In this example, each element of `a` will be initialized to `0i`:

```{rust}
let a = [0i, ..20]; // a: [int, ..20]
let a = [0i; 20]; // a: [int; 20]
```

Arrays have type `[T,..N]`. We'll talk about this `T` notation later, when we
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think this line also needs to be updated

@alexcrichton
Copy link
Member

Nice! Just one little nit and otherwise r=me

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

Successfully merging this pull request may close these issues.

Tracking issue for RFC 520: change fixed length array syntax
5 participants