test(phel): mark nil-safe parse-* as documented divergence#16
Merged
Conversation
Phel's parse-long / parse-double / parse-boolean / parse-uuid intentionally return nil for non-string (or unparseable) input instead of throwing, so they chain in when/if-let without guarding. Add :phel branches to the exception blocks asserting nil-return instead of p/thrown?, documenting the difference. Other dialects are unaffected (they fall through to their existing branches).
Chemaclass
added a commit
that referenced
this pull request
May 29, 2026
Phel's reader resolves :phel (else :default). Add :phel reader-conditional branches documenting where Phel deliberately diverges from JVM Clojure on bad-shape / edge input, so the suite is green under Phel without masking behavior. Builds on #16 (parse-*) and #18 (string_test); covers the remaining core_test divergences: - nil-safe / structural returns where Clojure throws (key/val, realized?, < <= > >=, min-key/min/max, compare collections, peek/last/ffirst/fnext, empty?/not-empty, shuffle/sort-by/case/merge/update/remove/take-nth/map/ conj/set/select-keys/reverse/keys/vals, nth/nthnext/take/drop/count/ contains?/partial, keyword/symbol/intern); transients unguarded. - odd?/even? operate on any number (no integer check) -> kept lenient. - numeric tower (Bucket B): no auto bigint-promote/overflow in * + - and int/long/float/double/byte/rem/quot/mod; numerator/denominator int->n/1. Suite green under Phel: 5477/5477. Related to phel-lang#2223.
This was referenced May 29, 2026
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
Phel's
parse-long,parse-double,parse-boolean, andparse-uuidare intentionally nil-safe: they returnnilfor non-string (or otherwise unparseable) input instead of throwing, so they can be chained inwhen/if-letwithout guarding. This is a documented design choice in Phel core:The
exceptionstest blocks currently assertp/thrown?for these inputs, which fails under Phel.Change
Add a
:phelbranch to each affectedexceptionsblock assertingnil-return instead ofp/thrown?, with a comment documenting the divergence. Purely additive: every other dialect falls through to its existing:lpy/:cljs/:defaultbranch, and Clojure's reader simply skips the unknown:phelfeature.Affected files:
parse_long.cljcparse_double.cljcparse_boolean.cljcparse_uuid.cljcContext
Part of getting the phel-lang ↔ clojure-test-suite run green (phel-lang#2223). This is the "intentional divergence" bucket; genuine Phel bugs are fixed on the phel-lang side instead.