Enclose `regexp.test' in a module.
[bpt/guile.git] / libguile / gh_predicates.c
1 /* Copyright (C) 1995,1996,1997, 2000, 2001, 2006, 2008 Free Software Foundation, Inc.
2
3 * This library is free software; you can redistribute it and/or
4 * modify it under the terms of the GNU Lesser General Public
5 * License as published by the Free Software Foundation; either
6 * version 2.1 of the License, or (at your option) any later version.
7 *
8 * This library is distributed in the hope that it will be useful,
9 * but WITHOUT ANY WARRANTY; without even the implied warranty of
10 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
11 * Lesser General Public License for more details.
12 *
13 * You should have received a copy of the GNU Lesser General Public
14 * License along with this library; if not, write to the Free Software
15 * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
16 */
17 \f
18 #ifdef HAVE_CONFIG_H
19 # include <config.h>
20 #endif
21
22 /* type predicates and equality predicates */
23
24 #include "libguile/gh.h"
25
26 #if SCM_ENABLE_DEPRECATED
27
28 /* type predicates: tell you if an SCM object has a given type */
29 int
30 gh_boolean_p (SCM val)
31 {
32 return (scm_is_true (scm_boolean_p (val)));
33 }
34 int
35 gh_symbol_p (SCM val)
36 {
37 return (scm_is_true (scm_symbol_p (val)));
38 }
39 int
40 gh_char_p (SCM val)
41 {
42 return (scm_is_true (scm_char_p (val)));
43 }
44 int
45 gh_vector_p (SCM val)
46 {
47 return (scm_is_true (scm_vector_p (val)));
48 }
49 int
50 gh_pair_p (SCM val)
51 {
52 return (scm_is_true (scm_pair_p (val)));
53 }
54 int
55 gh_number_p (SCM val)
56 {
57 return (scm_is_true (scm_number_p (val)));
58 }
59 int
60 gh_string_p (SCM val)
61 {
62 return (scm_is_true (scm_string_p (val)));
63 }
64 int
65 gh_procedure_p (SCM val)
66 {
67 return (scm_is_true (scm_procedure_p (val)));
68 }
69 int
70 gh_list_p (SCM val)
71 {
72 return (scm_is_true (scm_list_p (val)));
73 }
74 int
75 gh_inexact_p (SCM val)
76 {
77 return (scm_is_true (scm_inexact_p (val)));
78 }
79 int
80 gh_exact_p (SCM val)
81 {
82 return (scm_is_true (scm_exact_p (val)));
83 }
84
85 /* the three types of equality */
86 int
87 gh_eq_p (SCM x, SCM y)
88 {
89 return (scm_is_true (scm_eq_p (x, y)));
90 }
91 int
92 gh_eqv_p (SCM x, SCM y)
93 {
94 return (scm_is_true (scm_eqv_p (x, y)));
95 }
96 int
97 gh_equal_p (SCM x, SCM y)
98 {
99 return (scm_is_true (scm_equal_p (x, y)));
100 }
101
102 /* equivalent to (string=? ...), but returns 0 or 1 rather than Scheme
103 booleans */
104 int
105 gh_string_equal_p(SCM s1, SCM s2)
106 {
107 return (scm_is_true (scm_string_equal_p(s1, s2)));
108 }
109
110 /* equivalent to (null? ...), but returns 0 or 1 rather than Scheme
111 booleans */
112 int
113 gh_null_p(SCM l)
114 {
115 return (scm_is_true(scm_null_p(l)));
116 }
117
118 #endif /* SCM_ENABLE_DEPRECATED */
119
120 /*
121 Local Variables:
122 c-file-style: "gnu"
123 End:
124 */