read a quoted name as the name

'-fields read as (- fields), so (cat name '-fields) built name(- fields).
A quoted list keeps the rule: it is code a macro returns as often as not.
This commit is contained in:
2026-10-19 14:48:43 +03:00
parent e16e53cd7c
commit df7e4e69e8
2 changed files with 17 additions and 2 deletions

View File

@@ -60,6 +60,10 @@
(reader-test '((- _x)) "-_x")
(reader-test '(-1 -1.5) "-1 -1.5")
(reader-test '(- -> ->> -- -=) "- -> ->> -- -=")
;; ...but a quoted name is a name: (cat name '-fields) built `name(- fields)'
(reader-test '((quote -fields)) "'-fields")
;; while a quoted list is code a macro hands back as often as not
(reader-test '((quote ((- a) b))) "'(-a b)")
;; a number in another radix, spelled the way C does or the way
;; Scheme does; either is an ordinary integer from here on