Closed LinqLover closed 1 year ago
Related questions:
, aCollection
, copyWith: newElement
, and copyWithout: oldElement
?@LinqLover Yes to the checking the chapter. Standard library protocols should definitely work when we create a new edition. Maybe we could ask Robert to do it, he is quite thorough with these things (on the other hand, might have some more interesting content to write).
copying might be interesting because of ,
. The other selectors are not that exciting.
The hierarchy can be genereated with the script before it. Will do at one point. :)
@codeZeilen Should we add this to the 6.0 milestone? :)
@LinqLover omg, yes please
The following classes are missing, or their superclasses are lacking an ellipsis:
- WeakKeyToCollectionDictionary
- RawBitsArray (only since Squeak 6.0; with more than 10 subclasses, this might be relevant)
[x] discuss this: do we want this class? it's only for optimizations. we could mention RawBitsArray without subclasses, but not sure whether relevant
note: i felt the need to mention this class name when revising an existing list of homogenous ArrayedCollection subclasses, so now RawBitsArray
is mentioned in the chapter but not in the hierarchy
- SparseLargeTable and SparseLargeArray (maybe interesting?)
- Interval subclasses
- Collection itself needs an ellipsis
The following classes are positioned incorrectly:
- RunArray (not an ArrayedCollection)
atm, collection hierarchy has not changed in 6.1alpha
Other observations and points for discussion:
[x] fig 10.1 (hierarchy list) and fig 10.2 (image) overlap (duplication)
[x] "The full list is shown in Figure 10.1" is not true because also fig 10.1 is truncated
[x] parts of the chapter have a clear lisp-grounded perspective and I'm not sure whether that is helpful (won't the average programmer be more familiar with Python or Java than with Lisp?) Also, in the previous chapter (Exceptions), we are referring to Java instead.
[x] how do you think about the term "dynamic array" (as opposed to "literal arrays" such as #(1 2 3)
)? I don't like it because it might suggest that they could not store arbitrary elements in them (which would be the property of heterogeneity instead). The entire vocables are misleading because they suggest different types of arrays but actually just are different types of constructors. I would prefer rewriting that to "array literal" and X, but what would be a proper antonym here? "brace expression"? (note: also update occurrences of "dynamic" in other chapters)
[x] quote:
Often Symbols are used as keys, in which case it is natural to use an IdentityDictionary since a Symbol is guaranteed to be globally unique
Is this actually a best practice? Personally, I would never do this. It might be marginally faster (one method activation less per comparison) but is more likely to break. Similarly, I would also use an IntegerArray only when performance really matters.
[x] (just a personal opinion but are sorted collections really worth one page? I have very rarely seen good use cases for them, and they annoyingly anticipate the section on sorting.)
[x] the book recommends implementing hash
using xor:
(^ title hash xor: authors hash
)bitXor:
(^ title hash bitXor: authors hash
) (I just fixed the selector in the book). I personally use an array instead ({title. xor} hash
) if I have less than 10 elements. Again, a bit slower - my version stresses the GC when looking up hashed collections -, but maybe better to read. Should we change the recommendation?
[x] should we mention collect: #asString
(Symbol>>value:
) in this chapter at least once? currently, we already mention Symbol>>#ascending
.
@LinqLover
@codeZeilen Thanks for the feedback! I addressed all points in #179, mind to check again? :)
Some issues I noticed so far: