Skip to content

Commit

Permalink
Change MAYBE-QUOTE to allow any non-atoms through.
Browse files Browse the repository at this point in the history
Fixes #37
  • Loading branch information
Shinmera committed Nov 24, 2022
1 parent fa9eeff commit 2e8122c
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 15 deletions.
8 changes: 1 addition & 7 deletions documentation.lisp
Expand Up @@ -893,13 +893,7 @@ By default only subconditions of ERROR are caught.")
"Quotes the expression if it is necessary to do so.
It is considered unnecessary to quote the expression if:
- The expression is a list that has one of the following symbols as its
first element:
- QUOTE
- LAMBDA
- FUNCTION
- SB-INT:QUASIQUOTE
- SI:QUASIQUOTE
- The expression isnt an atom
- It is constant under CONSTANTP
Implementations other than SBCL and ECL are \"out of luck\" when it comes
Expand Down
11 changes: 3 additions & 8 deletions toolkit.lisp
Expand Up @@ -110,14 +110,9 @@
,err))))

(defun maybe-quote (expression)
(typecase expression
(list (case (first expression)
((quote lambda function #+ecl si:quasiquote)
expression)
(T `',expression)))
(T (if (constantp expression)
expression
`',expression))))
(if (or (listp expression) (constantp expression))
expression
`',expression))

;;; THIS IS A BAD IDEA AND I DON'T REMEMBER WHY I ADDED IT.
(defun maybe-unquote (expression)
Expand Down

0 comments on commit 2e8122c

Please sign in to comment.