From f4aed5eca8148fd2064ebd5f873fff87e14a6706 Mon Sep 17 00:00:00 2001 From: Paul Buetow Date: Sun, 24 May 2026 00:37:14 +0300 Subject: 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. --- internal/rpn/operations_stack.go | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) (limited to 'internal/rpn/operations_stack.go') 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 -- cgit v1.2.3