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

Diff of /gcl/o/hash.d

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

revision 1.16 by camm, Wed Aug 10 13:59:56 2005 UTC revision 1.17 by camm, Sun Sep 18 02:48:59 2005 UTC
# Line 669  DEFUN_NEW("NEXT-HASH-TABLE-ENTRY",object Line 669  DEFUN_NEW("NEXT-HASH-TABLE-ENTRY",object
669     RETURN(3,object,small_fixnum(-1),(RV(sLnil),RV(sLnil)));     RETURN(3,object,small_fixnum(-1),(RV(sLnil),RV(sLnil)));
670  }  }
671    
672    DEFUN_NEW("NEXT-HASH-TABLE-INDEX",object,fSnext_hash_table_index,SI,2,2,NONE,OO,OO,OO,OO,(object table,object ind),"For HASH-TABLE and for index I return the index of the next valid entry, or -1.") {
673    
674      fixnum i = fix(ind);
675    
676      check_type_hash_table(&table);
677      if ( i < 0)
678        FEerror("needs non negative index",0);
679    
680      while ( i <  table->ht.ht_size) {
681        if (table->ht.ht_self[i].hte_key != OBJNULL)
682          return make_fixnum(i);
683        i++;}
684    
685      return small_fixnum(-1);
686    
687    }
688    
689    DEFUN_NEW("HASH-ENTRY-BY-INDEX",object,fShash_entry_by_index,SI,2,2,NONE,OO,OO,OO,OO,(object table,object ind),"For HASH-TABLE and for index I return the index of the next valid entry, or -1.") {
690    
691      fixnum i = fix(ind);
692    
693      check_type_hash_table(&table);
694      if ( i < 0)
695        FEerror("needs non negative index",0);
696      if (table->ht.ht_self[i].hte_key == OBJNULL)
697        FEerror("invalid index",0);
698      return table->ht.ht_self[i].hte_value;
699    
700    }
701    
702    DEFUN_NEW("HASH-KEY-BY-INDEX",object,fShash_key_by_index,SI,2,2,NONE,OO,OO,OO,OO,(object table,object ind),"For HASH-TABLE and for index I return the index of the next valid key, or -1.") {
703    
704      fixnum i = fix(ind);
705    
706      check_type_hash_table(&table);
707      if ( i < 0)
708        FEerror("needs non negative index",0);
709      if (table->ht.ht_self[i].hte_key == OBJNULL)
710        FEerror("invalid index",0);
711      return table->ht.ht_self[i].hte_key;
712    
713    }
714    
715  DEFUN_NEW("HASH-TABLE-TEST",object,fLhash_table_test,LISP,1,1,NONE,OO,OO,OO,OO,(object table),  DEFUN_NEW("HASH-TABLE-TEST",object,fLhash_table_test,LISP,1,1,NONE,OO,OO,OO,OO,(object table),
716   "Given a HASH-TABLE return a symbol which specifies the function used in its test")   "Given a HASH-TABLE return a symbol which specifies the function used in its test")
717  {  {

Legend:
Removed from v.1.16  
changed lines
  Added in v.1.17

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