shingarov / MachineArithmetic

A mathematical foundation for Smalltalk-25
MIT License
17 stars 6 forks source link

[PreSmalltalks] Investigate corner cases for `concat` #285

Open shingarov opened 4 months ago

shingarov commented 4 months ago

SequenceableCollection>>concat (which should really be renamed to #join) contains the following comment:

"In the special case of empty receiver, answer #()."

and then this code:

self isEmpty ifTrue: [^#()].

I am starting to think this is nonsense. #concat is MacLane's μ :: T²→T. In order for T² to make sense, the species of the outer collection must match the species of the inner collection.