Dear Marc,

Is there any way to get which procedure a closure comes from? If not, would it be very easy to implement? Just wanted to check.

Kind regards,
Mikael

> (define (gen-closure . a) (lambda id: type-x () a))
> (define a (gen-closure))
> (define b (gen-closure))
> a
#<procedure #6
 
~#a
 
type-x
>
> b
#<procedure #7
 ~#b
 
type-x
>
> (closure-id a)
type-x
> (closure-id b)
type-x

..and/or..

> (closure-parent-procedure a)
#<procedure #8 ~#gen-closure>

..or..

> (define (gen-closure . a) (lambda () a))
> (define a (gen-closure))
> (define b (gen-closure))
> a
#<procedure #6 ~#a>
> b
#<procedure #7 ~#b>
> (get-procedure-subprocedures gen-closure)
'(1)
> (closure-id a)
1
> (closure-id b)
1