[plt-scheme] applying set! on the contents of a variable

From: Majorinc, Kazimir (kazimir at chem.pmf.hr)
Date: Sat Sep 29 14:42:47 EDT 2007

Here is one possibility

 > (define-macro (set!! p e)(list 'set! (eval p) e))
 > (define y 3)
 > (define x (quote y))
 > (set!! x 6)
 > y
6


> how does one change a variable whose symbol is stored in another
> variable?
>  sorry about the beginner question, but i couldn't find an answer in
> the group discussions or on google.
>  the reason i need this came up was because i have a function inside a
> class which takes as input an alist of properties and values and
> changes the current values in the class using this alist. i have a
> workaround, but was curious as to whether variable names could be
> treated as first-class objects.
>
> _________________________________________________
>   For list-related administrative tasks:
>   http://list.cs.brown.edu/mailman/listinfo/plt-scheme
>
>   



Posted on the users mailing list.