1 |
/* Copyright (C) 1998,1999,2000,2001,2002 Free Software Foundation, Inc. |
/* Copyright (C) 1998,1999,2000,2001,2002, 2003 Free Software Foundation, Inc. |
2 |
* |
* |
3 |
* This program is free software; you can redistribute it and/or modify |
* This program is free software; you can redistribute it and/or modify |
4 |
* it under the terms of the GNU General Public License as published by |
* it under the terms of the GNU General Public License as published by |
146 |
|
|
147 |
SCM_REGISTER_PROC (s_map_in_order, "map-in-order", 2, 0, 1, scm_map); |
SCM_REGISTER_PROC (s_map_in_order, "map-in-order", 2, 0, 1, scm_map); |
148 |
|
|
149 |
|
SCM_DEFINE (scm_self_evaluating_p, "self-evaluating?", 1, 0, 0, |
150 |
|
(SCM obj), |
151 |
|
"Return #t for objects which Guile considers self-evaluating") |
152 |
|
#define FUNC_NAME s_scm_self_evaluating_p |
153 |
|
{ |
154 |
|
switch (SCM_ITAG3 (obj)) |
155 |
|
{ |
156 |
|
case scm_tc3_int_1: |
157 |
|
case scm_tc3_int_2: |
158 |
|
/* inum */ |
159 |
|
return SCM_BOOL_T; |
160 |
|
case scm_tc3_imm24: |
161 |
|
/* characters, booleans, other immediates */ |
162 |
|
return SCM_BOOL (!SCM_NULLP (obj)); |
163 |
|
case scm_tc3_cons: |
164 |
|
switch (SCM_TYP7 (obj)) |
165 |
|
{ |
166 |
|
case scm_tcs_closures: |
167 |
|
case scm_tc7_vector: |
168 |
|
case scm_tc7_wvect: |
169 |
|
#ifdef HAVE_ARRAYS |
170 |
|
case scm_tc7_bvect: |
171 |
|
case scm_tc7_byvect: |
172 |
|
case scm_tc7_svect: |
173 |
|
case scm_tc7_ivect: |
174 |
|
case scm_tc7_uvect: |
175 |
|
case scm_tc7_fvect: |
176 |
|
case scm_tc7_dvect: |
177 |
|
case scm_tc7_cvect: |
178 |
|
#ifdef HAVE_LONG_LONGS |
179 |
|
case scm_tc7_llvect: |
180 |
|
#endif |
181 |
|
#endif |
182 |
|
case scm_tc7_string: |
183 |
|
case scm_tc7_smob: |
184 |
|
case scm_tc7_cclo: |
185 |
|
case scm_tc7_pws: |
186 |
|
case scm_tcs_subrs: |
187 |
|
case scm_tcs_struct: |
188 |
|
return SCM_BOOL_T; |
189 |
|
default: |
190 |
|
return SCM_BOOL_F; |
191 |
|
} |
192 |
|
} |
193 |
|
SCM_MISC_ERROR ("Internal error: Object ~S has unknown type", |
194 |
|
scm_list_1 (obj)); |
195 |
|
return SCM_UNSPECIFIED; /* never reached */ |
196 |
|
} |
197 |
|
#undef FUNC_NAME |
198 |
|
|
199 |
void |
void |
200 |
scm_init_evalext () |
scm_init_evalext () |
201 |
{ |
{ |