In my code, I started experimenting with using immutable structs and 
"updating" them using 'struct-copy'.  I had to write my own "update" 
functions, but I was surprised at how elegant the resulting code was.  I 
believe (although I did not check) that the guard function is invoked every 
time a struct is copied, so the slots values will always be checked.

Here's an example of that pattern: 
https://github.com/alex-hhh/ActivityLog2/blob/bike-trainer/bike-trainer/sim-state.rkt

Best Regards,
Alex.

-- 
You received this message because you are subscribed to the Google Groups 
"Racket Users" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to racket-users+unsubscr...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

Reply via email to