Skip to content

In :or destructuring, values should not depend on other bindings #250

Description

@puredanger

Just generally, there is no defined evaluation order for the value expressions of a destructuring :or wrt the other destructuring clauses.

There is an ordering assumption being made in this test that I believe will no longer be true in the next Clojure 1.13.0-alpha4 due to changing implementation.

(defn monoid-identity-element
  [{:keys [ctx gen empty eq] :or {empty (m/mempty ctx) eq =}}]
  ...

Here, the use of ctx in the :or assumes ctx has been bound, but that is not a guarantee, and will in fact not be the case as of the next alpha, so I would recommend modifying this code, probably pulling it into two steps.

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions