diff options
author | Andy Wingo <wingo@pobox.com> | 2009-09-03 11:57:29 +0200 |
---|---|---|
committer | Andy Wingo <wingo@pobox.com> | 2009-12-03 15:22:07 +0100 |
commit | df338a22646fa6a783d72d67f3e6c4d4aee65c72 (patch) | |
tree | df8dc86dade6e55d70d33fb8fdd624d4c5006d47 /libguile/array-map.c | |
parent | df9ca8d8b2f48e7042298a9a788b749b46fc5efc (diff) | |
download | guile-df338a22646fa6a783d72d67f3e6c4d4aee65c72.tar.gz |
remove tc7_subr_* and tc7_lsubr_*
* libguile/tags.h: Remove tc7 #defines for subrs, replacing them with
placeholders. These were public, but hopfully unused. I don't see how
to usefully deprecate them.
* libguile/array-map.c (scm_array_map_x): Remove special cases for
certain subr types. This might make things slower for the moment,
otoh, native compilation should moot that question.
* libguile/eval.i.c:
* libguile/eval.c: Remove subr-handling cases. To regain this speed and
more won't have to wait for native compilation, though -- this change
smooths the way for subr dispatch in the VM.
* libguile/gsubr.c (scm_i_gsubr_apply): Fix a bug in which we didn't
detect too-many-arguments. This would only show up when using ceval,
as only ceval called this function.
* test-suite/tests/ramap.test ("array-map!"): Change the expected
exception if passed a procedure of the wrong arity. It now gives
wrong-num-args.
more won't have to wait for native compilation, though -- this change
smooths the way for subr dispatch in the VM.
* libguile/goops.c (scm_class_of): Remove subr cases. No speed
implication.
* libguile/objects.c (scm_valid_object_procedure_p): Remove this public
but undocumented, and useless, function. I do not think this will
affect anyone at all.
(scm_set_object_procedure_x): Replace a call to
scm_valid_object_procedure_p with scm_procedure_p, and actually wrap
with a scm_is_true.
* module/oop/goops.scm (initialize-object-procedure): Don't call
valid-object-procedure?.
Diffstat (limited to 'libguile/array-map.c')
-rw-r--r-- | libguile/array-map.c | 37 |
1 files changed, 1 insertions, 36 deletions
diff --git a/libguile/array-map.c b/libguile/array-map.c index eaac54a1f..89e6ec987 100644 --- a/libguile/array-map.c +++ b/libguile/array-map.c @@ -742,26 +742,6 @@ ramap_rp (SCM ra0, SCM proc, SCM ras) static int -ramap_1 (SCM ra0, SCM proc, SCM ras) -{ - SCM ra1 = SCM_CAR (ras); - long n = SCM_I_ARRAY_DIMS (ra0)->ubnd - SCM_I_ARRAY_DIMS (ra0)->lbnd + 1; - unsigned long i0 = SCM_I_ARRAY_BASE (ra0), i1 = SCM_I_ARRAY_BASE (ra1); - long inc0 = SCM_I_ARRAY_DIMS (ra0)->inc, inc1 = SCM_I_ARRAY_DIMS (ra1)->inc; - ra0 = SCM_I_ARRAY_V (ra0); - ra1 = SCM_I_ARRAY_V (ra1); - if (scm_tc7_vector == SCM_TYP7 (ra0) || scm_tc7_wvect == SCM_TYP7 (ra0)) - for (; n-- > 0; i0 += inc0, i1 += inc1) - GVSET (ra0, i0, SCM_SUBRF (proc) (GVREF (ra1, i1))); - else - for (; n-- > 0; i0 += inc0, i1 += inc1) - GVSET (ra0, i0, SCM_SUBRF (proc) (GVREF (ra1, i1))); - return 1; -} - - - -static int ramap_2o (SCM ra0, SCM proc, SCM ras) { SCM ra1 = SCM_CAR (ras); @@ -835,22 +815,7 @@ SCM_DEFINE (scm_array_map_x, "array-map!", 2, 0, 1, { default: gencase: - scm_ramapc (ramap, proc, ra0, lra, FUNC_NAME); - return SCM_UNSPECIFIED; - case scm_tc7_subr_1: - if (! scm_is_pair (lra)) - SCM_WRONG_NUM_ARGS (); /* need 1 source */ - scm_ramapc (ramap_1, proc, ra0, lra, FUNC_NAME); - return SCM_UNSPECIFIED; - case scm_tc7_subr_2: - if (! (scm_is_pair (lra) && scm_is_pair (SCM_CDR (lra)))) - SCM_WRONG_NUM_ARGS (); /* need 2 sources */ - goto subr_2o; - case scm_tc7_subr_2o: - if (! scm_is_pair (lra)) - SCM_WRONG_NUM_ARGS (); /* need 1 source */ - subr_2o: - scm_ramapc (ramap_2o, proc, ra0, lra, FUNC_NAME); + scm_ramapc (ramap, proc, ra0, lra, FUNC_NAME); return SCM_UNSPECIFIED; case scm_tc7_dsubr: if (! scm_is_pair (lra)) |