mirror of
https://gitlab.com/embeddable-common-lisp/ecl.git
synced 2026-01-13 12:52:08 -08:00
Signal a TYPE-ERROR in [N]BUTLAST or MAKE-LIST when argument is not an integer.
This commit is contained in:
parent
6a7c791985
commit
0d7b6e58c1
1 changed files with 5 additions and 4 deletions
|
|
@ -365,8 +365,7 @@ nthcdr(cl_fixnum n, cl_object x)
|
|||
@(defun make_list (size &key initial_element &aux x)
|
||||
cl_fixnum i;
|
||||
@
|
||||
if (!FIXNUMP(size))
|
||||
FEerror("Cannot make a list of the size ~D.", 1, size);
|
||||
/* INV: fixnnint() signals a type-error if SIZE is not a integer >=0 */
|
||||
i = fixnnint(size);
|
||||
while (i-- > 0)
|
||||
x = CONS(initial_element, x);
|
||||
|
|
@ -483,8 +482,9 @@ cl_nreconc(cl_object l, cl_object y)
|
|||
cl_fixnum delay;
|
||||
@
|
||||
/* INV: No list has more than MOST_POSITIVE_FIXNUM elements */
|
||||
if (!FIXNUMP(nn))
|
||||
if (type_of(nn) == t_bignum)
|
||||
@(return Cnil)
|
||||
/* INV: fixnnint() signas a type-error if NN is not an integer >=0 */
|
||||
delay = fixnnint(nn);
|
||||
r = lis;
|
||||
loop_for_on(lis) {
|
||||
|
|
@ -503,8 +503,9 @@ cl_nreconc(cl_object l, cl_object y)
|
|||
cl_object x, r;
|
||||
@
|
||||
/* INV: No list has more than MOST_POSITIVE_FIXNUM elements */
|
||||
if (!FIXNUMP(nn))
|
||||
if (type_of(nn) == t_bignum)
|
||||
@(return Cnil)
|
||||
/* INV: fixnnint() signas a type-error if NN is not an integer >=0 */
|
||||
/* We add 1 because at the end `r' must point to the
|
||||
cons that must be modified */
|
||||
delay = fixnnint(nn)+1;
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue