unofficial mirror of guile-user@gnu.org 
 help / color / mirror / Atom feed
From: Matthias Koeppe <mkoeppe@mail.math.uni-magdeburg.de>
Cc: guile-user@gnu.org
Subject: Re: one C function to many Scheme functions
Date: Thu, 09 Jan 2003 12:40:43 +0100	[thread overview]
Message-ID: <uw5y95uy2is.fsf@lambda.math.uni-magdeburg.de> (raw)
In-Reply-To: <m3smw3fk08.fsf@laruns.ossau.uklinux.net> (Neil Jerram's message of "08 Jan 2003 20:45:43 +0000")

Neil Jerram <neil@ossau.uklinux.net> writes:

>>>>>> "bajcik" == bajcik  <bajcik@kolos.math.uni.lodz.pl> 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.  

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

-- 
Matthias Köppe -- http://www.math.uni-magdeburg.de/~mkoeppe


_______________________________________________
Guile-user mailing list
Guile-user@gnu.org
http://mail.gnu.org/mailman/listinfo/guile-user


  parent reply	other threads:[~2003-01-09 11:40 UTC|newest]

Thread overview: 6+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2003-01-06 20:30 one C function to many Scheme functions bajcik
2003-01-08 20:45 ` Neil Jerram
2003-01-09 10:26   ` Krzysztof Garus
2003-01-09 23:30     ` Neil Jerram
2003-01-09 11:40   ` Matthias Koeppe [this message]
2003-01-09 23:19     ` Neil Jerram

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

  List information: https://www.gnu.org/software/guile/

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=uw5y95uy2is.fsf@lambda.math.uni-magdeburg.de \
    --to=mkoeppe@mail.math.uni-magdeburg.de \
    --cc=guile-user@gnu.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).