Page 1 of 1

puzzle about EVAL and INTERN

Posted: Sun Mar 22, 2009 2:31 pm
by nobodxbodon
As a newbie on Common Lisp with only experience with some homework in scheme, I'm trying out the "fun" functions like eval and intern. I can't understand why is below:

[33]> (eval (list (intern "+") 2 3))
5
[34]> (eval (list (intern "floor") 2 3))

*** - EVAL: undefined function |floor|
The following restarts are available:
USE-VALUE :R1 Input a value to be used instead of (FDEFINITION '|floor|).
RETRY :R2 Retry
STORE-VALUE :R3 Input a new value for (FDEFINITION '|floor|).
ABORT :R4 Abort main loop

Actually same error happens when I use some functions other than + - * /, is it because problems with package?

Thanks!

Re: puzzle about EVAL and INTERN

Posted: Mon Mar 23, 2009 8:56 am
by findinglisp
Try "(intern "FLOOR")". The standard reader converts all symbols to uppercase by default as they are read.