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
+3 -3
View File
@@ -1,5 +1,5 @@
:sig
s64 DTree::to_s64(s64 default_value = 0) const
s64 DValue::to_s64(s64 default_value = 0) const
:params
default_value : returned when the value is missing or cannot be parsed as a number
@@ -7,14 +7,14 @@ return value : the value as a signed 64-bit integer, or `default_value`
:see
>types
0_DTree
0_DValue
to_u64
to_f64
to_bool
to_string
:content
Reads a `DTree` value as a signed integer. This is a read accessor: it is `const`, never creates or modifies nodes, and dereferences internal references automatically.
Reads a `DValue` value as a signed 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: plain integers, floating-point forms (truncated toward zero), and the boolean words understood by `to_bool()` (`yes` reads as `1`) all convert. Results outside the `s64` range clamp to the range boundaries. Boolean values become `1` or `0`.