From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!not-for-mail From: "Luigi Semenzato" Newsgroups: gmane.lisp.guile.user Subject: Re: Clean Guile code from C program Date: Fri, 7 Mar 2008 11:01:54 -0800 Message-ID: References: <20080307180233.4CC038B31C@xprdmxin.myway.com> <283059.72019.qm@web37910.mail.mud.yahoo.com> NNTP-Posting-Host: lo.gmane.org Mime-Version: 1.0 Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: 7bit X-Trace: ger.gmane.org 1204916537 16415 80.91.229.12 (7 Mar 2008 19:02:17 GMT) X-Complaints-To: usenet@ger.gmane.org NNTP-Posting-Date: Fri, 7 Mar 2008 19:02:17 +0000 (UTC) Cc: guile-user@gnu.org To: "Mike Gran" Original-X-From: guile-user-bounces+guile-user=m.gmane.org@gnu.org Fri Mar 07 20:02:44 2008 Return-path: Envelope-to: guile-user@m.gmane.org Original-Received: from lists.gnu.org ([199.232.76.165]) by lo.gmane.org with esmtp (Exim 4.50) id 1JXhq6-0004UB-Bq for guile-user@m.gmane.org; Fri, 07 Mar 2008 20:02:43 +0100 Original-Received: from localhost ([127.0.0.1] helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1JXhpX-0007Zc-Jb for guile-user@m.gmane.org; Fri, 07 Mar 2008 14:02:07 -0500 Original-Received: from mailman by lists.gnu.org with tmda-scanned (Exim 4.43) id 1JXhpS-0007ZG-2F for guile-user@gnu.org; Fri, 07 Mar 2008 14:02:02 -0500 Original-Received: from exim by lists.gnu.org with spam-scanned (Exim 4.43) id 1JXhpO-0007YL-LW for guile-user@gnu.org; Fri, 07 Mar 2008 14:02:00 -0500 Original-Received: from [199.232.76.173] (helo=monty-python.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1JXhpO-0007YH-Iq for guile-user@gnu.org; Fri, 07 Mar 2008 14:01:58 -0500 Original-Received: from wf-out-1314.google.com ([209.85.200.170]) by monty-python.gnu.org with esmtp (Exim 4.60) (envelope-from ) id 1JXhpO-0001s0-49 for guile-user@gnu.org; Fri, 07 Mar 2008 14:01:58 -0500 Original-Received: by wf-out-1314.google.com with SMTP id 29so636300wff.24 for ; Fri, 07 Mar 2008 11:01:54 -0800 (PST) Original-Received: by 10.142.174.8 with SMTP id w8mr997094wfe.5.1204916514436; Fri, 07 Mar 2008 11:01:54 -0800 (PST) Original-Received: by 10.142.131.19 with HTTP; Fri, 7 Mar 2008 11:01:54 -0800 (PST) In-Reply-To: <283059.72019.qm@web37910.mail.mud.yahoo.com> Content-Disposition: inline X-detected-kernel: by monty-python.gnu.org: Linux 2.6 (newer, 2) X-BeenThere: guile-user@gnu.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: General Guile related discussions List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Original-Sender: guile-user-bounces+guile-user=m.gmane.org@gnu.org Errors-To: guile-user-bounces+guile-user=m.gmane.org@gnu.org Xref: news.gmane.org gmane.lisp.guile.user:6448 Archived-At: It's not clear that Mike's asking the right question here. If he wants to get rid of Guile from his program, first he needs to check if the program contains any Guile code which uses this code. It's possible that a substantial amount of the program's functionality has been written in Guile. In that case converting these functions, which are Guile-specific, to C won't help much. A better approach is to understand what the Guile part of the program is doing and figuring out how to convert that part to C. Most likely, the best way of doing that will not use any of the C-Guile interface. It's possible (but quite unlikely) that all calls into this code come from other C code. Then the advice applies, although even in this case it may be easier to rewrite the C code from scratch. Also, the code is a little suspicious. Take a look at this fragment below: SCM check_text_sections(SCM tag) { if (tag == SCM_BOOL_F) { TextFile::CheckNewline = 0; } else if (tag == SCM_BOOL_F) { TextFile::CheckNewline = 1; ... Before asking Guile-specific questions, Mike should backtrack and get advice on how to solve his problem (probably on a different forum). He may very well be going down the wrong path. Luigi On 3/7/08, Mike Gran wrote: > --- Jose Martin wrote: > > > I looked at the program's code and it looks a bit > > difficult to change it, and I must say I'm a > > beginner in C. Could anyone give me the steps of the > > changes I'd need to remove Guile-dependent code from > > C code? > > > Wow. The Guile stuff is pretty well entangled. If > you don't know enough C (and I think I saw some C++ in > there as well) you might be in over your head. > > But, FWIW, here's how you'd do it.