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

Diff of /gcl/o/sequence.d

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

revision 1.14 by camm, Thu Oct 6 20:30:08 2005 UTC revision 1.15 by camm, Tue Nov 1 12:14:34 2005 UTC
# Line 89  int index; Line 89  int index;
89          int i,max;          int i,max;
90          object l;          object l;
91    
92          if (index < 0) {          if (index < 0)
93                  vs_push(make_fixnum(index));            TYPE_ERROR(make_fixnum(index),sLnon_negative_fixnum);
                 FEwrong_type_argument(sLnon_negative_fixnum, vs_head);  
         }  
94          switch (type_of(seq)) {          switch (type_of(seq)) {
95          case t_cons:          case t_cons:
96                  for (i = index, l = seq;  i > 0;  --i)                  for (i = index, l = seq;  i > 0;  --i)
# Line 122  int index; Line 120  int index;
120                  }                  }
121                  return(code_char(seq->ust.ust_self[index]));                  return(code_char(seq->ust.ust_self[index]));
122    
123            case t_symbol:
124              if (seq == Cnil) {
125                max=0;
126                goto E;
127              }
128          default:          default:
129                  /* if (seq == Cnil) goto E; */            TYPE_ERROR(seq,sLsequence);
130                  FEwrong_type_argument(sLsequence, seq);            return(Cnil);
                 return(Cnil);  
131          }          }
132    
133  E:  E:
134          l = vs_push( make_fixnum(max) );          TYPE_ERROR(make_fixnum(index),MMcons(sLinteger,
135          vs_push( make_fixnum(0) );                                               MMcons(make_fixnum(0),
136          l = vs_head = make_cons(vs_head, l);                                                      MMcons(MMcons(make_fixnum(max),Cnil),Cnil))));
         l = vs_head = make_cons(sLinteger, l);  
         vs_push(make_fixnum(index));  
         /* FIXME message should indicate out of range  
         Icall_error_handler(sKwrong_type_argument,  
                      make_simple_string("The index, ~S, is too large."),  
                      1,vs_head); */  
         FEwrong_type_argument(l,vs_head);  
137          return(Cnil);          return(Cnil);
138  }  }
139    
# Line 161  object val; Line 156  object val;
156          int i,max;          int i,max;
157          object l;          object l;
158    
159          if (index < 0) {          if (index < 0)
160                  vs_push(make_fixnum(index));            TYPE_ERROR(make_fixnum(index),sLnon_negative_fixnum);
                 FEwrong_type_argument(sLnon_negative_fixnum, vs_head);  
         }  
161          switch (type_of(seq)) {          switch (type_of(seq)) {
162          case t_cons:          case t_cons:
163                  for (i = index, l = seq;  i > 0;  --i)                  for (i = index, l = seq;  i > 0;  --i)
# Line 193  object val; Line 186  object val;
186                          goto E;                          goto E;
187                  }                  }
188                  if (type_of(val) != t_character)                  if (type_of(val) != t_character)
189                          FEwrong_type_argument(sLcharacter, val);                    TYPE_ERROR(val,sLcharacter);
190                  seq->st.st_self[index] = val->ch.ch_code;                  seq->st.st_self[index] = val->ch.ch_code;
191                  return(val);                  return(val);
192    
193          default:          default:
194                  max=0;                  max=0;
195                  FEwrong_type_argument(sLsequence, seq);                  TYPE_ERROR(seq,sLsequence);
196          }          }
197    
198  E:  E:
199          l = vs_push( make_fixnum(max) );          TYPE_ERROR(make_fixnum(index),MMcons(sLinteger,
200          vs_push( make_fixnum(0) );                                               MMcons(make_fixnum(0),
201          l = vs_head = make_cons(vs_head, l);                                                      MMcons(MMcons(make_fixnum(max),Cnil),Cnil))));
         l = vs_head = make_cons(sLinteger, l);  
         vs_push(make_fixnum(index));  
   
         /* FIXME error message should indicate value out of range -  
            fixed kraehe */  
         FEwrong_type_argument(l, vs_head);  
202          return(Cnil);            return(Cnil);  
203  }  }
204    
# Line 598  object seq; Line 585  object seq;
585                                  unsigned int y;                                  unsigned int y;
586                                  y = UINT_GCL(x, i);                                  y = UINT_GCL(x, i);
587                                  UINT_GCL(x, i) = UINT_GCL(x, j);                                  UINT_GCL(x, i) = UINT_GCL(x, j);
588                                  UINT_GCL(x, y) = y;                                  UINT_GCL(x, j) = y;
589                          }                          }
590                          return(seq);                          return(seq);
591    
# Line 609  object seq; Line 596  object seq;
596                                  unsigned short y;                                  unsigned short y;
597                                  y = USHORT_GCL(x, i);                                  y = USHORT_GCL(x, i);
598                                  USHORT_GCL(x, i) = USHORT_GCL(x, j);                                  USHORT_GCL(x, i) = USHORT_GCL(x, j);
599                                  USHORT_GCL(x, y) = y;                                  USHORT_GCL(x, j) = y;
600                          }                          }
601                          return(seq);                          return(seq);
602                  case aet_char:                  case aet_char:

Legend:
Removed from v.1.14  
changed lines
  Added in v.1.15

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