fix: Extend multi-arity support to get and get-in#163
Conversation
Implement multi-arity functions for get and get-in to match the pattern introduced in PR #160. This allows LLM-generated programs to call these functions with either 2 or 3 arguments: - get(map, key) -> value or nil - get(map, key, default) -> value or default - get-in(map, path) -> nested value - get-in(map, path, default) -> value or default when path not found Updated lib/ptc_runner/lisp/env.ex to register both arities, and added comprehensive tests covering both arities plus arity error cases. Fixes #161 🤖 Generated with [Claude Code](https://claude.com/claude-code) Co-Authored-By: Claude Haiku 4.5 <noreply@anthropic.com>
PR Review: Extend multi-arity support to get and get-inSummaryStraightforward implementation that extends multi-arity support to What's Good
Issues (Must Fix)None. Suggestions (Optional)
SecurityNo concerns. The change only exposes existing, already-implemented functions. DocumentationNo updates needed. The VerdictApprove - Clean implementation following established patterns with comprehensive tests. The code change is minimal (2 lines in |
|
@claude please fix these issues from PR review: Issue 1: Add test for get with nil mapLocation:
Follow the same test pattern as the existing Please fix ALL issues above in a SINGLE commit. Make minimal changes to resolve each issue. |
Auto-Triage SummaryDecisions Made
ReasoningIssue 1 - FIX_NOW:
Issue 2 - IGNORE:
Status
|
Tests the edge case where `get` is called with a nil map: - (get nil :key) returns nil - (get nil :key "default") returns "default" This documents the behavior already implemented in Runtime.get/2 and Runtime.get/3. 🤖 Generated with [Claude Code](https://claude.com/claude-code) Co-Authored-By: Claude Haiku 4.5 <noreply@anthropic.com>
Fix CompleteIssue 1: Add test for get with nil map ✅Changes Made:
Verification:
The test documents the edge case behavior already implemented in |
PR Review: Extend multi-arity support to get and get-inSummaryClean, straightforward implementation that extends multi-arity support to What's Good
Issues (Must Fix)None. Suggestions (Optional)None. The previous review's suggestion (nil map test) was already implemented. SecurityNo concerns. The change only exposes existing DocumentationNo updates needed. VerdictApprove - The implementation is correct, follows established patterns, has comprehensive tests, and documentation is already complete. The 2-line change in |
Auto-Triage Summary (Cycle 2)Review StatusThe second review cycle found no issues or suggestions. The PR has been approved. Previous Cycle ActionsThe first review cycle identified one improvement:
Current Cycle Decisions
Status
Next Steps✅ Added |
Summary
Implement multi-arity functions for
getandget-into match the pattern introduced in PR #160. This allows LLM-generated programs to call these functions with either 2 or 3 arguments.Changes:
lib/ptc_runner/lisp/env.exlines 72-73 to use{:multi_arity, {fn/2, fn/3}}patternTest Results
✅ All 970 tests passing
✅ Format check passed
✅ Compilation with warnings-as-errors passed
✅ Credo linting passed
Fixes #161