Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

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.

like image 962
3x89g2 Avatar asked Mar 22 '26 15:03

3x89g2


1 Answers

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).

like image 185
amalloy Avatar answered Mar 26 '26 15:03

amalloy