Skip to content

Enhance calc package with function calls#162

Merged
ripta merged 11 commits into
mainfrom
calc3
Jun 15, 2026
Merged

Enhance calc package with function calls#162
ripta merged 11 commits into
mainfrom
calc3

Conversation

@ripta

@ripta ripta commented Jun 15, 2026

Copy link
Copy Markdown
Owner

No description provided.

ripta added 10 commits June 13, 2026 13:12
Add a C-style call syntax:

    sin(0)
    sqrt(2 + 2)

backed by an evaluator-side registry, proving the path e2e. Some rules:

- A bare identifier is unchanged.
- An identifier followed by `(` parses as a call.
- Function names are only consulted in call position, so a variable
  named `sin` and the `sin` function can coëxist.
- Arity is validated per function at evaluation time.
Out-of-domain calls emit an error like: offending arguments before the
reason, as in:

    asin(2): argument must be in [-1, 1]
    atan2(0, 0): undefined at the origin

The reason text is mapped from the upstream `reals` errors to our own.
@ripta ripta enabled auto-merge June 15, 2026 00:09
Re-send SIGTERM on a short interval until the command exits, so a
dropped or late delivery self-corrects instead of failing.
@ripta ripta merged commit 6c8c8de into main Jun 15, 2026
1 check passed
@ripta ripta deleted the calc3 branch June 15, 2026 01:20
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