An Objective-C method call will not be ignored when the object doesn't
define the method. It will crash with a runtime exception.
The author may have been thinking of the way an Objective-C method call
will be ignored when the object is nil. But that's not the case when the
object is there and lacks the method. In that case, the runtime will
call -doesNotRecognizeSelector:. The default behavior in the root class
NSObject is to raise an exception (not the try/catch kind; a similar
case is array bounds checks) and deliberately crash.
https://developer.apple.com/documentation/objectivec/nsobject/1418637-doesnotrecognizeselector?language=objc
The `code` directive highlights all sources as GDScript. Other languages are
highlighted incorrectly at the moment, even if `.. code:: [language]` is
specified.
It does, however, work with the `code-block` directive. The reason seems to be
that this directive is Sphinx specific.
Fix syntax by removing multiple variable declarations on the same line, which GDScript does not (yet?) support, use clearer class and variable names, and rename the misleading "is_done()" function to "should_continue()", as the value returned (and returned by _iter_init() and iter_next() actually signifies the opposite: true means continue, false means stop. Also remove the superfluous do_step() function.
Closes#2433.
Co-authored-by: a e <afablee@gmail.com>