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: Sun, 18 Sep 2011 13:42:45 -0400 Organization: GNU's Not Unix! Message-ID: <1316367765.28907.153.camel@homebase> References: <1316304616.28907.118.camel@homebase> <87pqiyaw5w.fsf@gnu.org> Reply-To: psmith@gnu.org NNTP-Posting-Host: lo.gmane.org Mime-Version: 1.0 Content-Type: text/plain; charset="iso-2022-jp" Content-Transfer-Encoding: 7bit X-Trace: dough.gmane.org 1316367778 29888 80.91.229.12 (18 Sep 2011 17:42:58 GMT) X-Complaints-To: usenet@dough.gmane.org NNTP-Posting-Date: Sun, 18 Sep 2011 17:42:58 +0000 (UTC) Cc: guile-user@gnu.org To: Ludovic =?ISO-8859-1?Q?Court=E8s?= Original-X-From: guile-user-bounces+guile-user=m.gmane.org@gnu.org Sun Sep 18 19:42:54 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 1R5LOH-0003yj-JU for guile-user@m.gmane.org; Sun, 18 Sep 2011 19:42:53 +0200 Original-Received: from localhost ([::1]:50067 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1R5LOG-0004gV-To for guile-user@m.gmane.org; Sun, 18 Sep 2011 13:42:52 -0400 Original-Received: from eggs.gnu.org ([140.186.70.92]:60320) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1R5LOD-0004eS-To for guile-user@gnu.org; Sun, 18 Sep 2011 13:42:50 -0400 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1R5LOC-0001G6-Kd for guile-user@gnu.org; Sun, 18 Sep 2011 13:42:49 -0400 Original-Received: from oproxy4-pub.bluehost.com ([69.89.21.11]:48645) by eggs.gnu.org with smtp (Exim 4.71) (envelope-from ) id 1R5LOC-0001Eq-BV for guile-user@gnu.org; Sun, 18 Sep 2011 13:42:48 -0400 Original-Received: (qmail 31953 invoked by uid 0); 18 Sep 2011 17:42:47 -0000 Original-Received: from unknown (HELO box531.bluehost.com) (74.220.219.131) by cpoproxy1.bluehost.com with SMTP; 18 Sep 2011 17:42:47 -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 1R5LOA-0008Sz-QE; Sun, 18 Sep 2011 11:42:46 -0600 In-Reply-To: <87pqiyaw5w.fsf@gnu.org> 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.21.11 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:8802 Archived-At: On Sun, 2011-09-18 at 14:10 +0200, Ludovic Courts wrote: > There are two problems I can think of here: > > - string unquoting is actually more complex than this (recall that > ‘object->string’ merely calls ‘write’): > - ‘scm_c_eval_string’ can return any Scheme objects, some of which > have meaningless representations as strings: > > The latter is probably the most serious question. I think you would > really want to constrain expressions passed in $(guile ...) to return > a string, and not any other type of objects. > > In that case, you could solve the first problem by using (display ...) > instead of (write ...). There's no question that the string conversion is a hack: that's mainly why I'm asking here :-). I don't want to restrict it to just strings; for example I'd have to support numbers as well (one of GNU make's main issues right now is that there is no math capability whatsoever). I'd like to be able to possibly convert other things like t and nil (in GNU make's terms, "false" is the empty string and "true" is any non-empty string). Maybe there are other things as well (what about symbols like 'foobar?), I don't know. On Sun, 2011-09-18 at 17:30 +0200, Thien-Thi Nguyen wrote: > 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. As above, the double-quote stripping is intensely hacky :-). I'll look into the concepts of display and write and see what I can figure out. Any suggestions or pointers to example code are welcome. > 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. Well, I'm only exposing two functions, so "fewer" would be ... one, I guess :-). It's true that one of them (make-expand) is a superset of the other; with that single function you could do pretty much anything I can think of; I'm not sure there's any more powerful capability I can export. I'm not sure that's best though. If anyone has any specific thoughts I'm very interested (that's why I'm writing). -- ------------------------------------------------------------------------------- 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 Scientist