This is the mail archive of the guile@sources.redhat.com mailing list for the Guile project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]

Re: call a C-routine as a Scheme function?


Jost Boekemeier <jostobfe@linux.zrz.TU-Berlin.DE> writes:

> Marius Vollmer <mvo@zagadka.ping.de> writes:
> 
> > Han-Wen Nienhuys <hanwen@cs.uu.nl> writes:
> > 
> > > right now I first do gh_new_procedure2_0("foo-less", foo_less), and
> > > call scm_merge_x with gh_eval (gh_symbol2scm ("foo_less")). Surely
> > > there must be an easier way?
> > 
> > You can use
> > 
> >     SCM func = scm_make_gsubr ("foo-less", 2, 0, 0, foo_less);
> 
> Last time I've looked at the official guile sources (november last
> year :>) gh_new_procedure2_0("x", x) was an alias for 
> scm_make_gsubr("x", 2, 0, 0, x);

Ah, I see.  I thought Han-Wen had problems getting at the newly
created procedure object and assumed that gh_new_procedure2_0 didn't
return that value.  Sorry for the confusion.

Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]