From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!not-for-mail From: ludo@gnu.org (Ludovic =?iso-8859-1?Q?Court=E8s?=) Newsgroups: gmane.lisp.guile.user Subject: Re: Guile support in GNU make Date: Tue, 17 Jan 2012 23:42:06 +0100 Message-ID: <87y5t6x875.fsf@gnu.org> References: <1326570905.3482.136.camel@homebase> <87boq5jqmc.fsf@gnuvola.org> <1326643949.3482.241.camel@homebase> <8762gchbf8.fsf@gnu.org> <1326722878.3482.334.camel@homebase> NNTP-Posting-Host: lo.gmane.org Mime-Version: 1.0 Content-Type: multipart/mixed; boundary="=-=-=" X-Trace: dough.gmane.org 1326840141 2464 80.91.229.12 (17 Jan 2012 22:42:21 GMT) X-Complaints-To: usenet@dough.gmane.org NNTP-Posting-Date: Tue, 17 Jan 2012 22:42:21 +0000 (UTC) Cc: guile-user@gnu.org To: psmith@gnu.org Original-X-From: guile-user-bounces+guile-user=m.gmane.org@gnu.org Tue Jan 17 23:42:16 2012 Return-path: Envelope-to: guile-user@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 1RnHjM-0004Sc-Jt for guile-user@m.gmane.org; Tue, 17 Jan 2012 23:42:16 +0100 Original-Received: from localhost ([::1]:56385 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1RnHjM-00027P-07 for guile-user@m.gmane.org; Tue, 17 Jan 2012 17:42:16 -0500 Original-Received: from eggs.gnu.org ([140.186.70.92]:43892) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1RnHjH-000279-KC for guile-user@gnu.org; Tue, 17 Jan 2012 17:42:12 -0500 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1RnHjG-0001QC-Ct for guile-user@gnu.org; Tue, 17 Jan 2012 17:42:11 -0500 Original-Received: from mail1-relais-roc.national.inria.fr ([192.134.164.82]:5040) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1RnHjG-0001Q4-6y; Tue, 17 Jan 2012 17:42:10 -0500 X-IronPort-AV: E=Sophos;i="4.71,525,1320620400"; d="scan'208";a="140276595" Original-Received: from reverse-83.fdn.fr (HELO pluto) ([80.67.176.83]) by mail1-relais-roc.national.inria.fr with ESMTP/TLS/DHE-RSA-AES128-SHA; 17 Jan 2012 23:42:08 +0100 X-URL: http://www.fdn.fr/~lcourtes/ X-Revolutionary-Date: 28 =?iso-8859-1?Q?Niv=F4se?= an 220 de la =?iso-8859-1?Q?R=E9volution?= X-PGP-Key-ID: 0xEA52ECF4 X-PGP-Key: http://www.fdn.fr/~lcourtes/ludovic.asc X-PGP-Fingerprint: 83C4 F8E5 10A3 3B4C 5BEA D15D 77DD 95E2 EA52 ECF4 X-OS: x86_64-unknown-linux-gnu In-Reply-To: <1326722878.3482.334.camel@homebase> (Paul Smith's message of "Mon, 16 Jan 2012 09:07:58 -0500") User-Agent: Gnus/5.110018 (No Gnus v0.18) Emacs/24.0.90 (gnu/linux) X-detected-operating-system: by eggs.gnu.org: Genre and OS details not recognized. X-Received-From: 192.134.164.82 X-BeenThere: guile-user@gnu.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: General Guile related discussions List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: guile-user-bounces+guile-user=m.gmane.org@gnu.org Original-Sender: guile-user-bounces+guile-user=m.gmane.org@gnu.org Xref: news.gmane.org gmane.lisp.guile.user:9155 Archived-At: --=-=-= Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: quoted-printable Hi Paul, Paul Smith skribis: > On Sun, 2012-01-15 at 23:02 +0100, Ludovic Courts wrote: >> And thanks for the great news! :-) > > I promoted the feature to GNU make CVS (I know, still CVS!!) on > Savannah. I hope to generate a test dist file sometime this week. I'll > email when it's available if people want to take a look. Excellent! I just tried this: --8<---------------cut here---------------start------------->8--- $(guile (display "hello, world\n")) $(guile (pk (resolve-interface '(gnu make)))) --8<---------------cut here---------------end--------------->8--- And then =E2=80=9Cmake -f ./the-file.mk=E2=80=9D. It works as intended ;-) but hits a segfault fixed with this patch: --=-=-= Content-Type: text/x-patch Content-Disposition: inline --- guile.c.~2.3.~ 2012-01-16 04:32:49.000000000 +0100 +++ guile.c 2012-01-17 23:35:53.000000000 +0100 @@ -92,9 +92,12 @@ func_guile (char *o, char **argv, const if (argv[0] && argv[0][0] != '\0') { char *str = scm_with_guile (internal_guile_eval, argv[0]); + if (str != NULL) + { o = variable_buffer_output (o, str, strlen (str)); free (str); } + } return o; } --=-=-= Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: quoted-printable Anyway, nice job! :-) >> Paul Smith skribis: >> >> - The =E2=80=98#t =3D> t=E2=80=99 distinguishes the symbol t from oth= ers, which feels wrong. >> >> I suggest #t =3D> ""; #f =3D> error. >> > >> > Hm. The problem with this is that we can't easily use Guile booleans in >> > GNU make. For example, the syntax for make's $(if ...) function is: >> > >> > $(if ,[,]) >> > >> > The is expanded as a makefile expression and if it's empty >> > it's considered false. If it's non-empty it's considered true. >>=20 >> Would it be possible for Make to delay the conversion of SCMs to >> strings, and in turn to differentiate between conditions as strings, and >> conditions that are SCMs? > > I don't think this is possible. Make has no "data types" at all. It > just manipulates strings--every operation in make is a string operation, > and the "results" of operations are just constructing new string buffers > by doing string manipulations, then passing that string to the next > function (or whatever). > > There's just no facility anywhere internal to make to store or > manipulate a non-string item. OK, I see. > I suppose one option would be to have #f translate to the string "#f" > and change the definition in make of "false" to be "either the empty > string OR the string #f". Since "#" is a comment character in make it's > highly unlikely (although not impossible) someone would have that as a > valid value. It is possible to write valid GNU Make code that generates strings containing =E2=80=9C#=E2=80=9D? > However, this would be a lot of effort (finding all the places in make > that use the empty string as "false" and modifying them). And I'm not > sure it wouldn't cause other issues. I think, all in all, it's better > to leave it as-is unless someone can point out a real problem with it > (besides a general unpleasant aftertaste). Yeah. These are different =E2=80=9Cvalue worlds=E2=80=9D (as Jim Blandy says), an= d one of them has a single data type, so this may be the best that can be done without introducing other data types in the Make language. Thanks! Ludo=E2=80=99. --=-=-=--