From fe70361bb6d89a6226d558c64c03d05bba46412b Mon Sep 17 00:00:00 2001 From: Steve Klabnik Date: Sun, 2 Jun 2013 20:46:12 -0700 Subject: [PATCH] Add better documentation for the Prelude. --- src/libstd/prelude.rs | 19 ++++++++++++++++++- 1 file changed, 18 insertions(+), 1 deletion(-) diff --git a/src/libstd/prelude.rs b/src/libstd/prelude.rs index 5a5efa0781ae9..bd1c87daf134e 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};