guile-user
[Top][All Lists]
Advanced

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

Re: compiled closures status


From: Marco Maggi
Subject: Re: compiled closures status
Date: Tue, 27 Nov 2007 21:37:36 +0100

Ciao,

"Ludovic Courtès" wrote:
>
>"Marco Maggi" <address@hidden> writes:
>
>> I have written a simple extension to test the
>> compiled closures feature, and it seems to work.
>> I wonder if it can be documented (and in this case
>> I can contribute a Texinfo node) or there are plans
>> to change the API.
>
>You're referring to `scm_makcclo ()' and the likes?

Yes.

>The difference with `scm_closure ()', AIUI, is that a cclo's
>environment is a simple C array instead of an alist.

Mh. The "env" parameter is a simple alist? I will try to
find what is the "code" one.... but I doubt that it is a
gsubr. The compiled closure is the pair "scm_t_bits"
array/gsubr.

>However, I'm under the impression that code in `eval.c'
>doesn't know how to deal with a cclo's environment
>(e.g., there is no occurrence of `SCM_CCLO_BASE ()').

In Guile 1.8.3 at line 4139 of "eval.c",

|      case scm_tc7_cclo:
|       arg1 = proc;
|       proc = SCM_CCLO_SUBR (proc);

which means that the compiled procedure is invoked with
the closure itself as first argument.

>So, what makes you think it works?  :-)

I tried it:

$ tla register-archive http://arch.gna.org/gee/gee-2007
$ tla get <the-archive>/gee-examples--devel--0.4

:-)
--
Marco Maggi

"Now feel the funk blast!"
Rage Against the Machine - "Calm like a bomb"






reply via email to

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