[racket] changing a #<procedure:...> value when paused in debug mode

From: Edgar Honing (ephoning at gmail.com)
Date: Tue Aug 6 20:31:20 EDT 2013

yes, but I was curious about doing that during a debug session. Attempting
to set! a procedure to a lambda results in:
application: not a procedure;
 expected a procedure that can be applied to arguments
  given: '(lambda (x) (..))
  arguments...:
...
so the 'New value for f' dialog input is interpreted as text, not a lambda
expression.
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)



On Tue, Aug 6, 2013 at 3:10 PM, Matthias Felleisen <matthias at ccs.neu.edu>wrote:

>
> If this is your code in th edef window:
>
> #lang racket
> (define (f x) x)
> (set! f f)
>
> you can do this in the REPL:
>
> Language: racket.
> > (f 10)
> 10
> > (set! f (lambda (x) (+ (sqrt x) 20)))
> > (f 10)
> 23.162277660168378
> >
>
>
> On Aug 6, 2013, at 4:03 PM, Edgar Honing <ephoning at gmail.com> wrote:
>
> > Hi,
> > 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.
> > Thanks much,
> > Edgar
> > ____________________
> >  Racket Users list:
> >  http://lists.racket-lang.org/users
>
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.racket-lang.org/users/archive/attachments/20130806/951665c1/attachment.html>

Posted on the users mailing list.