-
Notifications
You must be signed in to change notification settings - Fork 178
implement list skip #4524
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: master
Are you sure you want to change the base?
implement list skip #4524
Conversation
WalkthroughAdds a new public method Changes
Sequence Diagram(s)sequenceDiagram
autonumber
actor Caller
participant List as List
participant Skip as skip(index)
participant Rec as rec-skip
Caller->>List: skip(index)
activate List
List->>Skip: validate index
alt index < 0
Skip-->>Caller: error "Can't skip negative number of elements: %d"
else index == 0
Skip-->>Caller: original list
else index > 0
Skip->>Rec: rec-skip(origin, tup, index)
loop while index > 0 and elements remain
Rec->>Rec: advance origin/tup, decrement index
end
alt elements remain
Rec-->>Skip: remaining tail
else no elements
Rec-->>Skip: empty list
end
Skip-->>Caller: result list
end
deactivate List
Estimated code review effort🎯 3 (Moderate) | ⏱️ ~25 minutes Poem
📜 Recent review detailsConfiguration used: CodeRabbit UI Review profile: CHILL Plan: Pro 💡 Knowledge Base configuration:
You can enable these sources in your CodeRabbit configuration. 📒 Files selected for processing (1)
🚧 Files skipped from review as they are similar to previous changes (1)
⏰ Context from checks skipped due to timeout of 90000ms. You can increase the timeout in your CodeRabbit configuration to a maximum of 15 minutes (900000ms). (9)
✨ Finishing Touches🧪 Generate unit tests
Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. 🪧 TipsChatThere are 3 ways to chat with CodeRabbit:
SupportNeed help? Create a ticket on our support page for assistance with any issues or questions. CodeRabbit Commands (Invoked using PR/Issue comments)Type Other keywords and placeholders
CodeRabbit Configuration File (
|
🚀 Performance AnalysisAll benchmarks are within the acceptable range. No critical degradation detected (threshold is 100%). Please refer to the detailed report for more information. Click to see the detailed report
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Actionable comments posted: 1
🧹 Nitpick comments (1)
eo-runtime/src/main/eo/org/eolang/structs/list.eo (1)
269-286: Validation and zero-skip behavior look good; one nit.Logic for negative indices and idx=0 is correct. Minor: casting with
(number idx)is likely redundant sinceidxis already a number (consistent with nearby code either way).
📜 Review details
Configuration used: CodeRabbit UI
Review profile: CHILL
Plan: Pro
💡 Knowledge Base configuration:
- MCP integration is disabled by default for public repositories
- Jira integration is disabled by default for public repositories
- Linear integration is disabled by default for public repositories
You can enable these sources in your CodeRabbit configuration.
📒 Files selected for processing (1)
eo-runtime/src/main/eo/org/eolang/structs/list.eo(2 hunks)
⏰ Context from checks skipped due to timeout of 90000ms. You can increase the timeout in your CodeRabbit configuration to a maximum of 15 minutes (900000ms). (12)
- GitHub Check: Codacy Static Code Analysis
- GitHub Check: ort
- GitHub Check: trufflehog
- GitHub Check: mvn (ubuntu-24.04, 23)
- GitHub Check: ebnf
- GitHub Check: mvn (windows-2022, 23)
- GitHub Check: snippets
- GitHub Check: mvn (macos-15, 23)
- GitHub Check: mvn (ubuntu-24.04, 11)
- GitHub Check: qulice
- GitHub Check: integration
- GitHub Check: benchmark
🔇 Additional comments (1)
eo-runtime/src/main/eo/org/eolang/structs/list.eo (1)
803-909: Tests are comprehensive; will fail until rec-skip is fixed.Coverage is strong (zero, negative, ≥length, complex/nested, boundary len−1). After the fix above, these should pass.
|
@yarkivaev Hey there! 👋 I noticed your branch name " |
Summary by CodeRabbit
New Features
Tests