chicken-users
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [Chicken-users] making lambdas more introspective


From: Michele Simionato
Subject: Re: [Chicken-users] making lambdas more introspective
Date: Mon, 30 May 2005 03:55:05 -0400

On 5/30/05, felix winkelmann <address@hidden> wrote:
> 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

Yep, I am pretty sure I had problems with inner defines and psyntax in early
version of Chicken, but they seem to have disappeared now.

So my proposal is:

let's change the standard Chicken "define" in such a way to store
both the name and the argument list of the (extended) procedure,
and add a proc-info function such that

(proc-info func 'name)         -> the name of the function as a string
(proc-info func 'signature)   -> the signature of the function as a list

(the name my change; also I am not sure if to store the attributes
in an alist or in a hash table; I also want the possibility to change
the name of the function at run-time).

Up and down votes, please!  ;)


            Michele Simionato




reply via email to

[Prev in Thread] Current Thread [Next in Thread]