From 8e3568fc8bb88dfbd1064a9e3039007a451e207d Mon Sep 17 00:00:00 2001 From: Rafael Vuijk Date: Sun, 9 Aug 2026 16:21:00 +0000 Subject: [PATCH] Write down integral's two forms, and 1.4.0's unrecorded break Syntax.md listed integral(expr, var) and stopped. The definite form integral(expr, var, from, to) is supported and covered by tests in three files, but a caller reading the syntax document was told only the two-argument form existed and given no way to discover the other -- which is the form that replaced the three-argument one. It now lists both, and says why derivative takes an order while integral does not: derivative(f, x, 2) is a second derivative, integral's third and fourth arguments are bounds. Three arguments name neither form, which is a parse error rather than an oversight. BREAKING-CHANGES.md begins at 2.0.0, so the change that introduced this -- PR #657 in 1.4.0, replacing the iteration count with a range -- has never had a home in it. 1.4.0 is what dotnet add package installs today and the change is silent until a string is parsed, so it now has a section of its own at the end. Both samples in this repository called integral(f, x, 1) and had been failing against 1.4.0 since January without anyone seeing it, because they were pinned to 1.3.0. Co-Authored-By: Claude Opus 5 (1M context) --- BREAKING-CHANGES.md | 28 ++++++++++++++++++++++++ Sources/AngouriMath/Docs/Usage/Syntax.md | 10 +++++++-- 2 files changed, 36 insertions(+), 2 deletions(-) diff --git a/BREAKING-CHANGES.md b/BREAKING-CHANGES.md index c29b33258..c1c85c377 100644 --- a/BREAKING-CHANGES.md +++ b/BREAKING-CHANGES.md @@ -1528,6 +1528,34 @@ Not behavioural changes, listed so that a reader working through this file has t --- +## 1.4.0 — one change that was never written down + +This file begins at 2.0.0, so a break introduced *by* 1.4.0 has had no home in it. One is worth +recording, because 1.4.0 is what a `dotnet add package` installs today and the change is silent +until a string is parsed. + +### `integral` takes bounds, not an iteration count + +| | 1.3.0 | 1.4.0 onwards | +|---|---|---| +| `integral(f, x, 1)` | accepted, read as `integral(f, x)` | `FunctionArgumentCountException` | +| `integral(f, x, a, b)` | — | the definite integral from `a` to `b` | + +The third argument used to be a repetition count and is now the lower bound of a range, so three +arguments name neither form and are refused. `derivative(f, x, n)` is unaffected and still takes an +order, which is why the two functions read differently. + +This was deliberate — PR [#657](https://github.com/asc-community/AngouriMath/pull/657), "change +integral node to support range instead of iterations" — and it is covered by a test. It simply went +out without a note. Both samples in this repository called `integral(f, x, 1)` and had been failing +against 1.4.0 since January without anyone seeing it, because they were pinned to 1.3.0; PR +[#846](https://github.com/asc-community/AngouriMath/pull/846) is what surfaced it. + +**What to do.** `integral(f, x, 1)` becomes `integral(f, x)` — identical in meaning, since 1.3.0 +turned the former into the latter anyway. For a repeated antiderivative, nest the calls. + +--- + ## If one of these hurts Open an issue at https://github.com/asc-community/AngouriMath/issues saying what you were relying diff --git a/Sources/AngouriMath/Docs/Usage/Syntax.md b/Sources/AngouriMath/Docs/Usage/Syntax.md index 16c9ca781..df37cf737 100644 --- a/Sources/AngouriMath/Docs/Usage/Syntax.md +++ b/Sources/AngouriMath/Docs/Usage/Syntax.md @@ -108,8 +108,14 @@ any number of arguments and fold. `min` and `max` compare only where the argumen are otherwise left as written. `gcd` computes over integers and rationals — `gcd(1/2, 1/3)` is `1/6` — and leaves the polynomial case alone. -**Calculus** — `derivative(expr, var, order)`, `integral(expr, var)`, `limit(expr, var, dest)`, -`limitleft(...)`, `limitright(...)`. +**Calculus** — `derivative(expr, var, order)`, `integral(expr, var)`, +`integral(expr, var, from, to)`, `limit(expr, var, dest)`, `limitleft(...)`, `limitright(...)`. + +`derivative` takes an order and `integral` does not: `derivative(f, x, 2)` is the second +derivative, while `integral`'s third and fourth arguments are the bounds of a definite integral, +not a count. `integral(f, x, 2)` is therefore a parse error rather than the second antiderivative +— three arguments name neither form. This is deliberate; the iteration count was replaced by the +range in [#657](https://github.com/asc-community/AngouriMath/pull/657). **Structural** — `piecewise(a provided p, b provided q)`, `lambda(param, body)`, `apply(f, arg, ...)`, `domain(expr, set)`.