From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!not-for-mail From: Bruce Korb Newsgroups: gmane.lisp.guile.devel Subject: Re: Guile: What's wrong with this? Date: Wed, 04 Jan 2012 14:36:47 -0800 Message-ID: <4F04D47F.50208@gnu.org> References: <4F027F35.5020001@gmail.com> <1325603029.22166.YahooMailNeo@web37906.mail.mud.yahoo.com> <4F032C41.3070300@gmail.com> <87mxa4ifux.fsf@gnu.org> <4F038BF4.1070200@gnu.org> <87boqkgy3x.fsf@gnu.org> <4F03A396.8080404@gnu.org> <87zke3b211.fsf@gnu.org> NNTP-Posting-Host: lo.gmane.org Mime-Version: 1.0 Content-Type: text/plain; charset=windows-1252; format=flowed Content-Transfer-Encoding: 8bit X-Trace: dough.gmane.org 1325716618 21732 80.91.229.12 (4 Jan 2012 22:36:58 GMT) X-Complaints-To: usenet@dough.gmane.org NNTP-Posting-Date: Wed, 4 Jan 2012 22:36:58 +0000 (UTC) Cc: guile-devel@gnu.org To: =?windows-1252?Q?Ludovic_Court=E8s?= Original-X-From: guile-devel-bounces+guile-devel=m.gmane.org@gnu.org Wed Jan 04 23:36:55 2012 Return-path: Envelope-to: guile-devel@m.gmane.org Original-Received: from lists.gnu.org ([140.186.70.17]) by lo.gmane.org with esmtp (Exim 4.69) (envelope-from ) id 1RiZS2-0003Zd-Sl for guile-devel@m.gmane.org; Wed, 04 Jan 2012 23:36:55 +0100 Original-Received: from localhost ([::1]:56239 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1RiZS1-0006lb-Vg for guile-devel@m.gmane.org; Wed, 04 Jan 2012 17:36:53 -0500 Original-Received: from eggs.gnu.org ([140.186.70.92]:46878) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1RiZRz-0006lT-8n for guile-devel@gnu.org; Wed, 04 Jan 2012 17:36:52 -0500 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1RiZRy-0005cu-2s for guile-devel@gnu.org; Wed, 04 Jan 2012 17:36:51 -0500 Original-Received: from fencepost.gnu.org ([140.186.70.10]:60231) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1RiZRx-0005cq-V8 for guile-devel@gnu.org; Wed, 04 Jan 2012 17:36:50 -0500 Original-Received: from adsl-75-0-186-252.dsl.pltn13.sbcglobal.net ([75.0.186.252]:61346 helo=[10.0.0.2]) by fencepost.gnu.org with esmtpsa (TLS1.0:DHE_RSA_AES_256_CBC_SHA1:32) (Exim 4.71) (envelope-from ) id 1RiZRx-0003Cs-Lt; Wed, 04 Jan 2012 17:36:49 -0500 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:9.0) Gecko/20111220 Thunderbird/9.0 In-Reply-To: <87zke3b211.fsf@gnu.org> X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.6 (newer, 3) X-Received-From: 140.186.70.10 X-BeenThere: guile-devel@gnu.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: "Developers list for Guile, the GNU extensibility library" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: guile-devel-bounces+guile-devel=m.gmane.org@gnu.org Original-Sender: guile-devel-bounces+guile-devel=m.gmane.org@gnu.org Xref: news.gmane.org gmane.lisp.guile.devel:13304 Archived-At: Hi Ludo, On 01/04/12 13:17, Ludovic Courtès wrote: > If the users files are evaluated rather than compiled/loaded, this is > not a problem: I do *all* guile processing via the ag_scm_c_eval_string_from_file_line function. I suck up a string from my input file, determine that it needs guile processing and invoke that function. It has this profile: > SCM > ag_scm_c_eval_string_from_file_line( > char const * pzExpr, char const * pzFile, int line); > > #define SCM_EVAL_CONST(_s) \ > do { static file_line_t const fl = { __LINE__ - 1, __FILE__, _s }; \ > pzLastScheme = fl.text; \ > ag_scm_c_eval_string_from_file_line(fl.text, fl.file, fl.line); \ > } while (0) and I *can* redefine define because I start Guile with my own initialization: > #define SCHEME_INIT_FILE "directive.h" > static const int schemeLine = __LINE__+2; > static char const zSchemeInit[3846] = // this is generated code... > "(use-modules (ice-9 common-list))\n\ > .................................."; > > pzLastScheme = zSchemeInit; > ag_scm_c_eval_string_from_file_line( > zSchemeInit, SCHEME_INIT_FILE, schemeLine); > > SCM_EVAL_CONST("(add-hook! before-error-hook error-source-line)\n" > "(use-modules (ice-9 stack-catch))"); > Could you check whether this is the case? So it is the case. My processing consists of slicing up the input into a bunch of slivers based on markers. I look at each sliver to see how to process it. Some are emitted directly, others trigger internal mechanisms, a few are handed off to a separate server shell process and finally, if the text starts with an open parenthesis or a semi-colon (Guile comment marker), then Guile gets it via that call. Thanks -Bruce