From: Andy Wingo <wingo@pobox.com>
To: Neil Jerram <neil@ossau.uklinux.net>
Cc: guile-user@gnu.org
Subject: Re: Best way to call a user defined hook (written in guile) from C when the hook need plenty parameters
Date: Thu, 08 Jul 2010 20:51:14 +0100 [thread overview]
Message-ID: <m3630prbv1.fsf@unquote.localdomain> (raw)
In-Reply-To: <87bpalof6x.fsf@ossau.uklinux.net> (Neil Jerram's message of "Mon, 05 Jul 2010 21:18:30 +0100")
On Mon 05 Jul 2010 21:18, Neil Jerram <neil@ossau.uklinux.net> writes:
> rixed@happyleptic.org writes:
>
>> (define (hook-helper %s) (lambda () #\t))
>>
>> where %s is the long list of parameters (foo bar baz...) that's inserted by the C program.
>> And :
>>
>> (define (hook . args) (local-eval (cons print-user-fields user-fields) (procedure-environment (apply hook-helper args))))
>
> Using local-eval and procedure-environment like this won't work in Guile
> 1.9/2.0, I believe.
>
> But you could get a similar effect - which I think will still work in
> 1.9/2.0 - by creating a module, defining values in it, and then
> evaluating in that module. (In Guile, module == top level
> environment.)
Yes, I think this is the best option, too. FWIW anyway :)
Andy
--
http://wingolog.org/
prev parent reply other threads:[~2010-07-08 19:51 UTC|newest]
Thread overview: 6+ messages / expand[flat|nested] mbox.gz Atom feed top
2010-07-05 8:56 Best way to call a user defined hook (written in guile) from C when the hook need plenty parameters rixed
2010-07-05 9:57 ` Thien-Thi Nguyen
2010-07-07 14:33 ` Cedric Cellier
2010-07-05 20:18 ` Neil Jerram
2010-07-06 11:22 ` Cedric Cellier
2010-07-08 19:51 ` Andy Wingo [this message]
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=m3630prbv1.fsf@unquote.localdomain \
--to=wingo@pobox.com \
--cc=guile-user@gnu.org \
--cc=neil@ossau.uklinux.net \
/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).