243 |
goto TOP; |
goto TOP; |
244 |
}*/ |
}*/ |
245 |
|
|
246 |
object on_stack_list_vector_new(int n,object first,va_list ap) |
object on_stack_list_vector_new(fixnum n,object first,va_list ap) |
247 |
{object res=(object) alloca_val; |
{object res=(object) alloca_val; |
248 |
struct cons *p; |
struct cons *p; |
249 |
object x; |
object x; |
279 |
return ans; |
return ans; |
280 |
}*/ |
}*/ |
281 |
|
|
282 |
object list_vector_new(int n,object first,va_list ap) |
object list_vector_new(fixnum n,object first,va_list ap) |
283 |
{object ans,*p; |
{object ans,*p; |
284 |
|
|
285 |
if (n == 0) return Cnil; |
if (n == 0) return Cnil; |
304 |
|
|
305 |
|
|
306 |
|
|
307 |
object list(int n,...) |
object list(fixnum n,...) |
308 |
{ va_list ap; |
{ va_list ap; |
309 |
struct typemanager *tm=(&tm_table[(int)t_cons]); |
struct typemanager *tm=(&tm_table[(int)t_cons]); |
310 |
va_start(ap,n); |
va_start(ap,n); |
322 |
} |
} |
323 |
else |
else |
324 |
{BEGIN_NO_INTERRUPT; |
{BEGIN_NO_INTERRUPT; |
325 |
{int i=0; |
{fixnum i=0; |
326 |
object tail=tm->tm_free; |
object tail=tm->tm_free; |
327 |
object lis; |
object lis; |
328 |
tm->tm_nfree -= n; |
tm->tm_nfree -= n; |
351 |
|
|
352 |
} |
} |
353 |
|
|
354 |
object listA(int n, ...) |
object listA(fixnum n, ...) |
355 |
{ va_list ap; |
{ va_list ap; |
356 |
object *p = vs_top; |
object *p = vs_top; |
357 |
va_start(ap,n); |
va_start(ap,n); |
730 |
|
|
731 |
LFD(Llist_length)() |
LFD(Llist_length)() |
732 |
{ |
{ |
733 |
int n; |
fixnum n; |
734 |
object fast, slow; |
object fast, slow; |
735 |
check_arg(1); |
check_arg(1); |
736 |
n = 0; |
n = 0; |
756 |
|
|
757 |
|
|
758 |
object |
object |
759 |
nth(int n, object x) { |
nth(fixnum n, object x) { |
760 |
|
|
761 |
if (n < 0) { |
if (n < 0) { |
762 |
vs_push(make_fixnum(n)); |
vs_push(make_fixnum(n)); |
781 |
} |
} |
782 |
|
|
783 |
object |
object |
784 |
nthcdr(int n, object x) { |
nthcdr(fixnum n, object x) { |
785 |
|
|
786 |
if (n < 0) { |
if (n < 0) { |
787 |
vs_push(make_fixnum(n)); |
vs_push(make_fixnum(n)); |
797 |
|
|
798 |
LFD(Llast)() { |
LFD(Llast)() { |
799 |
object t; |
object t; |
800 |
int n; |
fixnum n; |
801 |
|
|
802 |
n=vs_top-vs_base; |
n=vs_top-vs_base; |
803 |
if (n<1) |
if (n<1) |
860 |
|
|
861 |
|
|
862 |
object on_stack_make_list(n) |
object on_stack_make_list(n) |
863 |
int n; |
fixnum n; |
864 |
{ object res=(object) alloca_val; |
{ object res=(object) alloca_val; |
865 |
struct cons *p = (struct cons *)res; |
struct cons *p = (struct cons *)res; |
866 |
if (n<=0) return Cnil; |
if (n<=0) return Cnil; |
878 |
} |
} |
879 |
|
|
880 |
object make_list(n) |
object make_list(n) |
881 |
int n; |
fixnum n; |
882 |
{object x =Cnil ; |
{object x =Cnil ; |
883 |
while (n-- > 0) |
while (n-- > 0) |
884 |
x = make_cons(Cnil, x); |
x = make_cons(Cnil, x); |
885 |
return x;} |
return x;} |
886 |
|
|
887 |
@(defun make_list (size &key initial_element &aux x) |
@(defun make_list (size &key initial_element &aux x) |
888 |
int i; |
fixnum i; |
889 |
@ |
@ |
890 |
check_type_non_negative_integer(&size); |
check_type_non_negative_integer(&size); |
891 |
if (type_of(size) != t_fixnum) |
if (type_of(size) != t_fixnum) |
960 |
|
|
961 |
LFD(Lnconc)() { |
LFD(Lnconc)() { |
962 |
object x, l, m=Cnil; |
object x, l, m=Cnil; |
963 |
int i, narg; |
fixnum i, narg; |
964 |
|
|
965 |
narg = vs_top - vs_base - 1; |
narg = vs_top - vs_base - 1; |
966 |
if (narg < 0) { vs_push(Cnil); return; } |
if (narg < 0) { vs_push(Cnil); return; } |
1000 |
} |
} |
1001 |
|
|
1002 |
@(defun butlast (lis &optional (nn `make_fixnum(1)`)) |
@(defun butlast (lis &optional (nn `make_fixnum(1)`)) |
1003 |
int i; |
fixnum i; |
1004 |
@ |
@ |
1005 |
check_type_non_negative_integer(&nn); |
check_type_non_negative_integer(&nn); |
1006 |
if (type_of(nn) != t_fixnum) |
if (type_of(nn) != t_fixnum) |
1021 |
@) |
@) |
1022 |
|
|
1023 |
@(defun nbutlast (lis &optional (nn `make_fixnum(1)`)) |
@(defun nbutlast (lis &optional (nn `make_fixnum(1)`)) |
1024 |
int i; |
fixnum i; |
1025 |
object x; |
object x; |
1026 |
@ |
@ |
1027 |
check_type_non_negative_integer(&nn); |
check_type_non_negative_integer(&nn); |
1038 |
@) |
@) |
1039 |
|
|
1040 |
LFD(Lldiff)() { |
LFD(Lldiff)() { |
1041 |
int i; |
fixnum i; |
1042 |
object x; |
object x; |
1043 |
|
|
1044 |
check_arg(2); |
check_arg(2); |