Skip to content

Commit 37ae354

Browse files
Update changelog
1 parent ab3752d commit 37ae354

File tree

1 file changed

+15
-1
lines changed

1 file changed

+15
-1
lines changed

CHANGELOG.md

Lines changed: 15 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,21 @@
77
### New features
88

99
- `Sexp` now has `.is_scalar_na()`, which returns `true` if the SEXP is a length-1 of
10-
vector containing `NA` (#391).
10+
vector containing `NA`. This is useful when you want to let your function accept
11+
`NA` in addition to a typed vector (#391).
12+
13+
```rs
14+
#[savvy]
15+
fn some_func_handling_double(x: savvy::Sexp) -> savvy::Result<savvy::Sexp> {
16+
if x.is_scalar_na() {
17+
// treat NA
18+
}
19+
20+
let x_real: RealSexp = x.try_into()?;
21+
22+
...
23+
}
24+
```
1125

1226
## [v0.8.12] (2025-07-20)
1327

0 commit comments

Comments
 (0)