docs: expand prelude documentation#9710
Conversation
|
Codex usage limits have been reached for code reviews. Please check with the admins of this repo to increase the limits by adding credits. |
orizi
left a comment
There was a problem hiding this comment.
@orizi made 3 comments.
Reviewable status: 0 of 1 files reviewed, 3 unresolved discussions (waiting on Princetimix69).
docs/reference/src/components/cairo/modules/language_constructs/pages/prelude.adoc line 12 at r1 (raw file):
which is why you can use types like `Option`, `Result`, and common traits without importing them. == Items Included in the Prelude
not sure this is actually interesting - just pointing at the files sounds more reasonable.
docs/reference/src/components/cairo/modules/language_constructs/pages/prelude.adoc line 14 at r1 (raw file):
== Items Included in the Prelude The prelude includes commonly used types, traits, and functions that are essential for Cairo programming.
limit lines to 100 chars.
docs/reference/src/components/cairo/modules/language_constructs/pages/prelude.adoc line 19 at r1 (raw file):
=== Basic Types * `bool` — Boolean type
finish all sentences with ..
PR SummaryLow Risk Overview Adds a Prelude Source Files section that points readers to Reviewed by Cursor Bugbot for commit 2ef8f78. Bugbot is set up for automated code reviews on this repo. Configure here. |
|
@orizi Done. |
orizi
left a comment
There was a problem hiding this comment.
@orizi made 1 comment and resolved 1 discussion.
Reviewable status: 0 of 1 files reviewed, 3 unresolved discussions (waiting on Princetimix69).
docs/reference/src/components/cairo/modules/language_constructs/pages/prelude.adoc line 25 at r2 (raw file):
Each successive prelude is more conservative, exporting only the most commonly needed items. == Prelude Source Files
if you do it - make as links - note other instances in the adoc files.
Summary
Expands the prelude documentation by adding a comprehensive list of all items automatically imported from the standard library prelude, organized by category, with usage examples.
Type of change
Please check one:
Why is this change needed?
The previous prelude documentation was only 10 lines and explained what a prelude is, but did not list which items are actually included. This left users unclear about what types, traits, and functions are automatically available without explicit imports.
For a reference documentation page, listing the complete contents of the prelude is essential information that users need to look up regularly.
What was the behavior or documentation before?
The documentation only contained:
core::prelude::v2024_07)OptionandResultare available without importsIt did not list which specific items are included or provide usage examples.
What is the behavior or documentation after?
The expanded documentation now includes:
Complete item listing organized by category:
Usage examples showing how prelude items work without explicit imports
Explicit imports section explaining that items can still be imported explicitly if desired
Edition-specific preludes explaining the version-based prelude system
All items listed are verified against
corelib/src/prelude/v2024_07.cairo.Related issue or discussion (if any)
This follows the same pattern as PR #9627 (panic documentation expansion), #9626 (integer types), #9612 (boolean types),and #9615 (felt252 type) - expanding thin reference documentation to provide complete,
useful information.
Additional context
This change is important because: