guile-user
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: Clean Guile code from C program


From: Luigi Semenzato
Subject: Re: Clean Guile code from C program
Date: Fri, 7 Mar 2008 11:01:54 -0800

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 <address@hidden> wrote:
> --- Jose Martin <address@hidden> 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.




reply via email to

[Prev in Thread] Current Thread [Next in Thread]