1
Fork 0
mirror of https://git.savannah.gnu.org/git/guile.git synced 2025-04-30 03:40:34 +02:00

(scm_is_true, scm_is_false, scm_from_bool, scm_to_bool): New.

This commit is contained in:
Marius Vollmer 2004-07-05 17:13:39 +00:00
parent e4e249c1b8
commit 3a684cc6c9
2 changed files with 23 additions and 0 deletions

View file

@ -45,7 +45,22 @@ SCM_DEFINE (scm_boolean_p, "boolean?", 1, 0, 0,
}
#undef FUNC_NAME
int
scm_is_bool (SCM x)
{
return scm_is_eq (x, SCM_BOOL_F) || scm_is_eq (SCM_BOOL_T);
}
int
scm_to_bool (SCM x)
{
if (scm_is_eq (x, SCM_BOOL_F))
return 0;
else if (scm_is_eq (x, SCM_BOOL_T))
return 1;
else
scm_wrong_type_arg (NULL, 0, x);
}
void
scm_init_boolean ()