Why is it that the Common Lisp array syntax is not evaluating its arguments:
(let ((a 1)) #2A((a 2) (3 4)))
=> #2A((A 2) (3 4))
I would have guessed it was #2A((1 2) (3 4)). Is this because A is not available at reader time?
Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.
Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.
Lost your password? Please enter your email address. You will receive a link and will create a new password via email.
Please briefly explain why you feel this question should be reported.
Please briefly explain why you feel this answer should be reported.
Please briefly explain why you feel this user should be reported.
In short, yes.
#2A((A 2) (3 4))is not an abbreviation (“syntactic sugar”) for(make-array '(2 2) :initial-contents (list (list a 2) (list 3 4))). If anything, it could be rationalized as(make-array '(2 2) :initial-contents (quote ((A 2) (3 4)))), but this would be a bit misleading as the array construction already happens at read-time.