From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!not-for-mail From: Paul Smith Newsgroups: gmane.lisp.guile.user Subject: Re: Using guile as an extension language for GNU make Date: Mon, 19 Sep 2011 11:14:34 -0400 Organization: GNU's Not Unix! Message-ID: <1316445274.28907.174.camel@homebase> References: <1316304616.28907.118.camel@homebase> <87wrd5x404.fsf@ambire.localdomain> <1316374080.28907.163.camel@homebase> <87sjntwf29.fsf@ambire.localdomain> Reply-To: psmith@gnu.org NNTP-Posting-Host: lo.gmane.org Mime-Version: 1.0 Content-Type: text/plain; charset="windows-1251" Content-Transfer-Encoding: quoted-printable X-Trace: dough.gmane.org 1316445293 19435 80.91.229.12 (19 Sep 2011 15:14:53 GMT) X-Complaints-To: usenet@dough.gmane.org NNTP-Posting-Date: Mon, 19 Sep 2011 15:14:53 +0000 (UTC) Cc: guile-user@gnu.org To: Thien-Thi Nguyen Original-X-From: guile-user-bounces+guile-user=m.gmane.org@gnu.org Mon Sep 19 17:14:47 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 1R5fYV-0005Y8-GP for guile-user@m.gmane.org; Mon, 19 Sep 2011 17:14:47 +0200 Original-Received: from localhost ([::1]:48678 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1R5fYU-0001By-BC for guile-user@m.gmane.org; Mon, 19 Sep 2011 11:14:46 -0400 Original-Received: from eggs.gnu.org ([140.186.70.92]:46008) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1R5fYQ-0001Bs-33 for guile-user@gnu.org; Mon, 19 Sep 2011 11:14:43 -0400 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1R5fYO-0001zw-Se for guile-user@gnu.org; Mon, 19 Sep 2011 11:14:42 -0400 Original-Received: from oproxy9.bluehost.com ([69.89.24.6]:56524) by eggs.gnu.org with smtp (Exim 4.71) (envelope-from ) id 1R5fYO-0001zh-Me for guile-user@gnu.org; Mon, 19 Sep 2011 11:14:40 -0400 Original-Received: (qmail 23067 invoked by uid 0); 19 Sep 2011 15:14:38 -0000 Original-Received: from unknown (HELO box531.bluehost.com) (74.220.219.131) by oproxy9.bluehost.com with SMTP; 19 Sep 2011 15:14:38 -0000 Original-Received: from 146-115-71-23.c3-0.lex-ubr1.sbo-lex.ma.cable.rcn.com ([146.115.71.23] helo=[172.31.1.105]) by box531.bluehost.com with esmtpsa (SSLv3:AES256-SHA:256) (Exim 4.76) (envelope-from ) id 1R5fYM-00034K-AP; Mon, 19 Sep 2011 09:14:38 -0600 In-Reply-To: <87sjntwf29.fsf@ambire.localdomain> X-Mailer: Evolution 2.32.2 X-Identified-User: {678:box531.bluehost.com:madscie1:mad-scientist.us} {sentby:smtp auth 146.115.71.23 authed with paul+mad-scientist.us} X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.6 (newer, 3) X-Received-From: 69.89.24.6 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:8808 Archived-At: On Mon, 2011-09-19 at 02:28 +0200, Thien-Thi Nguyen wrote: > "Clean" in what way? Everything depends on what the expected (valid) use > of this facility would be. Could you give some examples (w/ failure case= s)? In make, everything is just words: broken up on whitespace. So for example, maybe someone writes a Guile function that computes a complex set of prerequisites for a target: target: $(guile (...some Guile program...)) The list of prerequisites is a whitespace-separated list of target names. If the Guile program returned a string like "dep1 dep2 dep3" then that would be fine with what I have. But it seems like it might be nice to allow the Guile script to return it as a list instead. Then I'd like to convert a list like '(dep1 dep2 dep3) into a string "dep1 dep2 dep3" (not "(dep1 dep2 dep3)" as display would do). But of course each element of the list could be something more complex, as well. So it gets tricky. > I could write a function then invoke it with scm_map() (right?) but th= is > seems like it might be work. >=20 > Everything is work. Even play is work (but hopefully more fun/interestin= g). Yes but implementing it in C, with the memory management etc., would be a lot of (not fun/interesting) work. Hm. I guess I could write a little Guile program to do it for me :-). > I think concomitant w/ this particular hacking it would nice to implement > some of the make functions (e.g., =91patsubst=92) in Scheme. Enough of t= hat > and you will end up {in,con}verting the "embedding" effort to an "extendi= ng" > effort as suggested by Ludo -- YHBW! :-D Well, since Guile is not required and I want GNU make to continue to work as-is on systems where Guile is not available, I won't be rewriting core features in Guile. Yet?!?! :-). --=20 ---------------------------------------------------------------------------= ---- Paul D. Smith Find some GNU make tips at: http://www.gnu.org http://make.mad-scientist.net "Please remain calm...I may be mad, but I am a professional." --Mad Scient= ist