[racket] How to set! via name of symbol

From: Matthew Flatt (mflatt at cs.utah.edu)
Date: Tue Jul 22 01:56:09 EDT 2014

At Tue, 22 Jul 2014 08:41:12 +0400, Roman Klochkov wrote:
>  In Common Lisp one can do
> (defvar a 1)
> (defvar b 'a)
> 
> (set b 2)
> (print a) ;; prints 2
> 
> Is it possible in Racket. I mean
> (define a 1)
> (define b 'a)
> (??? b 2) 
> 
> What write instead of ??? to change a?

If `a` is defined at the top level, then `namespace-set-variable-value!`.



Posted on the users mailing list.