Looking through the Ruby code it has the following for proc_arity:
static VALUE
proc_arity(VALUE self)
{
int arity = rb_proc_arity(self);
return INT2FIX(arity);
}
More of a C coding style question really but why is static VALUE
on a separate line instead of something like this:
static VALUE proc_arity(VALUE self)
RuboCop is a Ruby static code analyzer (a.k.a. linter ) and code formatter. Out of the box it will enforce many of the guidelines outlined in the community Ruby Style Guide. Apart from reporting the problems discovered in your code, RuboCop can also automatically fix many of them for you.
Identifiers are names of variables, constants, and methods. Ruby identifiers are case sensitive. It means Ram and RAM are two different identifiers in Ruby. Ruby identifier names may consist of alphanumeric characters and the underscore character ( _ ).
It comes from the UNIX world, because it helps to easily grep
the definition of a function:
$ grep -n '^proc_arity' *.c
or using vim
:
/^proc_arity
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With