From mboxrd@z Thu Jan 1 00:00:00 1970 Path: main.gmane.org!not-for-mail From: Bruce Korb Newsgroups: gmane.lisp.guile.devel,gmane.lisp.guile.user Subject: Re: PLEASE: debugging embedded guile code Date: Fri, 16 May 2003 10:19:12 -0700 Organization: Home Sender: guile-devel-bounces+guile-devel=m.gmane.org@gnu.org Message-ID: <3EC51D90.DCD7EC5E@veritas.com> References: <20030225093608.6a8935f8.dsmith@altustech.com> <3EAAB691.6AD935B5@veritas.com> <3EAAE877.7140ECB6@veritas.com> <3EAC5266.23DEEB7F@veritas.com> <3EAD89DB.9B0A1367@veritas.com> NNTP-Posting-Host: main.gmane.org Mime-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit X-Trace: main.gmane.org 1053105426 1383 80.91.224.249 (16 May 2003 17:17:06 GMT) X-Complaints-To: usenet@main.gmane.org NNTP-Posting-Date: Fri, 16 May 2003 17:17:06 +0000 (UTC) Cc: guile-devel@gnu.org Original-X-From: guile-devel-bounces+guile-devel=m.gmane.org@gnu.org Fri May 16 19:16:59 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 19GikF-0008PG-00 for ; Fri, 16 May 2003 19:11:47 +0200 Original-Received: from localhost ([127.0.0.1] helo=monty-python.gnu.org) by monty-python.gnu.org with esmtp (Exim 4.10.13) id 19GilM-0006MD-03 for guile-devel@m.gmane.org; Fri, 16 May 2003 13:12:56 -0400 Original-Received: from list by monty-python.gnu.org with tmda-scanned (Exim 4.10.13) id 19Gil9-0006I5-00 for guile-devel@gnu.org; Fri, 16 May 2003 13:12:43 -0400 Original-Received: from mail by monty-python.gnu.org with spam-scanned (Exim 4.10.13) id 19GikZ-00065A-00 for guile-devel@gnu.org; Fri, 16 May 2003 13:12:08 -0400 Original-Received: from bay-bridge.veritas.com ([143.127.3.10] helo=mtvmime02.veritas.com) by monty-python.gnu.org with esmtp (Exim 4.10.13) id 19GijL-0004z9-00; Fri, 16 May 2003 13:10:51 -0400 Original-Received: from megami (unverified) by mtvmime02.veritas.com (Content Technologies SMTPRS 4.3.6) with SMTP id ; Fri, 16 May 2003 10:12:38 -0700 Original-Received: from veritas.com ([172.22.12.211]) (3167 bytes) by megami via sendmail with P:esmtp/R:smart_host/T:smtp (sender: ) id for ; Fri, 16 May 2003 10:10:48 -0700 (PDT) (Smail-3.2.0.101 1997-Dec-17 #15 built 2001-Aug-30) X-Mailer: Mozilla 4.8 [en] (X11; U; Linux 2.4.19-4GB i686) X-Accept-Language: en Original-To: Neil Jerram Original-cc: guile-user@gnu.org X-BeenThere: guile-devel@gnu.org X-Mailman-Version: 2.1b5 Precedence: list List-Id: Developers list for Guile, the GNU extensibility library List-Help: List-Post: List-Subscribe: , List-Archive: List-Unsubscribe: , Errors-To: guile-devel-bounces+guile-devel=m.gmane.org@gnu.org Xref: main.gmane.org gmane.lisp.guile.devel:2370 gmane.lisp.guile.user:1962 X-Report-Spam: http://spam.gmane.org/gmane.lisp.guile.devel:2370 Neil Jerram wrote: Hi Neil, Back to this again: > >> (define client-input "") > >> (define (eval-client-input str) > >> (stack-catch #t > >> (lambda () > >> (call-with-input-string str > >> (lambda (p) > >> (set-port-filename! p (tpl-file)) > >> (set-port-line! p (string->number (tpl-file-line "%2$d"))) > >> (list (primitive-eval (read p)))))) > >> (lambda (key . args) > >> ;; [1] > >> (apply display-error (fluid-ref the-last-stack) > >> (current-error-port) > >> args) > >> (set! stack-saved? #f) > >> #f))) > 1. No documentation :-) Based on your example, I would need to emit this to libguile: (eval-client-input "...whatever...") The problem is that the ``...whatever...'' is likely to often include double quotes, backslashes and all kinds of interesting stuff. I don't particularly want to go over the string and reformat it so that the reader can reconstruct what I already have in hand. What I want to do is along these lines: > { > SCM str = gh_str02scm( "...whatever..." ); > scm_set_x( client_input_scm, str ); > gh_eval_str( "(eval-client-input client-input)" ); > } of course, there _is_ no scm_set_x procedure and scm_m_set_x is indecipherable: > /* Will go into the RnRS module when Guile is factorized. > SCM_SYNTAX (s_set_x, "set!", scm_makmmacro, scm_m_set_x); */ > static const char s_set_x[] = "set!"; > SCM_GLOBAL_SYMBOL (scm_sym_set_x, s_set_x); > > SCM > scm_m_set_x (SCM xorig, SCM env SCM_UNUSED) > { > SCM x = SCM_CDR (xorig); > SCM_ASSYNT (scm_ilength (x) == 2, scm_s_expression, s_set_x); > SCM_ASSYNT (SCM_SYMBOLP (SCM_CAR (x)), scm_s_variable, s_set_x); > return scm_cons (SCM_IM_SET_X, x); > } and it would be nice to figure out how to convert the string, "client-input" into an SCM that is client-input. :) _______________________________________________ Guile-devel mailing list Guile-devel@gnu.org http://mail.gnu.org/mailman/listinfo/guile-devel