> How does chicken know what happened here: > > csi> define > Error: unbound variable: define > csi> (define define (lambda () 42)) > csi> define > #<procedure (define)> > csi> (define) > Error: (car) during expansion of (define ...) - bad argument type: () > > Call history: > > <syntax> (define) <--
I would imagine this is what happened: *before* attempting to evaluate your “define” function, Chicken attempts to apply all macros and evaluate special forms (such as “(define ...)”). So the fact that you bind the symbol “define” is irrelevant: Chicken will try to expand your “(define)” form and the expansion will fail (in exactly the same way it fails when you haven't bound the “define” symbol). The “<syntax>” part in the error report means that the error took place during the syntactic expansion (instead of during the actual evaluation). To see what a certain syntax will expand to before evaluation, you can use the “macroexpand” macro, as in: (macroexpand '(define x 40)) Alejo. http://azul.freaks-unidos.net/ _______________________________________________ Chicken-hackers mailing list Chicken-hackers@nongnu.org http://lists.nongnu.org/mailman/listinfo/chicken-hackers