mirror of
https://git.savannah.gnu.org/git/guile.git
synced 2025-05-23 21:10:29 +02:00
(scm_array_map_x): Allow no source args, add num args checks
to subr_1, subr_2, subr_2o and cxr cases.
This commit is contained in:
parent
37aa7d870c
commit
09cd7e1d3a
1 changed files with 11 additions and 4 deletions
|
@ -1,4 +1,4 @@
|
||||||
/* Copyright (C) 1996,1998,2000,2001 Free Software Foundation, Inc.
|
/* Copyright (C) 1996,1998,2000,2001,2002,2004,2005 Free Software Foundation, Inc.
|
||||||
*
|
*
|
||||||
* This program is free software; you can redistribute it and/or modify
|
* This program is free software; you can redistribute it and/or modify
|
||||||
* 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
|
||||||
|
@ -1529,9 +1529,6 @@ SCM_DEFINE (scm_array_map_x, "array-map!", 2, 0, 1,
|
||||||
{
|
{
|
||||||
SCM_VALIDATE_PROC (2,proc);
|
SCM_VALIDATE_PROC (2,proc);
|
||||||
|
|
||||||
if (!(SCM_CONSP (sources)))
|
|
||||||
SCM_WRONG_NUM_ARGS ();
|
|
||||||
|
|
||||||
switch (SCM_TYP7 (proc))
|
switch (SCM_TYP7 (proc))
|
||||||
{
|
{
|
||||||
default:
|
default:
|
||||||
|
@ -1539,15 +1536,25 @@ SCM_DEFINE (scm_array_map_x, "array-map!", 2, 0, 1,
|
||||||
scm_ramapc (ramap, proc, dest, sources, FUNC_NAME);
|
scm_ramapc (ramap, proc, dest, sources, FUNC_NAME);
|
||||||
return SCM_UNSPECIFIED;
|
return SCM_UNSPECIFIED;
|
||||||
case scm_tc7_subr_1:
|
case scm_tc7_subr_1:
|
||||||
|
if (! SCM_CONSP (sources))
|
||||||
|
SCM_WRONG_NUM_ARGS (); /* need 1 source */
|
||||||
scm_ramapc (ramap_1, proc, dest, sources, FUNC_NAME);
|
scm_ramapc (ramap_1, proc, dest, sources, FUNC_NAME);
|
||||||
return SCM_UNSPECIFIED;
|
return SCM_UNSPECIFIED;
|
||||||
case scm_tc7_subr_2:
|
case scm_tc7_subr_2:
|
||||||
|
if (! (SCM_CONSP (sources) && SCM_CONSP (SCM_CDR (sources))))
|
||||||
|
SCM_WRONG_NUM_ARGS (); /* need 2 sources */
|
||||||
|
goto subr_2o;
|
||||||
case scm_tc7_subr_2o:
|
case scm_tc7_subr_2o:
|
||||||
|
if (! SCM_CONSP (sources))
|
||||||
|
SCM_WRONG_NUM_ARGS (); /* need 1 source */
|
||||||
|
subr_2o:
|
||||||
scm_ramapc (ramap_2o, proc, dest, sources, FUNC_NAME);
|
scm_ramapc (ramap_2o, proc, dest, sources, FUNC_NAME);
|
||||||
return SCM_UNSPECIFIED;
|
return SCM_UNSPECIFIED;
|
||||||
case scm_tc7_cxr:
|
case scm_tc7_cxr:
|
||||||
if (!SCM_SUBRF (proc))
|
if (!SCM_SUBRF (proc))
|
||||||
goto gencase;
|
goto gencase;
|
||||||
|
if (! SCM_CONSP (sources))
|
||||||
|
SCM_WRONG_NUM_ARGS (); /* need 1 source */
|
||||||
scm_ramapc (ramap_cxr, proc, dest, sources, FUNC_NAME);
|
scm_ramapc (ramap_cxr, proc, dest, sources, FUNC_NAME);
|
||||||
return SCM_UNSPECIFIED;
|
return SCM_UNSPECIFIED;
|
||||||
case scm_tc7_rpsubr:
|
case scm_tc7_rpsubr:
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue