Thank you very much. That clears everything right up.<div>-Hillary<br><br><div class="gmail_quote">On Wed, Jun 13, 2012 at 4:11 PM, Stephen Bloch <span dir="ltr"><<a href="mailto:bloch@adelphi.edu" target="_blank">bloch@adelphi.edu</a>></span> wrote:<br>
<blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><div class="im"><br>
On Jun 13, 2012, at 3:16 PM, Hillary Ryan wrote:<br>
<br>
> Why does this work?<br>
> (define canvas (new canvas% [parent window] [paint-callback (lambda (canvas dc) (draw canvas dc))]))<br>
><br>
> But this doesn't<br>
> (define canvas (new canvas% [parent window] [paint-callback (draw canvas dc)]))<br>
><br>
> It seems that in both cases the paint-callback is being set to a 2-arity procedure.<br>
<br>
</div>No, "(draw canvas dc)" is the RESULT of a 2-arity procedure. "draw" (no parentheses, no arguments) would be a 2-arity procedure, equivalent to "(lambda (canvas dc) (draw canvas dc))".<br>
<div class="im"><br>
> However, in the second case the window doesn't update unless draw is called from REPL.<br>
<br>
</div>Yes, that's because you're only calling draw once, at the time you define canvas.<br>
<span class="HOEnZb"><font color="#888888"><br>
<br>
<br>
Stephen Bloch<br>
<a href="mailto:sbloch@adelphi.edu">sbloch@adelphi.edu</a><br>
<br>
</font></span></blockquote></div><br></div>