On 5/30/05, Michele Simionato <[EMAIL PROTECTED]> wrote:
> 
> Are you saying that a macro
> 
> (define-introspectively  (foo . args)
>       ...)
> 
> would make the compiler happy? In other words, we should
> redefine "define", not "lambda"?

Yes, once you use a different name, the expansion doesn't
loop.

> That's good, so we could also store the name of the function,
> which is even more useful than its arguments for documentation
> purposes.
> The only thing is, I would like the mechanism to work for
> inner defines too.
> 

It should work:

#;1> (define-macro (defun n ll . body) `(define ,n (lambda ,ll ,@body)))
#;2> (defun foo (x) (+ x 1))
#;3> (foo 33)
34
#;4> (let () (defun foo (x) (+ x 1)) (foo 33))
34


cheers,
felix


_______________________________________________
Chicken-users mailing list
[email protected]
http://lists.nongnu.org/mailman/listinfo/chicken-users

Reply via email to