From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!not-for-mail From: Hans Aberg Newsgroups: gmane.lisp.guile.user Subject: Re: Using guile as an extension language for GNU make Date: Tue, 20 Sep 2011 01:00:31 +0200 Message-ID: References: <1316304616.28907.118.camel@homebase> <87wrd5x404.fsf@ambire.localdomain> <1316374080.28907.163.camel@homebase> <87sjntwf29.fsf@ambire.localdomain> <1316445274.28907.174.camel@homebase> <6D40BC91-6E4B-4799-BE29-BD2FF6EEEB84@telia.com> <1316469386.27584.30.camel@psmith-ubeta> NNTP-Posting-Host: lo.gmane.org Mime-Version: 1.0 (Apple Message framework v1084) Content-Type: text/plain; charset=us-ascii Content-Transfer-Encoding: quoted-printable X-Trace: dough.gmane.org 1316473244 22344 80.91.229.12 (19 Sep 2011 23:00:44 GMT) X-Complaints-To: usenet@dough.gmane.org NNTP-Posting-Date: Mon, 19 Sep 2011 23:00:44 +0000 (UTC) Cc: guile-user To: psmith@gnu.org Original-X-From: guile-user-bounces+guile-user=m.gmane.org@gnu.org Tue Sep 20 01:00:40 2011 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 1R5mpL-0007yI-9m for guile-user@m.gmane.org; Tue, 20 Sep 2011 01:00:39 +0200 Original-Received: from localhost ([::1]:49322 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1R5mpK-0002sG-Nr for guile-user@m.gmane.org; Mon, 19 Sep 2011 19:00:38 -0400 Original-Received: from eggs.gnu.org ([140.186.70.92]:56648) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1R5mpI-0002s0-W3 for guile-user@gnu.org; Mon, 19 Sep 2011 19:00:37 -0400 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1R5mpH-0004Lx-W5 for guile-user@gnu.org; Mon, 19 Sep 2011 19:00:36 -0400 Original-Received: from smtp-out12.han.skanova.net ([195.67.226.212]:53336) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1R5mpG-0004Lc-7U; Mon, 19 Sep 2011 19:00:34 -0400 Original-Received: from [10.0.1.2] (217.210.127.13) by smtp-out12.han.skanova.net (8.5.133) (authenticated as u26619196) id 4DF89E7F0153D626; Tue, 20 Sep 2011 01:00:32 +0200 In-Reply-To: <1316469386.27584.30.camel@psmith-ubeta> X-Mailer: Apple Mail (2.1084) X-detected-operating-system: by eggs.gnu.org: Genre and OS details not recognized. X-Received-From: 195.67.226.212 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:8812 Archived-At: On 19 Sep 2011, at 23:56, Paul Smith wrote: > Rather, I need to define a translation from any Guile data type I want > to support into a make-appropriate string (char* buffer) so it can be > appended to make's read buffer, then parsed by make. For any Guile = data > type I can't or don't want to translate, I'll either throw a make = error > or else just expand to the empty string. >=20 > So far, I have these translations (see the C code I posted earlier): >=20 > t =3D> "t" (for make conditionals, non-empty is true) > nil =3D> "" (for make conditionals, empty is false) > "string" =3D> "string" > 'symbol =3D> "symbol" > 1234 =3D> "1234" >=20 > I can see that it would be nice to be able to translate: >=20 > '(a b c) =3D> "a b c" >=20 > But what about more complex structures like lists of lists? What = about > simple pairs; should '(a . b) =3D> "a b" as well? Lists of words are = just > about all make knows about so maybe the answer is yes. >=20 > And finally, currently I have all unknown types expanding to the empty > string but now I'm thinking it would be better to start out more > restrictive and throw errors. This would ensure that people write = their > Guile scripts correctly (giving valid return values) from the start, = and > would let me, in the future, expand the supported types without = breaking > anything. Perhaps you should have some Guile pretty-printing object that can be = manipulated from the makefile. Hans