1
Fork 0
mirror of https://git.savannah.gnu.org/git/guile.git synced 2025-05-20 11:40:18 +02:00

Reinstate `scm_is_bool ()' as a function.

* libguile/boolean.c (scm_is_bool): New function.

* libguile/boolean.h (scm_is_bool): New function declaration.
This commit is contained in:
Ludovic Courtès 2010-01-19 21:41:41 +01:00
parent d532c41b91
commit baedef98ee
2 changed files with 16 additions and 2 deletions

View file

@ -1,4 +1,4 @@
/* Copyright (C) 1995, 1996, 2000, 2001, 2006, 2008, 2009 Free Software Foundation, Inc.
/* Copyright (C) 1995, 1996, 2000, 2001, 2006, 2008, 2009, 2010 Free Software Foundation, Inc.
*
* This library is free software; you can redistribute it and/or
* modify it under the terms of the GNU Lesser General Public License
@ -85,6 +85,18 @@ scm_to_bool (SCM x)
scm_wrong_type_arg (NULL, 0, x);
}
/* We keep this primitive as a function in addition to the same-named macro
because some applications (e.g., GNU LilyPond 2.13.9) expect it to be a
function. */
#undef scm_is_bool
int
scm_is_bool (SCM obj)
{
/* This must match the macro definition of `scm_is_bool ()'. */
return scm_is_bool_and_not_nil (obj);
}
void
scm_init_boolean ()
{

View file

@ -3,7 +3,7 @@
#ifndef SCM_BOOLEAN_H
#define SCM_BOOLEAN_H
/* Copyright (C) 1995,1996,2000, 2006, 2008, 2009 Free Software Foundation, Inc.
/* Copyright (C) 1995,1996,2000, 2006, 2008, 2009, 2010 Free Software Foundation, Inc.
*
* This library is free software; you can redistribute it and/or
* modify it under the terms of the GNU Lesser General Public License
@ -88,6 +88,8 @@
#define scm_is_bool_and_not_nil(x) \
(SCM_MATCHES_BITS_IN_COMMON ((x), SCM_BOOL_F, SCM_BOOL_T))
SCM_API int scm_is_bool (SCM);
/* XXX Should scm_is_bool treat %nil as a boolean? */
#define scm_is_bool(x) (scm_is_bool_and_not_nil (x))