Search code examples
common-lispquoteclisp

Clisp error message: an object cannot start with #\). What does this mean?


Please see this example. I am using GNU CLISP 2.49.

(defparameter *pudding-eater* 'henry')
;; output: 
READ from
#<INPUT CONCATENATED-STREAM #<INPUT STRING-INPUT-STREAM> #<IO TERMINAL-STREAM>>: an
  object cannot start with #\)

(defparameter *pudding-eater* 'henry)
;; output: 
*PUDDING-EATER*

I do understand that it is the double quotes that are causing the problem. What I do not understand is that, what does an object cannot start with #\) mean? Where did I start with #\)? I was expecting some error message like umatched parenthesis.


Solution

  • Your extra quote character after 'henry is the start of another object, which would make sense in a context like:

    (defparameter *pudding-eater* 'henry '(a b c))
    

    (if defparameter took that many arguments, anyway)

    But, the next character after your quote is a close-paren. The Common Lisp notation for displaying a character (rather than a symbol, string, etc) is a #\ prefix, followed by the character.

    So, the error message is not saying anything about the \ or # characters, only ), and it's telling you you have one where it expected more expressions instead of the end of the current one (because you started an expression by adding that ' character).