Skip to content

DDIR: spell non-finite float literals - #1080

Open
antiguru wants to merge 1 commit into
TimelyDataflow:master-nextfrom
antiguru:ddir-float-nonfinite-literals
Open

antiguru wants to merge 1 commit into
TimelyDataflow:master-nextfrom
antiguru:ddir-float-nonfinite-literals

Conversation

@antiguru

@antiguru antiguru commented Nov 9, 2026

Copy link
Copy Markdown
Member

The lambda printer falls back to a graph dump for +inf, -inf and NaN. This removes the fallback seen in tour.ddp and f64_math.ddp, both of which now report fallback=0 under --check-lambdas. A related lint is in #1079.

The lexer lives in corgi and has no inf/nan words, so the spelling uses what it already accepts. A literal that overflows f64 parses as an infinity (1e999, -1e999), which cannot shadow a binding. NaN is (0.0, 0.0) div, the canonical quiet NaN 0x7ff8000000000000 that corgi gives every computed NaN. Floats compare by total order, so NaNs with other bits are distinct values that only data can carry, and the printer still falls back for those.

Posted by Claude Code.

🤖 Generated with Claude Code

The lambda printer fell back to a graph dump for +inf, -inf and NaN.
Spell infinities as overflowing literals (1e999, -1e999) and the
canonical NaN as (0.0, 0.0) div.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
@antiguru
antiguru marked this pull request as ready for review November 9, 2026 20:11
@antiguru

antiguru commented Nov 9, 2026

Copy link
Copy Markdown
Member Author

Alternatively, we add proper keywords to Corgi. I can do it if we go this route.

This branch has not been deployed

No deployments
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.

1 participant