In Control flow§
See primary documentation in context for once
A block or statement prefixed with once
will be executed exactly once, even if placed inside a loop or a recursive routine.
my ;loop# OUTPUT: «oncemanymanymany»
This works per "clone" of the containing code object, so:
( xx 3).map: ; # says 42 thrice
Note that this is not a thread-safe construct when the same clone of the same block is run by multiple threads. Also remember that methods only have one clone per class, not per object.