I've often found myself using an object literal as a Set and after  
wishing I had some real Set operators, I finally found the time to  
write them.


I don't know whether this is core-worthy, but it might be helpful for  
someone else out there.

Just a note, all methods are implemented as statics on the Set  
_class_ because I didn't want to pollute the contents of the set.

The only current limitation is you can't reliably store keys which  
already exist in the Object prototype. Of course, I could add a  
wrapper object and prefix all the keys to get around this limitation,  
but the whole goal of this Set implementation was speed. So extra  
method calls aren't desirable.

Jeff Watkins
UI Engineer, online Apple store

You received this message because you are subscribed to the Google Groups 
"Prototype: Core" group.
To post to this group, send email to prototype-core@googlegroups.com
To unsubscribe from this group, send email to [EMAIL PROTECTED]
For more options, visit this group at 

Reply via email to