488 |
case scm_tc7_vector: |
case scm_tc7_vector: |
489 |
case scm_tc7_wvect: |
case scm_tc7_wvect: |
490 |
for (i = base; n--; i += inc) |
for (i = base; n--; i += inc) |
491 |
SCM_VELTS (ra)[i] = fill; |
SCM_VECTOR_SET (ra, i, fill); |
492 |
break; |
break; |
493 |
case scm_tc7_string: |
case scm_tc7_string: |
494 |
SCM_ASRTGO (SCM_CHARP (fill), badarg2); |
SCM_ASRTGO (SCM_CHARP (fill), badarg2); |
905 |
/* opt 0 means <, nonzero means >= */ |
/* opt 0 means <, nonzero means >= */ |
906 |
|
|
907 |
static int |
static int |
908 |
ra_compare (SCM ra0,SCM ra1,SCM ra2,int opt) |
ra_compare (SCM ra0, SCM ra1, SCM ra2, int opt) |
909 |
{ |
{ |
910 |
long n = SCM_ARRAY_DIMS (ra0)->ubnd - SCM_ARRAY_DIMS (ra0)->lbnd + 1; |
long n = SCM_ARRAY_DIMS (ra0)->ubnd - SCM_ARRAY_DIMS (ra0)->lbnd + 1; |
911 |
unsigned long i0 = SCM_ARRAY_BASE (ra0), i1 = SCM_ARRAY_BASE (ra1), i2 = SCM_ARRAY_BASE (ra2); |
unsigned long i0 = SCM_ARRAY_BASE (ra0), i1 = SCM_ARRAY_BASE (ra1), i2 = SCM_ARRAY_BASE (ra2); |
1230 |
|
|
1231 |
|
|
1232 |
static int |
static int |
1233 |
ramap (SCM ra0,SCM proc,SCM ras) |
ramap (SCM ra0, SCM proc, SCM ras) |
1234 |
{ |
{ |
1235 |
long i = SCM_ARRAY_DIMS (ra0)->lbnd; |
long i = SCM_ARRAY_DIMS (ra0)->lbnd; |
1236 |
long inc = SCM_ARRAY_DIMS (ra0)->inc; |
long inc = SCM_ARRAY_DIMS (ra0)->inc; |
1243 |
else |
else |
1244 |
{ |
{ |
1245 |
SCM ra1 = SCM_CAR (ras); |
SCM ra1 = SCM_CAR (ras); |
1246 |
SCM args, *ve = &ras; |
SCM args; |
1247 |
|
SCM const *ve = &ras; |
1248 |
unsigned long k, i1 = SCM_ARRAY_BASE (ra1); |
unsigned long k, i1 = SCM_ARRAY_BASE (ra1); |
1249 |
long inc1 = SCM_ARRAY_DIMS (ra1)->inc; |
long inc1 = SCM_ARRAY_DIMS (ra1)->inc; |
1250 |
ra1 = SCM_ARRAY_V (ra1); |
ra1 = SCM_ARRAY_V (ra1); |
1256 |
ras = scm_vector (ras); |
ras = scm_vector (ras); |
1257 |
ve = SCM_VELTS (ras); |
ve = SCM_VELTS (ras); |
1258 |
} |
} |
1259 |
|
|
1260 |
for (; i <= n; i++, i1 += inc1) |
for (; i <= n; i++, i1 += inc1) |
1261 |
{ |
{ |
1262 |
args = SCM_EOL; |
args = SCM_EOL; |
1271 |
|
|
1272 |
|
|
1273 |
static int |
static int |
1274 |
ramap_cxr (SCM ra0,SCM proc,SCM ras) |
ramap_cxr (SCM ra0, SCM proc, SCM ras) |
1275 |
{ |
{ |
1276 |
SCM ra1 = SCM_CAR (ras); |
SCM ra1 = SCM_CAR (ras); |
1277 |
SCM e1 = SCM_UNDEFINED; |
SCM e1 = SCM_UNDEFINED; |
1332 |
|
|
1333 |
|
|
1334 |
static int |
static int |
1335 |
ramap_rp (SCM ra0,SCM proc,SCM ras) |
ramap_rp (SCM ra0, SCM proc, SCM ras) |
1336 |
{ |
{ |
1337 |
SCM ra1 = SCM_CAR (ras), ra2 = SCM_CAR (SCM_CDR (ras)); |
SCM ra1 = SCM_CAR (ras), ra2 = SCM_CAR (SCM_CDR (ras)); |
1338 |
SCM e1 = SCM_UNDEFINED, e2 = SCM_UNDEFINED; |
SCM e1 = SCM_UNDEFINED, e2 = SCM_UNDEFINED; |
1417 |
|
|
1418 |
|
|
1419 |
static int |
static int |
1420 |
ramap_1 (SCM ra0,SCM proc,SCM ras) |
ramap_1 (SCM ra0, SCM proc, SCM ras) |
1421 |
{ |
{ |
1422 |
SCM ra1 = SCM_CAR (ras); |
SCM ra1 = SCM_CAR (ras); |
1423 |
SCM e1 = SCM_UNDEFINED; |
SCM e1 = SCM_UNDEFINED; |
1438 |
|
|
1439 |
|
|
1440 |
static int |
static int |
1441 |
ramap_2o (SCM ra0,SCM proc,SCM ras) |
ramap_2o (SCM ra0, SCM proc, SCM ras) |
1442 |
{ |
{ |
1443 |
SCM ra1 = SCM_CAR (ras); |
SCM ra1 = SCM_CAR (ras); |
1444 |
SCM e1 = SCM_UNDEFINED; |
SCM e1 = SCM_UNDEFINED; |
1485 |
|
|
1486 |
|
|
1487 |
static int |
static int |
1488 |
ramap_a (SCM ra0,SCM proc,SCM ras) |
ramap_a (SCM ra0, SCM proc, SCM ras) |
1489 |
{ |
{ |
1490 |
SCM e0 = SCM_UNDEFINED, e1 = SCM_UNDEFINED; |
SCM e0 = SCM_UNDEFINED, e1 = SCM_UNDEFINED; |
1491 |
long n = SCM_ARRAY_DIMS (ra0)->ubnd - SCM_ARRAY_DIMS (ra0)->lbnd + 1; |
long n = SCM_ARRAY_DIMS (ra0)->ubnd - SCM_ARRAY_DIMS (ra0)->lbnd + 1; |
1523 |
"unspecified. The order of application is unspecified.") |
"unspecified. The order of application is unspecified.") |
1524 |
#define FUNC_NAME s_scm_array_map_x |
#define FUNC_NAME s_scm_array_map_x |
1525 |
{ |
{ |
1526 |
SCM_VALIDATE_PROC (2,proc); |
SCM_VALIDATE_PROC (2, proc); |
1527 |
SCM_VALIDATE_REST_ARGUMENT (lra); |
SCM_VALIDATE_REST_ARGUMENT (lra); |
1528 |
switch (SCM_TYP7 (proc)) |
switch (SCM_TYP7 (proc)) |
1529 |
{ |
{ |
1626 |
|
|
1627 |
|
|
1628 |
static int |
static int |
1629 |
rafe (SCM ra0,SCM proc,SCM ras) |
rafe (SCM ra0, SCM proc, SCM ras) |
1630 |
{ |
{ |
1631 |
long i = SCM_ARRAY_DIMS (ra0)->lbnd; |
long i = SCM_ARRAY_DIMS (ra0)->lbnd; |
1632 |
unsigned long i0 = SCM_ARRAY_BASE (ra0); |
unsigned long i0 = SCM_ARRAY_BASE (ra0); |
1639 |
else |
else |
1640 |
{ |
{ |
1641 |
SCM ra1 = SCM_CAR (ras); |
SCM ra1 = SCM_CAR (ras); |
1642 |
SCM args, *ve = &ras; |
SCM args; |
1643 |
|
SCM const*ve = &ras; |
1644 |
unsigned long k, i1 = SCM_ARRAY_BASE (ra1); |
unsigned long k, i1 = SCM_ARRAY_BASE (ra1); |
1645 |
long inc1 = SCM_ARRAY_DIMS (ra1)->inc; |
long inc1 = SCM_ARRAY_DIMS (ra1)->inc; |
1646 |
ra1 = SCM_ARRAY_V (ra1); |
ra1 = SCM_ARRAY_V (ra1); |
1671 |
"in row-major order. The value returned is unspecified.") |
"in row-major order. The value returned is unspecified.") |
1672 |
#define FUNC_NAME s_scm_array_for_each |
#define FUNC_NAME s_scm_array_for_each |
1673 |
{ |
{ |
1674 |
SCM_VALIDATE_PROC (1,proc); |
SCM_VALIDATE_PROC (1, proc); |
1675 |
SCM_VALIDATE_REST_ARGUMENT (lra); |
SCM_VALIDATE_REST_ARGUMENT (lra); |
1676 |
scm_ramapc (rafe, proc, ra0, lra, FUNC_NAME); |
scm_ramapc (rafe, proc, ra0, lra, FUNC_NAME); |
1677 |
return SCM_UNSPECIFIED; |
return SCM_UNSPECIFIED; |
1700 |
#define FUNC_NAME s_scm_array_index_map_x |
#define FUNC_NAME s_scm_array_index_map_x |
1701 |
{ |
{ |
1702 |
unsigned long i; |
unsigned long i; |
1703 |
SCM_VALIDATE_NIM (1,ra); |
SCM_VALIDATE_NIM (1, ra); |
1704 |
SCM_VALIDATE_PROC (2,proc); |
SCM_VALIDATE_PROC (2, proc); |
1705 |
switch (SCM_TYP7(ra)) |
switch (SCM_TYP7(ra)) |
1706 |
{ |
{ |
1707 |
default: |
default: |
1709 |
case scm_tc7_vector: |
case scm_tc7_vector: |
1710 |
case scm_tc7_wvect: |
case scm_tc7_wvect: |
1711 |
{ |
{ |
|
SCM *ve = SCM_VELTS (ra); |
|
1712 |
for (i = 0; i < SCM_VECTOR_LENGTH (ra); i++) |
for (i = 0; i < SCM_VECTOR_LENGTH (ra); i++) |
1713 |
ve[i] = scm_call_1 (proc, SCM_MAKINUM (i)); |
SCM_VECTOR_SET(ra, i, scm_call_1 (proc, SCM_MAKINUM (i))); |
1714 |
return SCM_UNSPECIFIED; |
return SCM_UNSPECIFIED; |
1715 |
} |
} |
1716 |
case scm_tc7_string: |
case scm_tc7_string: |
1780 |
|
|
1781 |
|
|
1782 |
static int |
static int |
1783 |
raeql_1 (SCM ra0,SCM as_equal,SCM ra1) |
raeql_1 (SCM ra0, SCM as_equal, SCM ra1) |
1784 |
{ |
{ |
1785 |
SCM e0 = SCM_UNDEFINED, e1 = SCM_UNDEFINED; |
SCM e0 = SCM_UNDEFINED, e1 = SCM_UNDEFINED; |
1786 |
unsigned long i0 = 0, i1 = 0; |
unsigned long i0 = 0, i1 = 0; |
1908 |
|
|
1909 |
|
|
1910 |
static int |
static int |
1911 |
raeql (SCM ra0,SCM as_equal,SCM ra1) |
raeql (SCM ra0, SCM as_equal, SCM ra1) |
1912 |
{ |
{ |
1913 |
SCM v0 = ra0, v1 = ra1; |
SCM v0 = ra0, v1 = ra1; |
1914 |
scm_t_array_dim dim0, dim1; |
scm_t_array_dim dim0, dim1; |