This commit is contained in:
root
2026-06-15 21:42:50 +00:00
parent 34a97e2577
commit 99cd92fb4a
126 changed files with 1615 additions and 1057 deletions
+6 -5
View File
@@ -12,7 +12,8 @@ unit_render
3_C++ Preprocessor
map
filter
dv_filter
2_DValue_filter
2_DValue_map
:content
UCE is server-first C++ with a small template preprocessor. It does not try to be React, but several concepts map cleanly.
@@ -45,10 +46,10 @@ That keeps file-based and hierarchical routing in normal UCE code instead of hid
The function library includes small collection helpers for common route/menu/card transformations:
```cpp
auto visible = filter(routes, [](String route) { return(route != "admin"); });
auto labels = map(visible, [](String route) { return(to_upper(route)); });
DValue app_items = dv_filter(menu, [](DValue item, String key) { return(item["section"].to_string() == "app"); });
DValue by_section = dv_group_by(menu, [](DValue item, String key) { return(item["section"].to_string()); });
auto visible = routes.filter([](String route) { return(route != "admin"); });
auto labels = visible.map([](String route) { return(to_upper(route)); });
DValue app_items = menu.filter([](DValue item, String key) { return(item["section"].to_string() == "app"); });
DValue labels_by_key = menu.map([](DValue item, String key) { DValue out; out = item["label"].to_string(); return(out); });
```
Use these when a short transformation is clearer than a loop. Prefer explicit loops for side effects or multi-step validation.