diff options
| author | bors <bors@rust-lang.org> | 2013-06-03 14:37:39 -0700 |
|---|---|---|
| committer | bors <bors@rust-lang.org> | 2013-06-03 14:37:39 -0700 |
| commit | 846545a6e19745dddcbefb1e690a63eea15a0884 (patch) | |
| tree | d2f82ac2fe5a601eace5c5d21ebca56ef6741a51 /src/libstd | |
| parent | 8a43b318bf30c26f4e9f3557b6c7036fcb9d5342 (diff) | |
| parent | fe70361bb6d89a6226d558c64c03d05bba46412b (diff) | |
| download | rust-846545a6e19745dddcbefb1e690a63eea15a0884.tar.gz rust-846545a6e19745dddcbefb1e690a63eea15a0884.zip | |
auto merge of #6907 : steveklabnik/rust/prelude_docs, r=graydon
Diffstat (limited to 'src/libstd')
| -rw-r--r-- | src/libstd/prelude.rs | 19 |
1 files changed, 18 insertions, 1 deletions
diff --git a/src/libstd/prelude.rs b/src/libstd/prelude.rs index b883f752e3c..ab8a699a502 100644 --- a/src/libstd/prelude.rs +++ b/src/libstd/prelude.rs @@ -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}; |
