docs: fix English docs inconsistencies#620
Conversation
- Fix `//` operator table: "int for int operands, float if either is float" → "always int" (matches actual behavior) - Fix `**` operator comments: remove "(float)" annotation (returns int for int operands) - Update `recv` → `receive` in docs/README.md network reference table - Add `-c` flag to stdin examples in README.md and docs/reference/project.md - Update here-document example to use `ry -c <<'RY'`
📝 WalkthroughWalkthroughDocumentation edits: added the Changes
Estimated code review effort🎯 2 (Simple) | ⏱️ ~10 minutes Poem
🚥 Pre-merge checks | ✅ 3✅ Passed checks (3 passed)
✏️ Tip: You can configure your own custom pre-merge checks in the settings. ✨ Finishing Touches📝 Generate docstrings
🧪 Generate unit tests (beta)
Comment |
There was a problem hiding this comment.
Pull request overview
Documentation updates to correct inconsistencies in the English docs around operator semantics and CLI usage examples (stdin execution), and to align docs with a renamed networking API.
Changes:
- Corrected stdin execution examples to use
ry -c(including here-doc usage). - Updated
//and**operator documentation to reflect actual runtime behavior. - Aligned networking docs index wording from
recvtoreceive.
Reviewed changes
Copilot reviewed 4 out of 4 changed files in this pull request and generated 1 comment.
| File | Description |
|---|---|
| README.md | Updates stdin execution examples to use ry -c, including here-doc form |
| docs/tutorial/03-operators.md | Fixes operator semantics descriptions/examples (notably // and **) |
| docs/reference/project.md | Updates CLI overview stdin example to ry -c |
| docs/README.md | Renames recv to receive in the docs index table |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
There was a problem hiding this comment.
Actionable comments posted: 2
🤖 Prompt for all review comments with AI agents
Verify each finding against the current code and only fix it if needed.
Inline comments:
In `@docs/tutorial/03-operators.md`:
- Around line 187-188: Update the documentation for the exponentiation operator
(`**`) to reflect the actual codegen behavior: note that `**` currently promotes
integer operands to f64 and emits a call to `pow`, so the result type is
float/f64 (not int for int operands). Change the example and explanatory text
around `**` (the "produces int for int operands" claim and the `print(2 ** 3)`
comment) to indicate the f64 result and mention the codegen behavior referring
to `pow`/f64 promotion.
- Line 17: The docs incorrectly state that the floor-division operator `//` is
"always int"; update the sentence describing `//` so it reflects the actual
behavior of the implementation: `//` returns an integer only when both operands
are integers, otherwise it returns a float (f64) when either operand is a float.
Edit the line showing `//` in the operators doc to mention the conditional
return type (int when both operands are int, float/f64 otherwise) and adjust the
example or explanation accordingly.
🪄 Autofix (Beta)
Fix all unresolved CodeRabbit comments on this PR:
- Push a commit to this branch (recommended)
- Create a new PR with the fixes
ℹ️ Review info
⚙️ Run configuration
Configuration used: Path: .coderabbit.yaml
Review profile: ASSERTIVE
Plan: Pro
Run ID: 97115c8b-df1b-4b1f-8bd9-0fb2ca1ebf24
📒 Files selected for processing (4)
README.mddocs/README.mddocs/reference/project.mddocs/tutorial/03-operators.md
- `//` returns float when either operand is float (not always int) - `**` always returns float (print displays without .0 for integer values)
There was a problem hiding this comment.
Actionable comments posted: 1
🤖 Prompt for all review comments with AI agents
Verify each finding against the current code and only fix it if needed.
Inline comments:
In `@docs/tutorial/03-operators.md`:
- Line 17: Update the PR description and any associated commit message to
accurately reflect the implemented behavior of the `//` operator: it returns an
int only when both operands are ints and returns a float when either operand is
a float (e.g., `7.0 // 2` → `3.0`), and ensure the PR title/summary, description
body, and changelog entry match this corrected behavior so reviewers and history
are consistent.
🪄 Autofix (Beta)
Fix all unresolved CodeRabbit comments on this PR:
- Push a commit to this branch (recommended)
- Create a new PR with the fixes
ℹ️ Review info
⚙️ Run configuration
Configuration used: Path: .coderabbit.yaml
Review profile: ASSERTIVE
Plan: Pro
Run ID: b15453fe-820e-4bcc-b22f-58e2cad0a701
📒 Files selected for processing (1)
docs/tutorial/03-operators.md
Summary
//operator description: table said "always int" but//returns float when either operand is float**operator: always returns float (print()displays integer-valued floats without.0, which was misleading)recv→receivein docs index table to match renamed API-cflag to stdin execution examples in README.md and project referencery -c <<'RY'Addresses review comments from #619.
Test plan
//and**behavior with type annotations (x: int = 7.0 // 2→ type error confirms float return)