[racket] procedure contract for "at least N arguments, possibly more"

From: Robby Findler (robby at eecs.northwestern.edu)
Date: Fri Jun 8 21:31:22 EDT 2012

To get a little more context: what happens if P1 returns different
numbers of values each time it is called? How do you know which ones
match up to which calls of P2?

Also, perhaps not the best thing (pending the answer above), you can
write a predicate contract that gets the procedure-arity result and do
what you want with it. That doesn't work well if you want to actually
put contracts on the two arguments, tho.

Robby

On Fri, Jun 8, 2012 at 6:13 PM, Neil Van Dyke <neil at neilvandyke.org> wrote:
> Is there a way with the core procedure contractor combinators, to say "at
> least 2 arguments, possibly more"?
>
> So far, I have gotten "->*" to give me "2 arguments and arbitrarily more",
> which is not what I want.
>
> (Rationale for why I want "at least 2 arguments, possibly more"... I have a
> library procedure that accepts two provided procedures, P1 and P2.  It
> applies P1 in one context and saves the value(s) returned, then applies P2
> in a different context with two fixed arguments plus an additional argument
> for each value saved from applying P1.  So, I just want the contract for P2
> to require the 2 fixed arguments, and permit additional arguments, but not
> require P2 to accept arbitrary arguments.)
>
> Neil V.
>
> ____________________
>  Racket Users list:
>  http://lists.racket-lang.org/users


Posted on the users mailing list.