From mboxrd@z Thu Jan 1 00:00:00 1970 Path: main.gmane.org!not-for-mail From: Neil Jerram Newsgroups: gmane.lisp.guile.user Subject: Re: guile's eval from C Date: 30 Sep 2002 19:38:38 +0100 Sender: guile-user-admin@gnu.org Message-ID: References: <15767.26838.537408.102758@shmyh.ua> NNTP-Posting-Host: localhost.gmane.org Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii X-Trace: main.gmane.org 1033411705 11196 127.0.0.1 (30 Sep 2002 18:48:25 GMT) X-Complaints-To: usenet@main.gmane.org NNTP-Posting-Date: Mon, 30 Sep 2002 18:48:25 +0000 (UTC) Cc: guile-user@gnu.org 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 17w5ae-0002u1-00 for ; Mon, 30 Sep 2002 20:48:21 +0200 Original-Received: from localhost ([127.0.0.1] helo=monty-python.gnu.org) by monty-python.gnu.org with esmtp (Exim 4.10) id 17w5am-0003yk-00; Mon, 30 Sep 2002 14:48:28 -0400 Original-Received: from list by monty-python.gnu.org with tmda-scanned (Exim 4.10) id 17w5Ze-0003rx-00 for guile-user@gnu.org; Mon, 30 Sep 2002 14:47:18 -0400 Original-Received: from mail by monty-python.gnu.org with spam-scanned (Exim 4.10) id 17w5Za-0003rM-00 for guile-user@gnu.org; Mon, 30 Sep 2002 14:47:16 -0400 Original-Received: from mail.uklinux.net ([80.84.72.21] helo=s1.uklinux.net) by monty-python.gnu.org with esmtp (Exim 4.10) id 17w5ZY-0003qi-00 for guile-user@gnu.org; Mon, 30 Sep 2002 14:47:12 -0400 Original-Received: from portalet.ossau.uklinux.net (ppp-1-179.lond-b-2.access.uk.tiscali.com [80.40.7.179]) by s1.uklinux.net (8.11.6/8.11.6) with ESMTP id g8UIl6I32452; Mon, 30 Sep 2002 19:47:07 +0100 Original-Received: from laruns.ossau.uklinux.net.ossau.uklinux.net (laruns.ossau.uklinux.net [192.168.1.3]) by portalet.ossau.uklinux.net (Postfix on SuSE Linux 7.2 (i386)) with ESMTP id 66A071717; Mon, 30 Sep 2002 19:43:52 +0000 (GMT) Original-To: Viktor Pavlenko Original-Lines: 26 User-Agent: Gnus/5.0808 (Gnus v5.8.8) Emacs/20.7 Errors-To: guile-user-admin@gnu.org X-BeenThere: guile-user@gnu.org X-Mailman-Version: 2.0.11 Precedence: bulk List-Help: List-Post: List-Subscribe: , List-Id: General Guile related discussions List-Unsubscribe: , List-Archive: Xref: main.gmane.org gmane.lisp.guile.user:1096 X-Report-Spam: http://spam.gmane.org/gmane.lisp.guile.user:1096 >>>>> "Viktor" == Viktor Pavlenko writes: Viktor> Hello and sorry for the simple question. Viktor> I'd like to evaluate an SCM object from C, equivalent to guile> (eval '(car '("a" "b" "c"))) Viktor> "a" guile> (eval "a") Viktor> "a" Viktor> Looks like the best way is to call gh_call1(), but how do Viktor> I get an SCM object for guile's eval? I could also build a Viktor> C string containing the complete expression to be Viktor> evaluated ( "(eval '(car '("a" "b" "c")))" ) and call Viktor> gh_eval_str() but this seems inefficient because I have Viktor> the expression to be evaluated as SCM object. One possibility is: scm_primitive_eval (exp); This will evaluate the supplied expression in the current module. Does this help? Neil _______________________________________________ Guile-user mailing list Guile-user@gnu.org http://mail.gnu.org/mailman/listinfo/guile-user