<div dir="ltr">Thanks Robby<div><br></div><div>... and I was so close!</div><div><br></div><div>The revised and improved version of the slides is up:</div><div><br></div><div><a href="http://www.slideshare.net/DanielPrager/introduction-to-contracts-and-functional-contracts">http://www.slideshare.net/DanielPrager/introduction-to-contracts-and-functional-contracts</a><br>

</div><div><br></div><div><br></div><div>Cheers</div><div><br></div><div>Dan</div><div><br></div></div><div class="gmail_extra"><br><br><div class="gmail_quote">On Thu, Sep 5, 2013 at 7:37 AM, Robby Findler <span dir="ltr">&lt;<a href="mailto:robby@eecs.northwestern.edu" target="_blank">robby@eecs.northwestern.edu</a>&gt;</span> wrote:<br>

<blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><div dir="ltr">You need to indicate that the contract on &#39;r&#39; needs &#39;n&#39;, ie replace &quot;[r (-&gt;i&quot;  with &quot;[r (n) (-&gt;i&quot;.<span class="HOEnZb"><font color="#888888"><div>

<br></div><div>Robby</div></font></span></div><div class="gmail_extra"><br><br>
<div class="gmail_quote"><div><div class="h5">On Wed, Sep 4, 2013 at 4:33 PM, Daniel Prager <span dir="ltr">&lt;<a href="mailto:daniel.a.prager@gmail.com" target="_blank">daniel.a.prager@gmail.com</a>&gt;</span> wrote:<br>

</div></div><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><div><div class="h5">
<div dir="ltr"><div><span style="color:rgb(34,34,34)">On Wed, Sep 4, 2013 at 7:58 AM, Matthias Felleisen </span><span dir="ltr" style="color:rgb(34,34,34)">&lt;<a href="mailto:matthias@ccs.neu.edu" target="_blank">matthias@ccs.neu.edu</a>&gt;</span><span style="color:rgb(34,34,34)"> wrote:</span><br>




<br></div><div><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left-width:1px;border-left-color:rgb(204,204,204);border-left-style:solid;padding-left:1ex">You can&#39;t.  Sam has had this combination on his todo list for 7 years and he never got around to it. Perhaps I signed his dissertation too early :-)</blockquote>




<div><br></div></div><div>I noticed that contract support is missing from TR.  I have, however, constructed a roll-my-own contract example with TR, and it would be great if Sam (or another!) pushed forward on contract support for TR.</div>


<div>

<div><br></div><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left-width:1px;border-left-color:rgb(204,204,204);border-left-style:solid;padding-left:1ex">This is from my code base. It is a function that consumes the dimensions of a (functional image) canvas and created a gridded image and an event handler that tells you on which &quot;tile&quot; a user clicked. It is highly real, higher-order, dependent, and yet not difficult to understand.</blockquote>




<div class="gmail_extra"><br></div></div><div class="gmail_extra">Alas, I am having trouble mentally parsing this, but may still flash it up (with acknowledgement!) as a realistic example.</div><div class="gmail_extra"><br>


</div>

<div class="gmail_extra">In trying to construct a simpler (yet not easily do-able with static types) example I&#39;m running into trouble getting my subcontract right.</div><div class="gmail_extra"><br></div><div class="gmail_extra">




I get an &quot;n unbound identifier&quot; error on the penultimate line:</div><div class="gmail_extra"><br></div><blockquote style="margin:0 0 0 40px;border:none;padding:0px"><div class="gmail_extra"><div class="gmail_extra">




;; make-indenter: Nat -&gt; (String -&gt; String)</div></div><div class="gmail_extra"><div class="gmail_extra">;;</div></div><div class="gmail_extra"><div class="gmail_extra">;; Example: ((make-indenter 4) &quot;foo&quot;) -&gt; &quot;    foo&quot;</div>




</div><div class="gmail_extra"><div class="gmail_extra">;;</div></div><div class="gmail_extra"><div class="gmail_extra">(define/contract (make-indenter n)</div></div><div class="gmail_extra"><div class="gmail_extra">  (-&gt;i ([n natural-number/c])</div>




</div><div class="gmail_extra"><div class="gmail_extra">       [r (-&gt;i ([s string?])</div></div><div class="gmail_extra"><div class="gmail_extra">               [result string?]</div></div><div class="gmail_extra"><div class="gmail_extra">




               #:post (s result) (= (string-length result)</div></div><div class="gmail_extra"><div class="gmail_extra">                                    (+ n (string-length s))))])</div></div><div class="gmail_extra">



<div class="gmail_extra">
  (λ (s) (string-append (make-string n #\space) s)))</div></div></blockquote><div class="gmail_extra"><br></div><div class="gmail_extra">How should I access &#39;n&#39;?</div><div class="gmail_extra"><br></div><div class="gmail_extra">




<br></div><div class="gmail_extra">Many thanks</div><div class="gmail_extra"><br></div><div class="gmail_extra">Dan</div></div>
<br></div></div><div class="im">____________________<br>
  Racket Users list:<br>
  <a href="http://lists.racket-lang.org/users" target="_blank">http://lists.racket-lang.org/users</a><br>
<br></div></blockquote></div><br></div>
</blockquote></div><br><br clear="all"><div><br></div>-- <br><div dir="ltr"><div style="font-family:arial;font-size:small"><b>Daniel Prager</b></div><div style="font-family:arial;font-size:small">Agile/Lean Coaching, Software Development and Leadership</div>

<div style="font-family:arial;font-size:small"><font color="#999999">Twitter:</font> <a href="https://twitter.com/agilejitsu" style="color:rgb(17,85,204)" target="_blank">@agilejitsu</a> </div><div style="font-family:arial;font-size:small">

<font color="#999999">Blog:</font> <a href="http://agile-jitsu.blogspot.com/" style="color:rgb(17,85,204)" target="_blank">agile-jitsu.blogspot.com</a></div></div>
</div>