Question:
Common Lisp Unbound-Variable error?
TNC
2012-03-08 02:20:47 UTC
I'm using the CLOS and I'm trying to write a function called def-concept that uses defclass to create a subclass of the class Concept. When I pass in a command like (def-concept Car), I get an error saying "Attempt to take the value of the unbound variable `car'. Why is this happening? Is there a way to "dereference" a variable from a list of arguments?
Four answers:
Misesean X
2012-03-09 02:45:54 UTC
You can't write a /function/ called DEF-CONCEPT that does that; when you evaluate (DEF-CONCEPT CAR), the first thing Lisp does is try to get the variable-value of CAR ... hence the error. You have to either call it as (DEF-CONCEPT 'CAR) [note the quote], or (more likely what you want here) make DEF-CONCEPT a macro.



In the former case, you can't use DEFCLASS -- use the MOP function ENSURE-CLASS to programmatically create a class. In the latter case, your macro can expand into a DEFCLASS form.
2012-03-08 02:52:02 UTC
Yes you can deference a variable from a list of argument by first declaring the variable function.
?
2017-01-15 10:01:24 UTC
i will decrease myself to the examples under your question: one million. Ayy, incorrect mistake! - a ordinary expression between Filipino infants (a jocular one) which has been assimilated into Taglish colloquialisms. 2. i'm very iterated - of course a Malapropism for "i'm very elated." 3. do no longer touch me no longer!- a double damaging, of direction, or a fusion with "touch me no longer." 4. hi?...For a jointly as, please cling your self...- carry the line, please... 5. are you able to repeat that for the 2nd time around as quickly as extra from the suitable? - of direction, "repeat" can stand by myself there. yet even human beings and British English clientele have superfluity of their "authentic English" expressions. i did no longer watch that opposition, nonetheless.
ratter_of_the_shire
2012-03-08 16:31:54 UTC
try quasi-quoting or sharp-quoting.


This content was originally posted on Y! Answers, a Q&A website that shut down in 2021.
Loading...