previous up next     contents index
Next: Evaluation Order Up: Procedures Previous: Dispatching

Arity

  The arity procedure takes any procedure and returns information about the number of arguments accepted by the procedure. The result a of (arity f) is either:

For example:

 
   (arity cons) ; => 2 
   (arity list) ; => #<struct:arity-at-least> 
   (arity-at-least? (arity list)) ; => #t 
   (arity-at-least-value (arity list)) ; => 0 
   (arity-at-least-value (arity (lambda (x . y) x))) ; => 1 
   (arity (case-lambda [(x) 0] [(x y) 1])) ; => (1 2) 


PLT