diff options
| author | Paul Buetow <paul@buetow.org> | 2026-05-24 13:47:39 +0300 |
|---|---|---|
| committer | Paul Buetow <paul@buetow.org> | 2026-05-24 13:47:39 +0300 |
| commit | edef5bf414f60704f2a18c0d41d4464f2fd7d2c0 (patch) | |
| tree | a40836e4b2e01f1b3d4e5b24a536e54b77525830 /internal/rpn/operations.go | |
| parent | fe811682d952e5322a5bc3c5e0bddfe8074b4cf9 (diff) | |
refactor(rpn): split ArithmeticOperator into 3 interfaces (task 9j)
The ArithmeticOperator interface bundled basic arithmetic (+, -, *, /, ^, %),
logarithmic operations (Log2, Log10, Ln), and metric conversion (Convert) into
a single interface, violating ISP and LSP.
Split into:
- ArithmeticOperator — Add, Subtract, Multiply, Divide, Power, Modulo
- LogarithmicOperator — Log2, Log10, Ln
- MetricOperator — Convert
Updated compile-time interface checks in operations.go and the trailing
comment in operations_interfaces.go. No behavioral change.
Diffstat (limited to 'internal/rpn/operations.go')
| -rw-r--r-- | internal/rpn/operations.go | 6 |
1 files changed, 4 insertions, 2 deletions
diff --git a/internal/rpn/operations.go b/internal/rpn/operations.go index a3d660c..ca57a42 100644 --- a/internal/rpn/operations.go +++ b/internal/rpn/operations.go @@ -19,8 +19,10 @@ type Operations struct { // Ensure Operations implements all operator sub-interfaces at compile time. var ( - _ ArithmeticOperator = (*Operations)(nil) - _ BooleanOperator = (*Operations)(nil) + _ ArithmeticOperator = (*Operations)(nil) + _ LogarithmicOperator = (*Operations)(nil) + _ MetricOperator = (*Operations)(nil) + _ BooleanOperator = (*Operations)(nil) _ HyperOperator = (*Operations)(nil) _ StackOperator = (*Operations)(nil) _ VariableOperator = (*Operations)(nil) |
