This is the mail archive of the
guile@sources.redhat.com
mailing list for the Guile project.
Re: Representation of VM programs---applicable smobs?
Mikael Djurfeldt <mdj@mdj.nada.kth.se> writes:
> A third possibility is to add applicable smobs to Guile---quite an
> interesting idea actually. It seems that this has a niche of its own,
> just like smobs have their niche (simple, extensible, low-level
> representation).
>
> Actually, several of the current uses of compiled closures would fit
> much better as applicable smobs (lower overhead). This holds, for
> example, for standard-eval-closures.
>
> What are people's opinion about adding applicable smobs to Guile?
> (This implies adding a new entry for scm_tc7_smob in the application
> switches in SCM_CEVAL and SCM_DAPPLY.)
I think this is a very good idea. How will the API look like?
I would like the following:
static long scm_program_tag;
SCM
scm_apply_program (SCM program, SCM args)
{
return scm_vm_apply (some_vm, program, args);
}
static void
scm_init_program ()
{
scm_program_tag = scm_make_smob_type ("program", 0);
scm_set_smob_apply (scm_program_tag, scm_apply_program);
}
Implementing this will be fairly easy. Could you do this soon?
Or could I help?