Skip to content

Conversation

@super7ramp
Copy link
Contributor

@super7ramp super7ramp commented Nov 16, 2025

When testing uuid?, noticed some differences of behavior between platforms when parsing non-standard forms of UUIDs:

  • ClojureScript and Clojure CLR are strict
  • Clojure on JVM is quite permissive (because Java's UUID.fromString is permissive, see e.g. JDK-8216407, JDK-8159339).

This PR adds cases to capture these differences.

@super7ramp super7ramp force-pushed the parse-uuid-non-standard-forms branch from 3f88fb4 to 873fdf9 Compare November 16, 2025 19:48
@super7ramp super7ramp marked this pull request as ready for review November 16, 2025 19:52
(are [expected s] (= #?(:clj expected :default nil) (parse-uuid s)) ; clj is permissive, others are strict
#uuid "00000000-0000-0000-0000-000000000000" "0-0-0-0-0"
#uuid "00000012-0034-0056-0078-000000000009" "12-34-56-78-9"
#uuid "00000005-0004-0003-0002-009000000001" "5-4-3-DEADBEEF0002-9000000001"))
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

this is really strange, great find! It may be a good idea to raise this as a separate clj bug so the language maintainers can decide whether deviating from Java's behavior here is preferred or not

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks, will consider raising a bug to Clojure. (Honestly I doubt that a deviation from current behavior would happen at this point given the risk of breaking existing systems 😅 but still, it's worth noticing.)

@jeaye jeaye merged commit 73a9f1c into jank-lang:main Nov 17, 2025
2 checks passed
@jeaye
Copy link
Member

jeaye commented Nov 17, 2025

Thank you!

@super7ramp super7ramp deleted the parse-uuid-non-standard-forms branch November 17, 2025 22:35
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants