freenode/#sbcl - IRC Chatlog
Search
14:19:31
MerlinTheWizard
If I'm defining a function and I forgoet to type defun, e.g. (palindromep (sequence) (some code)) SBCL will complain about undefined reference to sequence. Why doesn't it complain about undefined reference to palindromep instead?
14:21:03
MerlinTheWizard
Really? Could you describe for me the algorithm it uses to evaluate an s-expression?
14:23:57
MerlinTheWizard
Also, that doesn't really explain why it doesn't object to palindromep at all. Palindromep is just an undefined sequencee.
14:26:11
flip214
MerlinTheWizard: read some good books about common lisp... a minimal implementation of a CL evaluator in CL is about 100 lines or so
14:27:31
MerlinTheWizard
flip214, I'm just learning common lisp. But I will read some good books about Commmon Lisp, for sure.
14:30:13
MerlinTheWizard
Oh wait, so palindromep might not have been objected to because I only compiled the putative function, and not the whole file? Could it have to do with the way SLIME interacts with SBCL?
14:32:06
MerlinTheWizard
I understand that a single line at the repl gets compiled (somehow) as though it were an individual file. So it sounds like this might be the explanation.
14:35:32
Bike
lisp doesn't worry about undefined functions until it actually has to call them, so it'll still try to evaluate arguments first
14:35:54
Bike
and the description of the evaluation algorithm is here http://www.lispworks.com/documentation/HyperSpec/Body/03_ab.htm
14:36:13
Bike
"If the operator is neither a special operator nor a macro name, it is assumed to be a function name (even if there is no definition for such a function). "
15:47:35
scymtym
when working on a larger piece of software, the code is typically stored in a file or multiple files and in that case the system will inform ("style-warn" to be precise) the programmer of all undefined functions called in the code. the program will (generally) still compile and run until it encounters an undefined function even in that mode