Skip to content

Fix integer division claim and document get-else limits - #46

Merged
thiagooak merged 1 commit into
mainfrom
fix/cor-09-function-clauses
Sep 21, 2026
Merged

thiagooak merged 1 commit into
mainfrom
fix/cor-09-function-clauses

Conversation

@thiagooak

Copy link
Copy Markdown
Owner

Summary

  • Datomic's / on integers truncates toward zero (like quot), not "rounded down" (a floor) — verified (/ -7 2) returns -3, not -4. Also noted it doesn't return a ratio for non-divisible integers, unlike Clojure's own / (verified (/ 11 9) returns 1).
  • Documented get-else's two undocumented limits: it rejects cardinality-many attributes (cardinality-many attrs not supported: :pokemon/type) and a nil default (nil default value not supported) — both error strings verified by actually running the queries against the real database.
  • Extended the chapter's try-tip with a step to reproduce the cardinality-many error firsthand.

Closes #25

Test plan

  • clojure -X:test — 32 tests, 493 assertions, 0 failures
  • Every quoted error message verified against the real exception text via app.core/run-q, not assumed from the ticket

🤖 Generated with Claude Code

Datomic's / truncates toward zero (like quot), not a floor, and
doesn't return a ratio for non-divisible integers. get-else also
silently rejects cardinality-many attributes and nil defaults;
both limits are now stated and verified against real error text.

Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com>
@thiagooak
thiagooak merged commit a3b8ba2 into main Sep 21, 2026
2 checks passed
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.

COR-09: Function clauses: "rounded down" and missing get-else limits

1 participant