chicken-users
[Top][All Lists]
Advanced

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

Re: [Chicken-users] Strange parameters in the runtime library


From: felix winkelmann
Subject: Re: [Chicken-users] Strange parameters in the runtime library
Date: Mon, 19 Sep 2005 08:31:27 -0700

On 9/17/05, Thomas Chust <address@hidden> wrote:
> Hello,
> 
> I just found the following prototype in chicken.h:
> 
> C_fctexport void C_apply(C_word c, C_word closure, C_word k, C_word fn,
> ...) C_noret;
> 
> I wondered why on earth there was a closure parameter and a fn parameter.
> Reading the sourcecode of runtime.c carefully reveiled that the closure
> parameter is apparently not used at all, so what is the reason for its
> existence?

The standard calling convention is: 

argument-count, closure, continuation, arguments...

so, the closure is the actual closure object that contains the code-pointer
and the free variables. Primitives have no free variables, so it is
not used. 


cheers,
felix




reply via email to

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