guile-user
[Top][All Lists]
Advanced

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

Re: one C function to many Scheme functions


From: Neil Jerram
Subject: Re: one C function to many Scheme functions
Date: 09 Jan 2003 23:19:46 +0000
User-agent: Gnus/5.0808 (Gnus v5.8.8) Emacs/20.7

>>>>> "Matthias" == Matthias Koeppe <address@hidden> writes:

    Matthias> Neil Jerram <address@hidden> writes:
    >>>>>>> "bajcik" == bajcik  <address@hidden> writes:
    >> 
    bajcik> But I want to declare many functions in a loop. I have a
    bajcik> table of names and a table of C-functions [ mytype_t
    bajcik> function(my_type arg) ] and only ONE C-function that
    bajcik> converts SCM to mytype_t. It is a wrapper.
    >> 
    >> Guile does not have anything like gh_new_procedure_data.  

    Matthias> What about applicable smobs?  The OP could make a new
    Matthias> smob type for "1-argument C closures".  The smob's APPLY
    Matthias> function would call the "wrapper" function, where the
    Matthias> "void *data" would be fed from SCM_SMOB_DATA.  (I think
    Matthias> this requires a recent Guile (1.6).)

I didn't know about those - so sorry for being over-categorical
before.

Does anyone have any docs or full examples on applicable smobs?

        Neil





reply via email to

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