If you enter the new syntax at a Lisp listener, the reader would return a list of numbers. Evaluating this list of numbers would be an error, since Lisp expects a function or macro as the head of a list. Lists are not evaluating to themselves, as vectors, numbers, hash tables, ... are.
Thus you have two choices:
- have the user write a quote in front of the interval expression to prevent evaluation
- return a quoted list
Here we see choice 2.
CL-USER 7 > (read-from-string "#[5 10]")
(QUOTE (5 6 7 8 9 10))
CL-USER 8 > (eval (read-from-string "#[5 10]"))
(5 6 7 8 9 10)
CL-USER 9 > (let ((e #[5 10]))
(describe e))
(5 6 7 8 9 10) is a LIST
0 5
1 6
2 7
3 8
4 9
5 10
If the reader macro would not return a quote list form, we would have to write:
CL-USER 10 > (let ((e '#[5 10])) ; notice the QUOTE
(describe e))
(5 6 7 8 9 10) is a LIST
0 5
1 6
2 7
3 8
4 9
5 10
Hmm, I would personally actually prefer the latter, having to write the quote explicitly.
I get:
CL-USER 17 > '(#[5 10] #[20 25])
((QUOTE (5 6 7 8 9 10)) (QUOTE (20 21 22 23 24 25)))
But I would have preferred:
CL-USER 18 > '(#[5 10] #[20 25])
((5 6 7 8 9 10) (20 21 22 23 24 25))