pharo
pharo copied to clipboard
Add executable comments on Collection for do: and stream related
This is a partial reroll of #11683 that focuses on example with do blocks and streams
I do find these examples complex and big. But I lack imagination for better alternatives.
The issue for stream is that you need to setup a stream then validate it. But since executable examples need to be on a single line, this makes the lines hard to read.
There is an equivalent issue with methods that takes a do
block whose value is not returned in the expression.
Therefore you need to setup something before the block, altering in the do
block, then validating that something after me method.
I tried to setup a stream (and putting things inside), a collection (and adding elements), a single variable (and assigning it). I'm not sure wich one I prefer. :(