I'm curious if there is a way to end a backquoted symbol list with a period following a comma inserted value.
Here is the sample code:
(defparameter *things* '(book pencil shoe))
(defun inspect-item (item things)
(if (member item things)
`(you pick up the ,item and yeet it out the window.)
`(only realize the truth... there is no ,item.)))
This will succeed (print (inspect-item 'book *things*))
and it produces the symbol list (YOU PICK UP THE BOOK AND YEET IT OUT THE WINDOW.)
. I assume in this case that the period is part of the symbol WINDOW.
(as confirmed using the last function).
However, this will fail (print (inspect-item 'spoon *things*))
claiming that variable ITEM.
has no value (Because it thinks the name is item.
). Leaving a space between item and the period gives the error illegal end of dotted list
which I assume is because it is assuming I'm using dotted list syntax.
Is there any way to get it to produce the symbol I want at the end (BOOK.
)?