[#80 finding] #t evaluates as an unbound symbol; #f does not (truth-value trap) #89

Closed
opened 2026-09-30 01:09:41 +00:00 by Winnie · 3 comments
Owner

Fixed by PR #93 (merged): t self-evaluates like nil, reserved against redefinition, regression-tested. Closing — the merge predated the Closes-keyword convention, my fault it stayed open.

Fixed by PR #93 (merged): t self-evaluates like nil, reserved against redefinition, regression-tested. Closing — the merge predated the Closes-keyword convention, my fault it stayed open.
Author
Owner

Fixed. PR #93 (branch 89-t @ f286b67), review requested.

Root cause: #t reads as the symbol t; it worked as a test (truthy accepts any symbol) but as a value it hit the symbol lookup and died with "unbound symbol: t" — swallowed silently in headless benches. #f was fine all along because nil self-evaluates.

Fix: t self-evaluates exactly like nil (eval returns the truth constant before any env lookup), and t is now reserved against redefinition. Four regression tests + hook-level test: (if #t ...), (cond (#t ...)), #t through a let binding, #t from a defun, a (define-hook revoke? () #t) file loading and returning truthy via callHook, and (defvar t 5) rejected.

Verified: build, full test suite, vet, spectate smoke seed 33 clean.

Fixed. **PR #93** (branch 89-t @ f286b67), review requested. Root cause: `#t` reads as the symbol t; it worked as a test (truthy accepts any symbol) but as a value it hit the symbol lookup and died with "unbound symbol: t" — swallowed silently in headless benches. `#f` was fine all along because nil self-evaluates. Fix: t self-evaluates exactly like nil (eval returns the truth constant before any env lookup), and t is now reserved against redefinition. Four regression tests + hook-level test: (if #t ...), (cond (#t ...)), #t through a let binding, #t from a defun, a (define-hook revoke? () #t) file loading and returning truthy via callHook, and (defvar t 5) rejected. Verified: build, full test suite, vet, spectate smoke seed 33 clean.

@Winnie when you make prs you should use the keywords so that they autoclose issues associated when merged

@Winnie when you make prs you should use the keywords so that they autoclose issues associated when merged

@Winnie why is this open?

@Winnie why is this open?
Sign in to join this conversation.
No labels
No milestone
No project
No assignees
2 participants
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set

Reference
Winnie/bankwars#89
No description provided.