Commit | Line | Data |
---|---|---|
2b829bbb | 1 | /* Copyright (C) 1995,1996,1997, 2000, 2001, 2006 Free Software Foundation, Inc. |
ee2a8b9b | 2 | |
73be1d9e MV |
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. | |
ee2a8b9b | 7 | * |
73be1d9e MV |
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. | |
ee2a8b9b | 12 | * |
73be1d9e MV |
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 | |
92205699 | 15 | * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA |
73be1d9e | 16 | */ |
ee2a8b9b JB |
17 | \f |
18 | ||
19 | /* type predicates and equality predicates */ | |
20 | ||
a0599745 | 21 | #include "libguile/gh.h" |
ee2a8b9b | 22 | |
5c56ebe1 MV |
23 | #if SCM_ENABLE_DEPRECATED |
24 | ||
ee2a8b9b JB |
25 | /* type predicates: tell you if an SCM object has a given type */ |
26 | int | |
27 | gh_boolean_p (SCM val) | |
28 | { | |
7888309b | 29 | return (scm_is_true (scm_boolean_p (val))); |
ee2a8b9b JB |
30 | } |
31 | int | |
32 | gh_symbol_p (SCM val) | |
33 | { | |
7888309b | 34 | return (scm_is_true (scm_symbol_p (val))); |
ee2a8b9b JB |
35 | } |
36 | int | |
37 | gh_char_p (SCM val) | |
38 | { | |
7888309b | 39 | return (scm_is_true (scm_char_p (val))); |
ee2a8b9b JB |
40 | } |
41 | int | |
42 | gh_vector_p (SCM val) | |
43 | { | |
7888309b | 44 | return (scm_is_true (scm_vector_p (val))); |
ee2a8b9b JB |
45 | } |
46 | int | |
47 | gh_pair_p (SCM val) | |
48 | { | |
7888309b | 49 | return (scm_is_true (scm_pair_p (val))); |
ee2a8b9b JB |
50 | } |
51 | int | |
52 | gh_number_p (SCM val) | |
53 | { | |
7888309b | 54 | return (scm_is_true (scm_number_p (val))); |
ee2a8b9b JB |
55 | } |
56 | int | |
57 | gh_string_p (SCM val) | |
58 | { | |
7888309b | 59 | return (scm_is_true (scm_string_p (val))); |
ee2a8b9b JB |
60 | } |
61 | int | |
62 | gh_procedure_p (SCM val) | |
63 | { | |
7888309b | 64 | return (scm_is_true (scm_procedure_p (val))); |
ee2a8b9b JB |
65 | } |
66 | int | |
67 | gh_list_p (SCM val) | |
68 | { | |
7888309b | 69 | return (scm_is_true (scm_list_p (val))); |
ee2a8b9b JB |
70 | } |
71 | int | |
72 | gh_inexact_p (SCM val) | |
73 | { | |
7888309b | 74 | return (scm_is_true (scm_inexact_p (val))); |
ee2a8b9b JB |
75 | } |
76 | int | |
77 | gh_exact_p (SCM val) | |
78 | { | |
7888309b | 79 | return (scm_is_true (scm_exact_p (val))); |
ee2a8b9b JB |
80 | } |
81 | ||
82 | /* the three types of equality */ | |
83 | int | |
84 | gh_eq_p (SCM x, SCM y) | |
85 | { | |
7888309b | 86 | return (scm_is_true (scm_eq_p (x, y))); |
ee2a8b9b JB |
87 | } |
88 | int | |
89 | gh_eqv_p (SCM x, SCM y) | |
90 | { | |
7888309b | 91 | return (scm_is_true (scm_eqv_p (x, y))); |
ee2a8b9b JB |
92 | } |
93 | int | |
94 | gh_equal_p (SCM x, SCM y) | |
95 | { | |
7888309b | 96 | return (scm_is_true (scm_equal_p (x, y))); |
ee2a8b9b | 97 | } |
7fee59bd MG |
98 | |
99 | /* equivalent to (string=? ...), but returns 0 or 1 rather than Scheme | |
100 | booleans */ | |
101 | int | |
102 | gh_string_equal_p(SCM s1, SCM s2) | |
103 | { | |
7888309b | 104 | return (scm_is_true (scm_string_equal_p(s1, s2))); |
7fee59bd MG |
105 | } |
106 | ||
107 | /* equivalent to (null? ...), but returns 0 or 1 rather than Scheme | |
108 | booleans */ | |
109 | int | |
110 | gh_null_p(SCM l) | |
111 | { | |
7888309b | 112 | return (scm_is_true(scm_null_p(l))); |
7fee59bd | 113 | } |
89e00824 | 114 | |
5c56ebe1 MV |
115 | #endif /* SCM_ENABLE_DEPRECATED */ |
116 | ||
89e00824 ML |
117 | /* |
118 | Local Variables: | |
119 | c-file-style: "gnu" | |
120 | End: | |
121 | */ |