Skip to content

Apply the omnia.repl.context operations at once #52

@AvramRobert

Description

@AvramRobert

The context-altering operations in omnia.repl.context continously extract, patch and re-associate the huds in the context.
They basically update constantly for every operation.
Whilst this may be transparent, it is also a bit inefficient. (even with the low cost of association)

Begs the question: Is association distributive over these operations?
If it is, then we could apply all the changes to the huds at once and then associate the new one.
Broken down, this is actually what happens in every function:

(-> ctx  
    (update :hud change-1)
    (update :hud change-2))

Can't we do this?

(let [hud (:hud ctx)]
(->> hud (change-1) (change-2) (assoc ctx :hud)))

Metadata

Metadata

Assignees

No one assigned

    Labels

    contextThings that have to do with the context componentexperiment

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions