special-form heads are not shadowable

Found in a read/eval review: a local named like a special form wrongly took
over operator position. (let [if (fn ...)] (if true 1 2)) returned the fn, but
per spec section 3 (and the reference) special-form heads are not shadowable;
only macros are. Two fixes: drop the (not shadowed) guard on the special-form
branch of analyze-list (so an (if ...) head is always the special), and prefix
a local whose name is a Scheme keyword when emitting (so a value local legally
named if does not shadow the (if ...) the back end emits). Value-position
locals named if/or/case still work.
This commit is contained in:
Yogthos 2026-06-22 01:01:53 -04:00
parent f18ae3bd46
commit 212cd0399a
5 changed files with 106 additions and 81 deletions

File diff suppressed because one or more lines are too long