guile-user
[Top][All Lists]
Advanced

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

Re: Calling Scheme procedure from C ?


From: Andreas Rottmann
Subject: Re: Calling Scheme procedure from C ?
Date: Sun, 13 Jul 2003 20:18:08 +0200
User-agent: Gnus/5.1002 (Gnus v5.10.2) Emacs/21.3 (gnu/linux)

"wangy01" <address@hidden> writes:

> I want to make a Scheme call "(write 10)" from my C code. I wrote:
>  proc = scm_c_lookup("write");
>  scm_apply(proc, SCM_MAKINUM(10), scm_listofnull);
> but guile said:
>         ERROR: In procedure apply:
>         ERROR: Wrong type argument in position 1: #<variable 8096d70
> binding: #<primitive-procedure write>>
> , then I tried:
>  proc = scm_c_lookup("write");
>  scm_apply(proc, scm_cons(SCM_MAKINUM(10)), scm_listofnull);
> guile printed the same error messages again.
>
> What should I do?
>
Some code snippet, HTH:

,----
|   SCM mod_ref_proc = scm_c_lookup("module-ref");
|   if (SCM_FALSEP(mod_ref_proc))
|     return 0;
|   SCM mod = scm_apply(
|           scm_variable_ref(mod_ref_proc),
|           scm_list_3(sobj_, scm_str2symbol(name.c_str()), SCM_BOOL_F),
|           SCM_EOL);
`----

Regards, Andy
-- 
Andreas Rottmann         | address@hidden      | address@hidden | address@hidden
http://www.8ung.at/rotty | GnuPG Key: http://www.8ung.at/rotty/gpg.asc
Fingerprint              | DFB4 4EB4 78A4 5EEE 6219  F228 F92F CFC5 01FD 5B62

Python is executable pseudocode, Perl is executable line-noise.




reply via email to

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