[racket] What is the purpose of val-first-projection in contract combinators?

From: Alexis King (lexi.lambda at gmail.com)
Date: Sun Feb 8 00:05:15 EST 2015

The documentation for make-contract <http://docs.racket-lang.org/reference/Building_New_Contract_Combinators.html?q=make-contract#(def._((lib._racket/contract/private/prop..rkt)._make-contract))> and similar functions includes an optional #:val-first-projection keyword argument. What is this for? How does it differ from the #:projection argument?

The documentation does include this note:

> The precise details of the val-first-projection argument are subject to change.

I don’t know how long that message has been there, but I somehow doubt that the details are still “subject to change”. Could that argument be documented? I’d at least like to understand what it’s for and how I’m supposed to use it in new contract combinators. Also, what happens if I leave it out or pass #f?

As far as I can tell, the primary difference is that the procedure supplied  for val-first-projection takes an additional curried argument, the “negative party”. This is handled specially for contract failures that fail on this “first projection” by passing the argument to raise-blame-error via an undocumented keyword argument, #:missing-party. What does this do, exactly?

Thanks,
Alexis
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.racket-lang.org/users/archive/attachments/20150207/fe8c49cb/attachment.html>

Posted on the users mailing list.