How do I know the number of arguments of a function?

Viewed 453

How can we know how many arguments a function take?

For instance, for a given function f, I'd like to do:

if (arg_number(f) == 0)
  f()
else if (arg_number(f) == 1)
  f(FALSE)
1 Answers
Related