summaryrefslogtreecommitdiff
path: root/internal/rpn/stack.go
AgeCommit message (Collapse)Author
2026-05-24docs(rpn): fix Values() comment — correct order from top-to-bottom to ↵Paul Buetow
bottom-to-top Values() returns slices.Clone(s.values) which preserves push order (bottom at index 0, top at last index). The existing comment contradicted both the implementation and the test documentation.
2026-05-23rpn: replace manual make+copy with slices.Clone in Stack.Values()Paul Buetow
Use slices.Clone() instead of the three-line make/copy idiom. This is more concise and correctly handles nil slices.
2026-05-23refactor: split Value and Stack types out of variables.goPaul Buetow
Per Go best practices, each file should focus on a single concern: - Created stack.go (62 lines): Stack type and methods - Moved Value type to number.go alongside Float/Rat/StringNum/Symbol - variables.go (425→296 lines): now contains only Variables, VariableInfo, four interfaces, and error variables
2026-03-26refactor: remove unused StackOperations structPaul Buetow
This struct provided stack manipulation operator implementations but was never used in the codebase. All stack operations are implemented directly in the Operations struct in operations.go.
2026-03-25Fix Ln operation and add comprehensive testsPaul Buetow
- Fixed Ln operation to handle Value conversion before math.Log using Float64() which handles boolean conversion (true → 1, false → 0) - Added TestLnWithBoolean and TestLnEdgeCases tests for comprehensive coverage - Refactored operations.go into separate files (arithmetic.go, boolean_ops.go, hyper.go, stack.go, variable.go) - Removed unused toNumber function from number.go - Added Float64() method to Value struct for boolean conversion