# Set!: cannot mutate module-required identifier

**URL:** <https://racket.discourse.group/t/set-cannot-mutate-module-required-identifier/2411>\
**Category:** General\
**Created:** [October 22, 2023, 7:43pm UTC](https://racket.discourse.group/t/set-cannot-mutate-module-required-identifier/2411 "2023-10-22T19:43:03Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![damien\_mattei](https://yyz2.discourse-cdn.com/free1/user_avatar/racket.discourse.group/damien_mattei/32/2706_2.png) [@damien\_mattei](https://racket.discourse.group/u/damien_mattei)\
**Post date:** [October 22, 2023, 7:43pm UTC](https://racket.discourse.group/t/set-cannot-mutate-module-required-identifier/2411/1 "2023-10-22T19:43:03Z")

</div>

i have a module that contains a single variable:

```scheme
(module infix-operators racket

	(provide infix-operators-lst)

	(include "exponential.scm")
	(include "modulo.scm")
	(include "bitwise.rkt")
	(include "not-equal.scm")
	
	
		;; note: difference between bitwise and logic operator

	;; a list of lists of operators. lists are evaluated in order, so this also
	;; determines operator precedence
	;; added bitwise operator with the associated precedences and modulo too
	(define infix-operators-lst
	  
	  ;;'()
	  
	  (list
	   
	   (list expt **)
	   (list * / %)
	   (list + -)
	   
	   (list << >>)

	   (list & ∣ )

	   (list < > = <> ≠ <= >=)
	  
	   )

	  )

	) ;; end module

```

in the main i 'require' the above module and i need to modify this variable but i got an error:

```scheme
set!: cannot mutate module-required identifier in: infix-operators-lst

```

how can i do?

---

<div class="post-metadata">

**Author:** ![damien\_mattei](https://yyz2.discourse-cdn.com/free1/user_avatar/racket.discourse.group/damien_mattei/32/2706_2.png) [@damien\_mattei](https://racket.discourse.group/u/damien_mattei)\
**Post date:** [October 22, 2023, 7:57pm UTC](https://racket.discourse.group/t/set-cannot-mutate-module-required-identifier/2411/2 "2023-10-22T19:57:24Z")

</div>

ok the solution is here:

[https://docs.racket-lang.org/guide/module-set.html](https://docs.racket-lang.org/guide/module-set.html)

```scheme
(module infix-operators racket

	(provide infix-operators-lst
		 set-infix-operators-lst!)

	(include "exponential.scm")
	(include "modulo.scm")
	(include "bitwise.rkt")
	(include "not-equal.scm")
	

	(define infix-operators-lst
	 
	  (list
	   
	   (list expt **)
	   (list * / %)
	   (list + -)
	   
	   (list << >>)

	   (list & ∣ )

	   (list < > = <> ≠ <= >=)
	   
	 
	   )

	  )

	(define (set-infix-operators-lst! lst)
	  (set! infix-operators-lst lst))

	) ;; end module

```
