unofficial mirror of guile-user@gnu.org 
 help / color / mirror / Atom feed
From: Hans Aberg <haberg-1@telia.com>
To: psmith@gnu.org
Cc: guile-user <guile-user@gnu.org>
Subject: Re: Using guile as an extension language for GNU  make
Date: Tue, 20 Sep 2011 01:00:31 +0200	[thread overview]
Message-ID: <F0E98D24-F080-420C-9D27-1DF93D1B7906@telia.com> (raw)
In-Reply-To: <1316469386.27584.30.camel@psmith-ubeta>

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.
> 
> So far, I have these translations (see the C code I posted earlier):
> 
> t		=> "t" (for make conditionals, non-empty is true)
> nil		=> ""  (for make conditionals, empty is false)
> "string"	=> "string"
> 'symbol		=> "symbol"
> 1234		=> "1234"
> 
> I can see that it would be nice to be able to translate:
> 
> '(a b c)	=> "a b c"
> 
> But what about more complex structures like lists of lists?  What about
> simple pairs; should '(a . b) => "a b" as well?  Lists of words are just
> about all make knows about so maybe the answer is yes.
> 
> 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





  parent reply	other threads:[~2011-09-19 23:00 UTC|newest]

Thread overview: 21+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2011-09-18  0:10 Using guile as an extension language for GNU make Paul Smith
2011-09-18 12:10 ` Ludovic Courtès
2011-09-18 17:21   ` Embedding vs. Extending (was: Re: Using guile as an extension language for GNU make) Paul Smith
2011-09-18 21:48     ` Embedding vs. Extending Ludovic Courtès
2011-09-18 17:42   ` Using guile as an extension language for GNU make Paul Smith
2011-09-18 21:28     ` Ludovic Courtès
2011-09-18 15:30 ` Thien-Thi Nguyen
2011-09-18 19:28   ` Paul Smith
2011-09-19  0:28     ` Thien-Thi Nguyen
2011-09-19 15:14       ` Paul Smith
2011-09-19 19:41         ` Hans Aberg
2011-09-19 21:56           ` Paul Smith
2011-09-19 22:35             ` Hans Aberg
2011-09-19 23:00             ` Hans Aberg [this message]
2011-09-21  2:42             ` Mark H Weaver
2011-09-21  8:24               ` Hans Aberg
2011-09-20 16:17         ` Thien-Thi Nguyen
2011-09-20 17:31           ` Paul Smith
2011-09-20 19:02             ` Paul Smith
2011-09-21  0:48               ` Thien-Thi Nguyen
2011-09-20 20:39             ` Thien-Thi Nguyen

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

  List information: https://www.gnu.org/software/guile/

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=F0E98D24-F080-420C-9D27-1DF93D1B7906@telia.com \
    --to=haberg-1@telia.com \
    --cc=guile-user@gnu.org \
    --cc=psmith@gnu.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).