<div>Giving special consideration to Eli and YC's perspectives, I've come up with the following way out of this problem.</div><div><br>I found a way to provide a global hook that is tasteful to me. I've created "dynamic/c". Here's a little example:</div>
<div><br></div><div><div>Examples:</div><div> (define p (make-parameter any/c))</div><div> (define c (dynamic/c string? p number?))</div><div> > (contract c "123" 'pos 'neg)</div><div> pos broke the contract</div>
<div> (dynamic</div><div> string?</div><div> #<procedure:parameter-procedure></div><div> number?)</div><div> on eval:5:0; expected <number?>, given: "123"</div><div> > (p (coerce/c string->number))</div>
<div> > (contract c "123" 'pos 'neg)</div><div> 123</div><div> > (contract c "123a" 'pos 'neg)</div><div> pos broke the contract</div><div> (dynamic</div><div> string?</div>
<div> #<procedure:parameter-procedure></div><div> number?)</div><div> on eval:8:0; Coercion failed</div><div><br></div></div><div>The Web Server will define response/c as (dynamic/c any/c current-response/c response?) and provide the current-response/c parameter for customization. The default will be no coercion, but Xexpr conversion will be easily accessible. A compatibility library will automatically set current-response/c appropriately.</div>
<div><br></div><div>Attached is the new compatibility README.</div><div><br></div><div>I hope this will satisfy all.</div><div><br></div><div>Jay</div><div><br></div><br>-- <br>Jay McCarthy <<a href="mailto:jay@cs.byu.edu" target="_blank">jay@cs.byu.edu</a>><br>
Assistant Professor / Brigham Young University<br><a href="http://faculty.cs.byu.edu/~jay" target="_blank">http://faculty.cs.byu.edu/~jay</a><br><br>"The glory of God is Intelligence" - D&C 93<br>