Collecting Smalltalk idioms/Possible Project

agree at carltonfields.com agree at carltonfields.com
Tue Aug 10 21:53:59 UTC 1999


It was pointed out to me that

	#do:separatedBy:

is listed in the ANSI Standard Smalltalk draft Collection protocols.  Interestingly, the "separatedBy:" parameter is not merely an object to be inserted, but is defined as a niladicValuable:

	do: operation separatedBy: separator

	"For each element of the receiver, operation is evaluated with the element as the parameter.  Before evaluating operation the second and subsequent times evaluate separator.  Separator is not evaluated if there are less than two elements nor after the last element."

------------------------------

Has anyone compared the Squeak collection protocols with the ANSI standard to determine what would be necessary for compatibility (or at least to reject the ANSI standard if Squeak's approach is prefereable)?  It seems a worthwhile exercise to "complete the set," since collections seem to go to the heart of much meaningful Squeaking.

Certainly, it seems, at least, that adding a do:separatedBy: might be a useful thing.





More information about the Squeak-dev mailing list