Misc #18025
Updated by Eregon (Benoit Daloze) over 3 years ago
Marked as obsolete in https://github.com/ruby/ruby/blob/master/doc/extension.rdoc#label-Control+Structure.
I think it would be a good to mark it as deprecated so the few places still using that migrate to e.g. `rb_block_call()`.
These 2 places are still using rb_iterate():
* `ext/openssl/ossl_ssl.c:595: rb_iterate(rb_each, protocols, ssl_npn_encode_protocol_i, encoded);`
Should likely use rb_block_call instead.
* `ext/racc/cparse/cparse.c:302: rb_iterate(lexer_iter, v->value_v, lexer_i, v->value_v);`
Unintentional, fix in https://github.com/ruby/racc/pull/165
Right now there is special logic inside `rb_funcall()/vm_call0_body()` to handle the block magically passed by rb_iterate(), and I think it would be good to clean that up once `rb_iterate()` is gone.
FYI, TruffleRuby is recently no longer doing that magic behavior for such an old deprecated method:
https://github.com/oracle/truffleruby/commit/e7ddba79cc64f7beea8a34ef6c14d50d444399f7