[Dok Melody Scratchpad Notes]

feature/fset

In CL, (fset (some-access-expr) new-value) is a macro that can be supported by every data structure that add some generic function.

The idea is good:

  • similar to a reduced version of lenses
  • clear code because the access pattern is used also for writing elements

The semantic is not correctly type-check proof, because it is an abuse of notation, but it is completely clear for the human mind, because it is a fixed workflow: access this element and overwrite it.

In Dok, I can support something like some-access-expr : new-value=.