From 78f8b5170af78eca63ca4a5e949128e4b29353cc Mon Sep 17 00:00:00 2001 From: Paul Buetow Date: Sat, 11 Apr 2026 22:35:14 +0300 Subject: docs: clarify relationship between 'clear' and 'clearconstants' in README.md --- README.md | 10 ++++++---- 1 file changed, 6 insertions(+), 4 deletions(-) diff --git a/README.md b/README.md index c7e6b69..e45c9f9 100644 --- a/README.md +++ b/README.md @@ -185,14 +185,16 @@ gt 'clearconstants' # Clear user-defined constants # All constants cleared ``` -Built-in constants cannot be deleted individually, but you can list them and clear variables that might override them: +**Note:** `clearconstants` only clears user-defined constants. To clear all variables (which may include variables overriding built-in constants), use `clear`. + +Built-in constants cannot be deleted individually, but you can list variables and clear them to restore access to the original constants: ```bash gt 'vars' # List all variables (not constants) # x = 5 -# To access constants again after overriding them: -gt 'clear' # Clear all variables +# To access constants again after overriding them with variables: +gt 'clear' # Clear all variables (restores built-in constants) gt 'pi' # Now returns the constant π # → 3.141592654 ``` @@ -204,7 +206,7 @@ gt 'vars' # List all variables gt 'delete x' # Delete a specific variable # Variable removed -gt 'clear' # Clear all variables +gt 'clear' # Clear all variables (also restores overridden built-in constants) # All variables cleared ``` -- cgit v1.2.3