/[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.5 by camm, Tue Jul 30 21:28:06 2002 UTC revision 1.6 by camm, Tue Aug 20 05:42:47 2002 UTC
# Line 152  object x; Line 152  object x;
152    
153          if (type_of(x) == t_cons)          if (type_of(x) == t_cons)
154                  return(FALSE);                  return(FALSE);
155          else if (x == Cnil)          else/* if (x == Cnil)*/
156                  return(TRUE);                  return(TRUE);
157          vs_push(x);          vs_push(x);
158          FEwrong_type_argument(sLlist, x);          FEwrong_type_argument(sLlist, x);
# Line 786  object x; Line 786  object x;
786    
787  void  void
788  Llast()  Llast()
789  {       object endp_temp;  {       object endp_temp,t;
790          check_arg(1);          int n;
791    
792            n=vs_top-vs_base;
793            if (n!=1 && n!=2)
794                    FEerror("Expected one or two arguments, received ~D.",1,make_fixnum(n));
795          if (endp(vs_base[0]))          if (endp(vs_base[0]))
796                  return;                  return;
797          while (type_of(vs_base[0]->c.c_cdr) == t_cons)          if (n==2) {
798                    if (type_of(vs_base[1])!=t_fixnum || (n=fix(vs_base[1]))<1)
799                            FEerror("Expected fixed integer type greater than or equal to one in second argument: ~S",
800                                    1,vs_base[1]);
801                    vs_popp;
802            }      
803            
804            t=vs_base[0];
805            while (type_of(vs_base[0]->c.c_cdr) == t_cons && --n)
806                    vs_base[0] = vs_base[0]->c.c_cdr;
807            while (type_of(vs_base[0]->c.c_cdr) == t_cons) {
808                    t=t->c.c_cdr;
809                  vs_base[0] = vs_base[0]->c.c_cdr;                  vs_base[0] = vs_base[0]->c.c_cdr;
810            }
811            vs_base[0]=t;
812    
813  }  }
814    
815  void  void
# Line 1186  Ltailp() Line 1204  Ltailp()
1204                          vs_popp;                          vs_popp;
1205                          return;                          return;
1206                  }                  }
1207          vs_base[0] = Cnil;          vs_base[0] = x == vs_base[0] ? Ct : Cnil;
1208          vs_popp;          vs_popp;
1209          return;          return;
1210  }  }

Legend:
Removed from v.1.5  
changed lines
  Added in v.1.6

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