I'm not sure I am fully understanding the issues, but it seems to me that you have answered your own question.
I'm reminded of a comment made by one of my co-workers at SUN, defining when one implementation is more powerful than another. "If you can implement B using A, but cannot implement A using B, A is more powerful". I'd opt for the more powerful, TagSet, in all areas.
Talvin's question is a good one, though. Do you want to be able to create TagSets whose sizes are pre-limited for any reason? I see no reason not to do so - except that it introduces a set of error conditions around both the limit value and what happens when you hit a limit.
That is an increase in complexity of code and time of implementation. I lack the knowledge to advise you on that, as I am not as versed in the usage model as you are.
(I'm inclined to say "no" - as long as your TagSet contains an ordinal count of tags, you can always implement a subclass of TagSet called LimitedTagSet. Or, from what you have been saying about Scala, you can create something that has an ordinal-cap sort of property, and associate that with all your collections or sets, should you choose to do so. I did buy, but still haven't cracked, Scala for the Impatient. The irony is not lost on me. I've been reading on law instead.)
(no subject)
Date: 2012-11-21 03:15 pm (UTC)I'm reminded of a comment made by one of my co-workers at SUN, defining when one implementation is more powerful than another. "If you can implement B using A, but cannot implement A using B, A is more powerful". I'd opt for the more powerful, TagSet, in all areas.
Talvin's question is a good one, though. Do you want to be able to create TagSets whose sizes are pre-limited for any reason? I see no reason not to do so - except that it introduces a set of error conditions around both the limit value and what happens when you hit a limit.
That is an increase in complexity of code and time of implementation. I lack the knowledge to advise you on that, as I am not as versed in the usage model as you are.
(I'm inclined to say "no" - as long as your TagSet contains an ordinal count of tags, you can always implement a subclass of TagSet called LimitedTagSet. Or, from what you have been saying about Scala, you can create something that has an ordinal-cap sort of property, and associate that with all your collections or sets, should you choose to do so. I did buy, but still haven't cracked, Scala for the Impatient. The irony is not lost on me. I've been reading on law instead.)