eval_term() cannot bind a variable named t: the binding is partially matched to the formal 'term', so every transform result in t is unevaluable
Maintainers usually reply within 1 day
Nobody has claimed this yet.
Assessment
- Difficulty
- 2/5
- Estimated time
- 1-3 hours
- Newbie friendliness
- 78/100
Research direction
Read R/session.R around lines 600–606, where eval_term() declares its arguments and checks the bindings. Reproduce the reported failure with eval_term(P("sin(t) + t^2"), t = 1) and compare it with the working x example. Done means bindings named t, te, ter, and term are handled as intended and the error message is accurate; the issue does not name a test file.
Written by the indexing model from the issue text.
Description
eval_term() cannot bind a variable named t (nor te, ter, term) because the binding name is partially matched to the formal argument term, so the most common variable in the calculus area — time — cannot be evaluated at all, and the error message blames the caller for not naming the binding.
library(rssn)
s <- rssn_session(); t <- sym("t", s)
P <- function(txt) parse_term(txt, s)
eval_term(P("sin(t) + t^2"), t = 1)
# Error: eval_term() takes named bindings, such as x = 0.5
eval_term(P("sin(t) + t^2"), te = 1) # same error
eval_term(P("sin(t) + t^2"), ter = 1) # same error
eval_term(P("sin(t) + t^2"), term = 1) # same error
eval_term(P("sin(t) + t^2"), "t" = 1) # same error
do.call(eval_term, list(P("sin(t) + t^2"), t = 1)) # same error
# every name that is not a prefix of "term" works
eval_term(P("sin(x) + 1"), x = 0) # 1 (the documented example)
eval_term(P("sin(s)"), s = 1) # 0.841471
eval_term(P("sin(ti)"), ti = 1) # 0.841471
eval_term(P("sin(tt)"), tt = 1) # 0.841471
Why it is wrong: the binding is named correctly; the message "eval_term() takes named bindings, such as x = 0.5" is false. There is no workaround inside the documented API — positional bindings are rejected by the same check, and quoting the name does not help — so a Laplace/Fourier/ODE result in t (the variable every transform in this engine uses: laplace(f, t, s), fourier(f, t, w), dsolve in t) simply cannot be evaluated numerically. Substituting a different symbol name, or re-parsing the printed text with x instead of t, is the only way.
Mechanism: R/session.R:600 declares eval_term <- function(term, ...). R matches a named actual argument to a formal by exact name first, then by partial name, so t = 1 is matched to term (as are te, ter, term); ... is then empty, names(list(...)) is NULL, and the guard at line 606 raises the "takes named bindings" error. Renaming the first formal (.term, x) or collecting the bindings before the call fixes it; the same trap will hit any future wrapper whose first formal is a prefix of a plausible symbol name.
rssn 0.3.0, R 4.6.2 binding, Windows x86_64.
- Dominant language
- Rust
- Stars
- 36
- Forks
- 3
- Avg merge
- 14h 51m
- Merged PRs (30d)
- 29
Getting set up
- No Dockerfile or Docker Compose file
- No pull request template
- Read the contributing guide
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
More from Apich-Organization/rssn
-
num_ode_rk4_adaptive rejects atol = 0 while accepting rtol = 0 and while num_ode_dopri5 accepts bothOpenarea/ode-pde good first issue help wanted kind/contract severity/4-minor
Difficulty 2/5 1-3 hours Newbie friendliness 78/100
Apich-Organization/rssn#383 ·
Maintainers usually reply within 1 day
-
area/numerical good first issue help wanted kind/doc-mismatch severity/5-trivial
Difficulty 2/5 1-3 hours Newbie friendliness 65/100
Apich-Organization/rssn#373 ·
Maintainers usually reply within 1 day
-
area/numerical good first issue help wanted kind/doc-mismatch severity/4-minor
Difficulty 2/5 1-3 hours Newbie friendliness 78/100
Apich-Organization/rssn#371 ·
Maintainers usually reply within 1 day
-
json_encode() re-emits a decoded empty JSON object as [], so {} and {"":1} are not round-trip stableOpenarea/api-bindings good first issue help wanted kind/contract severity/4-minor
Difficulty 2/5 1-3 hours Newbie friendliness 78/100
Apich-Organization/rssn#361 ·
Maintainers usually reply within 1 day
-
area/statistics good first issue help wanted kind/wrong-result severity/4-minor
Difficulty 2/5 1-3 hours Newbie friendliness 72/100
Apich-Organization/rssn#362 ·
Maintainers usually reply within 1 day
All issues in Apich-Organization/rssn
Similar issues
-
Update Wasmtime to 48.0.11 for RUSTSEC-2026-0648Possibly taken @flyingrobots claimed this today. Open
Difficulty 2/5 1-3 hours Newbie friendliness 67/100
flyingrobots/edict#457 ·
-
Difficulty 1/5 Under an hour Newbie friendliness 72/100
-
O-windows relnotes relnotes-needs-review relnotes-tracking-issue T-libs
Difficulty 1/5 Under an hour Newbie friendliness 68/100
Maintainers usually reply within 1 day
-
approved
Difficulty 2/5 1-3 hours Newbie friendliness 85/100
fritzprix/libr-agent#3266 ·
Maintainers usually reply within 1 day
-
Frame::second_to_frame truncates f32 product, causing periodic off-by-one framesPossibly taken @ShamanicArts claimed this today. Open
Difficulty 2/5 1-3 hours Newbie friendliness 82/100
dmtrKovalenko/fframes#296 ·
Maintainers usually reply within 1 day