Member deletion
- Dominant language
- Java
- Stars
- 11.5k
- Forks
- 402
- Avg merge
- 1d 15h
- Merged PRs (30d)
- 20
Description
Currently in the language reference the following solution for removing fields is recommended:
```pkl
// https://pkl-lang.org/main/current/language-reference/index.html#transforming-objects
dodo {
name = "Dodo"
extinct = true
}
dodo
.toMap()
.remove("name")
.toDynamic()
```
Instead, create a built-in singleton value `absent` (similar to `null`), which would remove the corresponding member from the object:
```
dodo {
name = "Dodo"
extinct = true
}
dodoWithoutName = (dodo) {
name = absent
}
```
Contributor guide
Research direction
Start with the language reference's “transforming objects” section and the linked example. Determine how a built-in `absent` singleton should remove members during object transformations, then verify that the documented example expresses the intended result.
Written by the indexing model from the issue text.
Assessment
- Domain
- compilers
- Issue type
- Feature
- Difficulty
- 5/5
- Estimated time
- Over a week
- Activity status
- Stale
- Clarity
- Mostly clear
- Newbie friendliness
- 30/100