guile-user
[Top][All Lists]
Advanced

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

Re: Using guile as an extension language for GNU make


From: Thien-Thi Nguyen
Subject: Re: Using guile as an extension language for GNU make
Date: Sun, 18 Sep 2011 17:30:03 +0200
User-agent: Gnus/5.13 (Gnus v5.13) Emacs/24.0.50 (gnu/linux)

() Paul Smith <address@hidden>
() Sat, 17 Sep 2011 20:10:16 -0400

    char *str = scm_to_locale_string (scm_object_to_string (scm_c_eval_string 
(argv[0]),
                                                            SCM_UNDEFINED));
    char *s = str;
    unsigned int l = strlen (s);

    if (s[0] == '"' && s[l-1] == '"')
      {
        s[l-1] = '\0';
        ++s;
        l -= 2;
      }

    o = variable_buffer_output (o, s, l);
    free (str);

The double-quote stripping is kind of hacky.  I would create a port and
‘display’ the result of ‘scm_c_eval_string’ to it.  Perhaps you could
expose a ‘write’ variant, as well, for complete user control.

Similarly for the other funcs.  Overall, i get the vague impression that
points of exposure could be improved -- made more orthogonal, w/ fewer
(but more powerful) funcs, but that's probably simply my ignorance of Make
internals speaking.



reply via email to

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