Cameron Moy
See this link for an explanation of the behavior of struct-copy .
This module defines helpers for immutably updating structs. Notably, updating a struct using this package doesn’t change its type like struct-copy does. Under the hood, it derives a generic method for copying structs that is then dispatched to for updating.
syntax
( struct/set idmaybe-super(field...)struct-option...)
syntax
( struct-set idstruct-expr[fld-idexpr]...)
> (fruit-pricenew-apple)1.0
> (apple-oxidized?new-apple)#t
syntax
( struct-update idstruct-expr[fld-idupdate-expr]...)
> (fruit-pricecheap-apple)0.5
> (apple-oxidized?cheap-apple)#t