{"action":"opened","issue":{"url":"https://api.github.com/repos/mruby/mruby/issues/2856","labels_url":"https://api.github.com/repos/mruby/mruby/issues/2856/labels{/name}","comments_url":"https://api.github.com/repos/mruby/mruby/issues/2856/comments","events_url":"https://api.github.com/repos/mruby/mruby/issues/2856/events","html_url":"https://github.com/mruby/mruby/issues/2856","id":90345865,"number":2856,"title":"mrb_get_args() for ruby code?","user":{"login":"dmajkic","id":84048,"avatar_url":"https://avatars.githubusercontent.com/u/84048?v=3","gravatar_id":"","url":"https://api.github.com/users/dmajkic","html_url":"https://github.com/dmajkic","followers_url":"https://api.github.com/users/dmajkic/followers","following_url":"https://api.github.com/users/dmajkic/following{/other_user}","gists_url":"https://api.github.com/users/dmajkic/gists{/gist_id}","starred_url":"https://api.github.com/users/dmajkic/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/dmajkic/subscriptions","organizations_url":"https://api.github.com/users/dmajkic/orgs","repos_url":"https://api.github.com/users/dmajkic/repos","events_url":"https://api.github.com/users/dmajkic/events{/privacy}","received_events_url":"https://api.github.com/users/dmajkic/received_events","type":"User","site_admin":false},"labels":[],"state":"open","locked":false,"assignee":null,"milestone":null,"comments":0,"created_at":"2015-06-23T10:17:01Z","updated_at":"2015-06-23T10:17:01Z","closed_at":null,"body":"I really got used to mrb_get_args() on the C side of things.\r\nIt completly makes obsolete (unused) mrb_aspec parameter in mrb_define_method().\r\n\r\nNow that I am done on C src, and polishing some things in mrblib dir, I find it that from time to time I would really like to have some kind of quick parameter sanity check. Especially when dealing with C API.\r\n\r\n```ruby\r\ndef some_method(name, value, options = {})\r\n    get_args \"SoH\"      # or raise ArgumentError\r\n    return something\r\nend \r\n```\r\nPerhaps that \"SoH\" string is not readable in ruby, maybe symbols (:string, :object, :hash) could be a nicer fit. \r\n\r\nAnyway - I would like to try something like this inside my mgem. Can I just export mrb_get_args(), or is there a way to create function which gets its own args, but can also access outer function args? \r\n\r\n"}}