cfg_bind() binds a term argument's internal handle, so cfg_bind("x", parse_term("2")) binds x = 9
I maintainer di solito rispondono entro 1 giorno
Nessuno ha ancora preso questa issue.
Valutazione
- Difficoltà
- 3/5
- Tempo stimato
- 1-2 giorni
- Idoneità per principianti
- 67/100
Direzione di ricerca
Start at the R cfg_bind() wrapper described in the issue and trace its .Call() into the Rust binding implementation. Check how the wrapper handles rssn_term values and vectors of length greater than one; use the examples in the issue to verify the behavior. Done means invalid inputs are rejected or terms bind to their evaluated values, with tests covering the reported cases.
Scritto dal modello di indicizzazione a partire dal testo della issue.
Descrizione
cfg_bind() accepts an rssn_term and silently binds the symbol to the term's internal integer handle instead of its value, so cfg_bind("x", parse_term("2")) binds x = 9 (the handle), not x = 2.
library(rssn)
s <- rssn_session()
t <- parse_term("2", s)
unclass(t) # 9 (the term handle)
cfg <- rssn_config() |> cfg_numeric(1e-12) |> cfg_bind("x", t)
compute(parse_term("x", s), cfg, s)$value # 9 -- should be 2
compute(parse_term("x + 1", s), cfg, s)$value # 10 -- should be 3
cfg_bind() is function(config, symbol, value) .Call(..., as.character(symbol), as.numeric(value)). An rssn_term is an integer with a class, so as.numeric() strips the class and returns the handle. A different term therefore binds a different number unrelated to its text:
t2 <- parse_term("100", s)
cfg2 <- rssn_config() |> cfg_numeric(1e-12) |> cfg_bind("x", t2)
compute(parse_term("x", s), cfg2, s)$value # 15 (handle of "100"), not 100
The help page says value is "The number a symbol is bound to", so either a non-numeric argument should be rejected (as it already is for a value_new() object, which fails with cannot coerce type 'environment') or a term should be evaluated first. A length-2 vector is likewise silently truncated (cfg_bind("x", c(1, 2)) binds x = 1), so the argument is not validated at all.
rssn 0.3.0, R 4.6.2 binding, Windows x86_64.
- Lingua principale
- Rust
- Stelle
- 36
- Fork
- 3
- Merge medio
- 14h 51m
- PR unite (30g)
- 29
Preparare l'ambiente
- Nessun Dockerfile né file Docker Compose
- Nessun modello di pull request
- Leggi la guida per i contributori
Come iniziare
- Leggi tutta la issue e poi la guida ai contributi del progetto.
- Commenta sulla issue per dire che te ne occupi tu — evita che due persone facciano lo stesso lavoro.
- Fai un fork del repository e lavora su un branch.
- Apri una pull request che faccia riferimento al numero della issue.
Altre issue di Apich-Organization/rssn
-
num_ode_rk4_adaptive rejects atol = 0 while accepting rtol = 0 and while num_ode_dopri5 accepts bothApertaarea/ode-pde good first issue help wanted kind/contract severity/4-minor
Difficoltà 2/5 1-3 ore Idoneità per principianti 78/100
Apich-Organization/rssn#383 ·
I maintainer di solito rispondono entro 1 giorno
-
area/numerical good first issue help wanted kind/doc-mismatch severity/5-trivial
Difficoltà 2/5 1-3 ore Idoneità per principianti 65/100
Apich-Organization/rssn#373 ·
I maintainer di solito rispondono entro 1 giorno
-
area/numerical good first issue help wanted kind/doc-mismatch severity/4-minor
Difficoltà 2/5 1-3 ore Idoneità per principianti 78/100
Apich-Organization/rssn#371 ·
I maintainer di solito rispondono entro 1 giorno
-
json_encode() re-emits a decoded empty JSON object as [], so {} and {"":1} are not round-trip stableApertaarea/api-bindings good first issue help wanted kind/contract severity/4-minor
Difficoltà 2/5 1-3 ore Idoneità per principianti 78/100
Apich-Organization/rssn#361 ·
I maintainer di solito rispondono entro 1 giorno
-
area/statistics good first issue help wanted kind/wrong-result severity/4-minor
Difficoltà 2/5 1-3 ore Idoneità per principianti 72/100
Apich-Organization/rssn#362 ·
I maintainer di solito rispondono entro 1 giorno
Tutte le issue di Apich-Organization/rssn
Issue simili
-
Update Wasmtime to 48.0.11 for RUSTSEC-2026-0648Forse già presa @flyingrobots l’ha presa oggi. Aperta
Difficoltà 2/5 1-3 ore Idoneità per principianti 67/100
flyingrobots/edict#457 ·
-
Difficoltà 1/5 Meno di un'ora Idoneità per principianti 72/100
-
O-windows relnotes relnotes-needs-review relnotes-tracking-issue T-libs
Difficoltà 1/5 Meno di un'ora Idoneità per principianti 68/100
I maintainer di solito rispondono entro 1 giorno
-
approved
Difficoltà 2/5 1-3 ore Idoneità per principianti 85/100
fritzprix/libr-agent#3266 ·
I maintainer di solito rispondono entro 1 giorno
-
Frame::second_to_frame truncates f32 product, causing periodic off-by-one framesForse già presa @ShamanicArts l’ha presa oggi. Aperta
Difficoltà 2/5 1-3 ore Idoneità per principianti 82/100
dmtrKovalenko/fframes#296 ·
I maintainer di solito rispondono entro 1 giorno