* Autoconf macro GUILE_CHECK
@ 2003-03-09 16:30 Wolfgang Jaehrling
2003-03-09 19:56 ` Thien-Thi Nguyen
0 siblings, 1 reply; 2+ messages in thread
From: Wolfgang Jaehrling @ 2003-03-09 16:30 UTC (permalink / raw)
Hi!
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.
#
AC_DEFUN([GUILE_CHECK],
[AC_REQUIRE([GUILE_PROGS])
$GUILE -c "$2" > /dev/null 2>&1
$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 $?
0
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. :-)
Cheers,
GNU/Wolfgang
_______________________________________________
Bug-guile mailing list
Bug-guile@gnu.org
http://mail.gnu.org/mailman/listinfo/bug-guile
^ permalink raw reply [flat|nested] 2+ messages in thread
* Re: Autoconf macro GUILE_CHECK
2003-03-09 16:30 Autoconf macro GUILE_CHECK Wolfgang Jaehrling
@ 2003-03-09 19:56 ` Thien-Thi Nguyen
0 siblings, 0 replies; 2+ messages in thread
From: Thien-Thi Nguyen @ 2003-03-09 19:56 UTC (permalink / raw)
Cc: bug-guile
From: Wolfgang Jaehrling <pro-linux@gmx.de>
Date: Sun, 9 Mar 2003 17:30:25 +0100
made unambigous. In any case, _something_ is wrong here. :-)
no worries, just figure out what is unambiguous and strive to emulate.
i have seen in scripts: (exit #f).
thi
_______________________________________________
Bug-guile mailing list
Bug-guile@gnu.org
http://mail.gnu.org/mailman/listinfo/bug-guile
^ permalink raw reply [flat|nested] 2+ messages in thread
end of thread, other threads:[~2003-03-09 19:56 UTC | newest]
Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2003-03-09 16:30 Autoconf macro GUILE_CHECK Wolfgang Jaehrling
2003-03-09 19:56 ` Thien-Thi Nguyen
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).