Hacker News

Clojure 1.13 adds support for checked keys

Clojure 1.13.0-alpha1 is now available!

Find download and usage information on the Downloads page.

Checked Keys in Map Destructuring

You can now ensure that required keys are bound during map destructuring by using the new checked variants of the :keys/:syms/:strs directives - :keys!/:syms!/:strs!, which will throw if the key is not present.

You can also, in all directives, specify keys after & which will not be bound, for documentation or checking purposes.

PersistentArrayMap Improvements

PersistentArrayMaps of only keyword keys now grow up to size 64 (previously was 8) before transitioning to PersistentHashMaps. PAM identity scans are more efficient than PHM lookups in this range, also makes more usage sites monomorphic and thus easier to optimize.

Other Changes

  • CLJ-2891 - Remove ACC_FINAL designation from static initializer constants. This change was made as a preparatory step towards moving the Java bytecode baseline to address new verifier checks.
  • Runtime and test dependencies updated to latest versions.

Comments

No comments yet. Start the discussion.