Skip to content

Commit

Permalink
Add better documentation for the Prelude.
Browse files Browse the repository at this point in the history
  • Loading branch information
steveklabnik committed Jun 3, 2013
1 parent c40baf6 commit fe70361
Showing 1 changed file with 18 additions and 1 deletion.
19 changes: 18 additions & 1 deletion src/libstd/prelude.rs
Expand Up @@ -8,7 +8,24 @@
// option. This file may not be copied, modified, or distributed
// except according to those terms.

//! The Rust prelude. Imported into every module by default.
/*!
Many programming languages have a 'prelude': a particular subset of the
libraries that come with the language. Every program imports the prelude by
default.
For example, it would be annoying to add `use io::println;` to every single
program, and the vast majority of Rust programs will wish to print to standard
output. Therefore, it makes sense to import it into every program.
Rust's prelude has three main parts:
1. io::print and io::println.
2. Core operators, such as `Add`, `Mul`, and `Not`.
3. Various types and traits, such as `Clone`, `Eq`, and `comm::Chan`.
*/


// Reexported core operators
pub use either::{Either, Left, Right};
Expand Down

5 comments on commit fe70361

@bors
Copy link
Contributor

@bors bors commented on fe70361 Jun 3, 2013

Choose a reason for hiding this comment

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

saw approval from graydon
at steveklabnik@fe70361

@bors
Copy link
Contributor

@bors bors commented on fe70361 Jun 3, 2013

Choose a reason for hiding this comment

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

merging steveklabnik/rust/prelude_docs = fe70361 into auto

@bors
Copy link
Contributor

@bors bors commented on fe70361 Jun 3, 2013

Choose a reason for hiding this comment

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

steveklabnik/rust/prelude_docs = fe70361 merged ok, testing candidate = 846545a

@bors
Copy link
Contributor

@bors bors commented on fe70361 Jun 3, 2013

Choose a reason for hiding this comment

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

@bors
Copy link
Contributor

@bors bors commented on fe70361 Jun 3, 2013

Choose a reason for hiding this comment

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

fast-forwarding incoming to auto = 846545a

Please sign in to comment.