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?.
This commit is contained in:
parent
df9ca8d8b2
commit
df338a2264
11 changed files with 18 additions and 154 deletions
|
|
@ -741,26 +741,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)
|
||||
{
|
||||
|
|
@ -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))
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue