/[gcl]/gcl/o/list.d
ViewVC logotype

Diff of /gcl/o/list.d

Parent Directory Parent Directory | Revision Log Revision Log | View Patch Patch

revision 1.23 by camm, Sat Jul 24 13:14:30 2004 UTC revision 1.24 by camm, Sun Nov 28 04:31:08 2004 UTC
# Line 243  stack_cons(void) Line 243  stack_cons(void)
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;
# Line 279  object on_stack_list_vector_new(int n,ob Line 279  object on_stack_list_vector_new(int n,ob
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;
# Line 304  object list_vector_new(int n,object firs Line 304  object list_vector_new(int n,object firs
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);
# Line 322  object list(int n,...) Line 322  object list(int 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;
# Line 351  object list(int n,...) Line 351  object list(int 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);
# Line 730  LFD(Lendp)() Line 730  LFD(Lendp)()
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;
# Line 756  LFD(Llist_length)() Line 756  LFD(Llist_length)()
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));
# Line 781  LFD(Lnthcdr)() Line 781  LFD(Lnthcdr)()
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));
# Line 797  nthcdr(int n, object x) { Line 797  nthcdr(int n, object x) {
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)
# Line 860  object x; Line 860  object x;
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;
# Line 878  int n; Line 878  int n;
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)
# Line 960  nconc(object x, object y) { Line 960  nconc(object x, object y) {
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; }
# Line 1000  LFD(Lreconc)() { Line 1000  LFD(Lreconc)() {
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)
# Line 1021  LFD(Lreconc)() { Line 1021  LFD(Lreconc)() {
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);
# Line 1038  LFD(Lreconc)() { Line 1038  LFD(Lreconc)() {
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);

Legend:
Removed from v.1.23  
changed lines
  Added in v.1.24

savannah-hackers-public@gnu.org
ViewVC Help
Powered by ViewVC 1.1.26