[Top][All Lists]

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Autoconf macro GUILE_CHECK

From: Wolfgang Jaehrling
Subject: Autoconf macro GUILE_CHECK
Date: Sun, 9 Mar 2003 17:30:25 +0100
User-agent: Mutt/1.3.28i


Today, I used the Guile autoconf macros for the first time, and found
the description of GUILE_CHECK_RETVAL in the manual (the same
description is in the code, see below).  However, there is no
GUILE_CHECK_RETVAL, only GUILE_CHECK, and here is the code snippet
from guile.m4 (I have Guile 1.5.7 here, but the current 1.7.0 CVS
contains the same code):

--- snip! ---
# GUILE_CHECK -- evaluate Guile Scheme code and capture the return value
# Usage: GUILE_CHECK_RETVAL(var,check)
# @var{var} is a shell variable name to be set to the return value.
# @var{check} is a Guile Scheme expression, evaluated with "$GUILE -c", and
#    returning either 0 or non-#f to indicate the check passed.
#    Non-0 number or #f indicates failure.
#    Avoid using the character "#" since that confuses autoconf.
  $GUILE -c "$2" > /dev/null 2>&1
--- snap! ---

What you can *do* with this implementation of GUILE_CHECK is: checking
whether the given `check' is a valid expression (which additionally,
when evaluated, does not `(quit 1)' or some such), not whether it
returns a false value or a non-0 number, since Guile (IMO rightfully)
does not make its exit value dependend on the value returned by the
given expression:

$ guile -c '#f'
$ echo $?

Since this behaviour of GUILE_CHECK seems less useful than the
behaviour defined by the comment, I think the implementation is wrong
and should do what the comment says.  When discussing this on IRC,
Dale P. Smith noted that ``return value'' in the comment should also
be interpreted as ``return value of Guile'', so maybe that should be
made unambigous.  In any case, _something_ is wrong here. :-)


reply via email to

[Prev in Thread] Current Thread [Next in Thread]