The correct way to print a delimited collection in SmallTalk is Squeak?
I am trying to override the printOn method with this code:
coordinates do: [:elem | aStream print: elem] separatedBy: [aStream print: ' ,']
where "coordinates" means the name of the collection (OrderedCollection), but I was expecting to print this when called in the Transcript show:
(2/2) ,(1/1) ,(3/3) ,(-4/4)
I got this instead:
(2/2)','(1/1)','(3/3)','(-4/4)
I am. e quotes were also printed.
I tried to play with it by defining a local variable and using it, etc. Nothing succeeded.
+3
source to share