For a change this is
an exercism problem I know something about.
I did look at the
exercism web site, and did all the SML exercises,
but could not find any
for Smalltalk or Pharo.
The exercise is in
fact about using a stack.
�� ��stack <- empty
�� ��for each character
of the string
�� �� �� if it is one of
( [ { push it on the stack
�� �� �� if it is one of
) ] }
�� �� �� �� ��if the stack
is empty or the top element does not
�� �� �� �� �� �� correspond
to this character, return false
�� �� �� if it is not one
of ( ) [ ] { } just ignore it
�� ��return (the stack
is empty)
BOTH of the "return"
constructs in this pseudo-code become
^ something
in Smalltalk.�� "Long
returns", where "^" occurs inside a block,
are well defined, very
useful, and universally accepted in Smalltalk.
There is no analogue
of "^" for returning from a block.
By the way, this has
nothing to do with #do:.�� It's about
returning from the
method through any number of blocks.
For example, you will
sometimes see code like
�� ��x := aDictionary
at: aKey ifAbsent: [^false].