refactor: rename DTree to DValue
This commit is contained in:
@@ -1,24 +1,24 @@
|
||||
:sig
|
||||
bool DTree::is_list() const
|
||||
bool DValue::is_list() const
|
||||
|
||||
:params
|
||||
return value : true when the node is a sequential, numerically indexed container
|
||||
|
||||
:see
|
||||
>types
|
||||
0_DTree
|
||||
0_DValue
|
||||
is_array
|
||||
push
|
||||
each
|
||||
dtree_values
|
||||
dv_values
|
||||
|
||||
:content
|
||||
Tests whether a map-shaped `DTree` represents a list: its keys are the numeric strings `"0"`, `"1"`, `"2"`, ... in unbroken sequence. This is a read accessor: it is `const`, never creates or modifies nodes, and dereferences internal references automatically.
|
||||
Tests whether a map-shaped `DValue` represents a list: its keys are the numeric strings `"0"`, `"1"`, `"2"`, ... in unbroken sequence. This is a read accessor: it is `const`, never creates or modifies nodes, and dereferences internal references automatically.
|
||||
|
||||
Containers built with `push()` are lists. An empty container counts as a list when it was created with `set_array()` or `push()`; a keyed map (or a map with gaps in its numeric keys) is `is_array()` but not `is_list()`.
|
||||
|
||||
```cpp
|
||||
DTree items;
|
||||
DValue items;
|
||||
items.push(first_item);
|
||||
items.push(second_item);
|
||||
// items.is_list() == true
|
||||
@@ -27,7 +27,7 @@ items["custom"] = "x";
|
||||
// items.is_list() == false, items.is_array() == true
|
||||
```
|
||||
|
||||
`dtree_map()` and `dtree_filter()` use this distinction to decide whether results re-index from zero or keep their original keys.
|
||||
`dv_map()` and `dv_filter()` use this distinction to decide whether results re-index from zero or keep their original keys.
|
||||
|
||||
## Related Concepts
|
||||
|
||||
|
||||
Reference in New Issue
Block a user