If I understood correctly, I believe the CHICKEN egg typed-records[0]
has just that feature.

(defstruct foo x y z)

This defines a type `foo` with fields `x`, `y` & `z`. Other than the
constructor, getters, and setters, it creates also an `update-foo` that
works like this:

(let* ((foo (make-foo x: 1 y: 2 z: 3))
       (foo (update-foo foo x: 4)))
  (foo-x foo)) ;=> 4

[0]: https://wiki.call-cc.org/eggref/5/typed-records


Reply via email to