From: "rosenfeld (Rodrigo Rosenfeld Rosas)" Date: 2012-06-08T21:58:53+09:00 Subject: [ruby-core:45512] [ruby-trunk - Feature #5011] Add Perl 6-like main method definition support: accept command-line arguments as method arguments Issue #5011 has been updated by rosenfeld (Rodrigo Rosenfeld Rosas). Not sure if it is that simple as I would need some way of extracting the argument names and default values from the method. How can I do that? Anyway, this certainly requires much more discussion about the details on how to design that. I'm more concerned with the overall idea. I don't really care about the exact details on how this would work as long as parsing arguments could be made much easier, like in Perl 6... I'll try to make some experiment this weekend by parsing the source line in some simple way for demonstrating purposes of the overall idea... Maybe you could provide me some implementation for querying the arguments and default values in ruby-head, than I could install it with RVM and try it without any hack like parsing the source itself... ---------------------------------------- Feature #5011: Add Perl 6-like main method definition support: accept command-line arguments as method arguments https://bugs.ruby-lang.org/issues/5011#change-27099 Author: rosenfeld (Rodrigo Rosenfeld Rosas) Status: Assigned Priority: Low Assignee: matz (Yukihiro Matsumoto) Category: Target version: Take a look at this: http://perlgeek.de/en/article/5-to-6#post_14 I'm not really sure how this would look like in Ruby, but I like the idea of defining a main method could extract their params from command-line params. This would also be an alternative for issue #4824: http://redmine.ruby-lang.org/projects/ruby-19/issues/4824 -- http://bugs.ruby-lang.org/