[racket] on the arity of the composition of procedures with different arities

From: Erik Dominikus (erik.dominikus71 at gmail.com)
Date: Tue Aug 7 23:46:29 EDT 2012

I had this conversation with DrRacket 5.2:

> (procedure-arity (compose1 (lambda (x) 0) (lambda () 0)))
(arity-at-least 0)

> (procedure-arity (compose1 (lambda (x) 0) (lambda (x) 0)))
1

> (procedure-arity (compose1 (lambda (x) x) (lambda (x y) 0)))
(arity-at-least 0)

I think the arity of the first procedure above should be exactly 0 since
(arity-at-least 0) means that the procedure can take 0, 1, 2, 3
arguments and so on, and indeed DrRacket says that it can't:

> ((compose1 (lambda (x) 0) (lambda () 0)) 0)
#<procedure>: expects no arguments, given 1: 0

By the same way of thought, I think the arity of the third procedure
should be exactly 2.

Am I missing something?


Posted on the users mailing list.