<div dir="ltr">yes, but I was curious about doing that during a debug session. Attempting to set! a procedure to a lambda results in:<div><div>application: not a procedure;</div><div> expected a procedure that can be applied to arguments</div>
<div> given: '(lambda (x) (..))</div><div> arguments...:</div></div><div>...</div><div>so the 'New value for f' dialog input is interpreted as text, not a lambda expression.</div><div>no biggie - was just curious if this was possible at all. could be nice, though, to be able to temporarily change behaviors during a debug session in this manner (e.g., for stubbing purposes)</div>
<div><br></div></div><div class="gmail_extra"><br><br><div class="gmail_quote">On Tue, Aug 6, 2013 at 3:10 PM, Matthias Felleisen <span dir="ltr"><<a href="mailto:matthias@ccs.neu.edu" target="_blank">matthias@ccs.neu.edu</a>></span> wrote:<br>
<blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><br>
If this is your code in th edef window:<br>
<br>
#lang racket<br>
(define (f x) x)<br>
(set! f f)<br>
<br>
you can do this in the REPL:<br>
<br>
Language: racket.<br>
> (f 10)<br>
10<br>
> (set! f (lambda (x) (+ (sqrt x) 20)))<br>
> (f 10)<br>
23.162277660168378<br>
<div><div class="h5">><br>
<br>
<br>
On Aug 6, 2013, at 4:03 PM, Edgar Honing <<a href="mailto:ephoning@gmail.com">ephoning@gmail.com</a>> wrote:<br>
<br>
> Hi,<br>
> Is it possible to set! other values than a string or a number using the set! dialog in DrRacket while in debug mode? For example: I was wondering whether a procedure value can be reassigned to another procedure/lambda.<br>
> Thanks much,<br>
> Edgar<br>
</div></div>> ____________________<br>
> Racket Users list:<br>
> <a href="http://lists.racket-lang.org/users" target="_blank">http://lists.racket-lang.org/users</a><br>
<br>
</blockquote></div><br></div>