anmolagarwal4453
2021-6-24 10:10:19

Hi, I wanted to define a struct with contract bound to the fields , and while making only some fields as mutable. The normal struct definition as mentioned here https://docs.racket-lang.org/reference/define-struct.html#%28form._%28%28lib._racket%2Fprivate%2Fbase..rkt%29._struct%29%29\|here allows me to specify mutable as a field option for the individual fields, but the one https://docs.racket-lang.org/reference/attaching-contracts-to-values.html?q=define-struct%2Fcontract#%28form._%28%28lib._racket%2Fcontract%2Fregion..rkt%29._define-struct%2Fcontract%29%29\|here (which helps me to specify contracts on the individual fields) does not seem to allow me to make some fields as mutable and others as non-mutable as there is no provision for field options in the syntax. Is there some way I can achieve contracts on the fields + making some of them mutable while others as immutable ?