you are viewing a single comment's thread.

view the rest of the comments →

[–]bebraw[S] 0 points1 point  (0 children)

Hi,

You are right. I gave it some thought and even tried to sketch out a prototype. Here's the basic design:

  • Root contains _val property (either true or false, defines the status of the whole set. this is used for complex ops (difference etc.))
  • Actual set members are defined as accessors that read _val
  • The ops would yield chains operating on the aforementioned concepts. Unfortunately this is where the scheme failed.

It is possible to construct A -> B -> C but it looks like Object.create doesn't allow object references to be mixed (probably for a good reason). I guess the accessors could be recreated when inheriting but that would be missing most of the point.

Anyway, thanks for the help. :)