diff options
| author | Paul Buetow <paul@buetow.org> | 2026-05-24 00:37:14 +0300 |
|---|---|---|
| committer | Paul Buetow <paul@buetow.org> | 2026-05-24 00:37:14 +0300 |
| commit | f4aed5eca8148fd2064ebd5f873fff87e14a6706 (patch) | |
| tree | 4957533646b5e3416b3135514f2ad4974a5603b7 /internal/rpn/operations_stack.go | |
| parent | 2139726f4d1781b6887c6f30c26d8cc3a474761a (diff) | |
fix(rpn): correct Show comment to reflect StackValue interface usage
The Show function comment incorrectly stated it used the 'Number
interface', but it iterates over StackValue (including Float, Rat,
StringNum, and Symbol). Updated the comment to accurately describe
the types handled and how symbols/strings are displayed.
Diffstat (limited to 'internal/rpn/operations_stack.go')
| -rw-r--r-- | internal/rpn/operations_stack.go | 8 |
1 files changed, 5 insertions, 3 deletions
diff --git a/internal/rpn/operations_stack.go b/internal/rpn/operations_stack.go index e8752a6..85cd057 100644 --- a/internal/rpn/operations_stack.go +++ b/internal/rpn/operations_stack.go @@ -51,9 +51,11 @@ func (o *Operations) Pop(stack *Stack) error { return nil } -// Show returns the current stack as a formatted string using the Number interface. -// Numbers with non-Cool metrics display with the metric suffix (e.g., "100Mbps"). -// Cool numbers display as plain numbers. Booleans show as "true"/"false". +// Show returns the current stack as a formatted string. +// Each value uses its StackValue.String() method for display. +// Numeric values with non-Universal metrics append the metric suffix (e.g., "100Mbps"). +// Values with the Universal metric (Cool) display without a suffix. +// Booleans display as "true"/"false". Symbols display with a leading ":" prefix. func (o *Operations) Show(stack *Stack) (string, error) { if stack.Len() == 0 { return "Stack is empty", nil |
