Sorry, that was a trick question: in Smalltalk, the for-loop is just a block/higher order function applied to a collection, except that the collection is an Interval defined by its start, end and optional step that only generates its contents on-demand, for example when iterating:
(1 to: 10) do: [ :i | ... ].
So (1 to: 10) creates an Interval, and then `do:` iterates that Interval. There's a shortcut convenience `to:do:` in Number that allows you to avoid the brackets.
The point being that the dichotomy "for-loop vs. higher order functions" is a false one. And usefully so, for example you can adjust methods in Interval to iterate in parallel (or you use a different kind of Interval) without having to touch the language or most iteration code.
The point being that the dichotomy "for-loop vs. higher order functions" is a false one. And usefully so, for example you can adjust methods in Interval to iterate in parallel (or you use a different kind of Interval) without having to touch the language or most iteration code.