Changeset 49

Show
Ignore:
Timestamp:
03/16/06 01:53:10 (3 years ago)
Author:
Jan-Klaas Kollhof
Message:

removing iter dependency from sets, fixing some syntax in iter

Files:

Legend:

Unmodified
Added
Removed
Modified
Copied
Moved
  • trunk/jsolait/lib/iter.js

    r47 r49  
    274274            iterator  = new mod.ObjectIterator(iterable); 
    275275        }else{ 
    276             throw new mod.Exception("Iterable object does not provide __iter__ method or no Iterator found.") 
     276            throw new mod.Exception("Iterable object does not provide __iter__ method or no Iterator found."); 
    277277        } 
    278278        if(arguments.length==1){ 
  • trunk/jsolait/lib/sets.js

    r47 r49  
    5252        /** 
    5353            Initializes a Set instance. 
    54             @param elem*   An element which is added to the set or an iterable object of which the elements are added to the set. 
     54            @param elem*   An element which is added to the set or an Array object of which the elements are added to the set. 
    5555        **/ 
    5656        publ.__init__=function(elem){ 
     
    6767                        this.add(elems[i]); 
    6868                    } 
    69                 }else{//todo needs optimization! 
    70                     imprt('iter').iter(elems,this, function(item){ 
    71                         this.add(item); 
    72                     }); 
     69                }else{ 
     70                    throw new mod.Exception("expecting an Array object or Set"); 
    7371                } 
    7472            }