Recent trend of data structure SRFIs is to provide two flavors of updating procedures:

  • Functional updaters never mutate the input structure, and always return a newly allocated structure.

  • Linear updaters are allowed to reuse the storage of input structure to produce the output, given that the caller guarantees the input structure will never be used.

Functional interface has a good nature–it won’t create hidden dependencies thus the code is easy to reason about. It also plays nicely with concurrent execution, for you don’t need to worry that your operations step on other threads’ toes.

Linear updating interface gives the user to express opportunities of optimization. The implementation can take advantage of it to reduce allocations.

So, it appears to be a nice combination—except that, I think, the way they are currently specified is actually pulling each one’s leg and reducing their merits.