C语言 Ruby源代码-编码风格



查看Ruby代码,它有以下proc_arity:

static VALUE
proc_arity(VALUE self)
{
    int arity = rb_proc_arity(self);
    return INT2FIX(arity);
}

更多的C编码风格问题,但为什么static VALUE在单独的行上,而不是像这样:

static VALUE proc_arity(VALUE self)

它来自UNIX世界,因为它有助于轻松地grep函数的定义:

$ grep -n '^proc_arity' *.c

或使用vim:

/^proc_arity

最新更新