<font color='black' size='2' face='arial'><font face="arial" color="black" size="2"><font face="Arial, Helvetica, sans-serif">Hi,<br>
<br>
I’m using DrRacket. <br>
In an edit window I have written:<br>
<br>
#lang racket<br>
(define counter 0)<br>
<br>
I’m pressing “Run” button and next, in a command line, after running a command:<br>
<br>
(set! counter (add1 counter))<br>
<br>
I receive a message “set!: cannot modify a constant: counter”<br>
<br>
The problem can be resolved by changing the language (Language/Choose language/R5RS and unchecking “Disallow redefinition of initial binding”) but I suppose that in this way I can lose an access to the racket libraries.<br>
Of course, I realize, that redefinition of the variables is not good (functional) programming style but sometimes it’s necessary. Is there a possibility of such modifications without changing language?<br>
<br>
Jerzy<br>
</font><br>
</font></font>