Ruby, Source Code of Splat?
问题 Someone asked about the splat operator yesterday, and I wanted to see the source code... would that be written in C or in Ruby? Where would it be found? 回答1: The splat operator is poorly documented in the core Ruby documentation as of Ruby 2.4. It's a core feature of the language, though, and the source code for the splat operator can be found in vm_eval.c under rb_yield_splat(VALUE values). The unit test for rb_yield_splat makes it clearer what is happening: it "yields with passed array's