From mboxrd@z Thu Jan 1 00:00:00 1970 Path: main.gmane.org!not-for-mail From: Andreas Rottmann Newsgroups: gmane.lisp.guile.user Subject: Re: Calling Scheme procedure from C ? Date: Sun, 13 Jul 2003 20:18:08 +0200 Sender: guile-user-bounces+guile-user=m.gmane.org@gnu.org Message-ID: <87adbimgtb.fsf@alice.rotty.yi.org> References: <257889490.11085@mails.tsinghua.edu.cn> NNTP-Posting-Host: main.gmane.org Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii X-Trace: main.gmane.org 1058120331 777 80.91.224.249 (13 Jul 2003 18:18:51 GMT) X-Complaints-To: usenet@main.gmane.org NNTP-Posting-Date: Sun, 13 Jul 2003 18:18:51 +0000 (UTC) Cc: guile-user@gnu.org Original-X-From: guile-user-bounces+guile-user=m.gmane.org@gnu.org Sun Jul 13 20:18:49 2003 Return-path: Original-Received: from monty-python.gnu.org ([199.232.76.173]) by main.gmane.org with esmtp (Exim 3.35 #1 (Debian)) id 19blQv-0000CP-00 for ; Sun, 13 Jul 2003 20:18:49 +0200 Original-Received: from localhost ([127.0.0.1] helo=monty-python.gnu.org) by monty-python.gnu.org with esmtp (Exim 4.20) id 19blRA-0002k6-De for guile-user@m.gmane.org; Sun, 13 Jul 2003 14:19:04 -0400 Original-Received: from list by monty-python.gnu.org with tmda-scanned (Exim 4.20) id 19blQO-0002LL-8y for guile-user@gnu.org; Sun, 13 Jul 2003 14:18:16 -0400 Original-Received: from mail by monty-python.gnu.org with spam-scanned (Exim 4.20) id 19blPs-0001IW-OA for guile-user@gnu.org; Sun, 13 Jul 2003 14:17:45 -0400 Original-Received: from octopussy.utanet.at ([213.90.36.45]) by monty-python.gnu.org with esmtp (Exim 4.20) id 19blPh-0000RK-5x for guile-user@gnu.org; Sun, 13 Jul 2003 14:17:33 -0400 Original-Received: from plenty.utanet.at ([213.90.36.9]) by octopussy.utanet.at with esmtp (Exim 4.12) id 19blPd-0001I3-00; Sun, 13 Jul 2003 20:17:29 +0200 Original-Received: from dsl-245-167.utaonline.at ([212.152.245.167] helo=rotty-ipv4.yi.org) by plenty.utanet.at with esmtp (Exim 4.12) id 19blPd-000672-00; Sun, 13 Jul 2003 20:17:29 +0200 Original-Received: from alice.rhinosaur.lan ([192.168.1.3] ident=mail) by rotty-ipv4.yi.org with esmtp (Exim 3.36 #1 (Debian)) id 19blQG-0003h3-00; Sun, 13 Jul 2003 20:18:08 +0200 Original-Received: from andy by alice.rhinosaur.lan with local (Exim 4.20) id 19blQG-0000V4-5S; Sun, 13 Jul 2003 20:18:08 +0200 Original-To: wangy01 In-Reply-To: <257889490.11085@mails.tsinghua.edu.cn> (wangy01@mails.tsinghua.edu.cn's message of "Fri, 11 Jul 2003 10:11:30 +0800") User-Agent: Gnus/5.1002 (Gnus v5.10.2) Emacs/21.3 (gnu/linux) X-BeenThere: guile-user@gnu.org X-Mailman-Version: 2.1.2 Precedence: list List-Id: General Guile related discussions List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: guile-user-bounces+guile-user=m.gmane.org@gnu.org Xref: main.gmane.org gmane.lisp.guile.user:2073 X-Report-Spam: http://spam.gmane.org/gmane.lisp.guile.user:2073 "wangy01" 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: # binding: #> > , 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 | Rotty@ICQ | 118634484@ICQ | a.rottmann@gmx.at 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. _______________________________________________ Guile-user mailing list Guile-user@gnu.org http://mail.gnu.org/mailman/listinfo/guile-user