refactor: rename DTree to DValue

This commit is contained in:
udo
2026-06-12 11:05:52 +00:00
parent 941f5aea08
commit 7066da3cde
157 changed files with 1203 additions and 1074 deletions
+4 -4
View File
@@ -1,5 +1,5 @@
:sig
u64 DTree::to_u64(u64 default_value = 0) const
u64 DValue::to_u64(u64 default_value = 0) const
:params
default_value : returned when the value is missing or cannot be parsed as a number
@@ -7,7 +7,7 @@ return value : the value as an unsigned 64-bit integer, or `default_value`
:see
>types
0_DTree
0_DValue
json_decode
int_val
to_bool
@@ -15,7 +15,7 @@ to_s64
to_f64
:content
Reads a `DTree` value as an unsigned integer. This is a read accessor: it is `const`, never creates or modifies nodes, and dereferences internal references automatically.
Reads a `DValue` value as an unsigned integer. This is a read accessor: it is `const`, never creates or modifies nodes, and dereferences internal references automatically.
String values are trimmed and parsed permissively, like `to_s64()`. Boolean values become `1` or `0`. Negative values clamp to `0`, and results above the `u64` range clamp to the maximum.
@@ -34,7 +34,7 @@ u64 limit = context.get["limit"].to_u64(50);
u64 owner_id = row.get_by_path("owner/id").to_u64();
```
Use this for counts, identifiers, limits, timestamps, and other non-negative numeric values stored inside a `DTree`.
Use this for counts, identifiers, limits, timestamps, and other non-negative numeric values stored inside a `DValue`.
## Related Concepts