feat: add path and collection standard library helpers

This commit is contained in:
Hermes Agent
2026-07-09 21:04:25 -06:00
parent f907cfb63c
commit c66c122c30
10 changed files with 182 additions and 42 deletions
+20
View File
@@ -239,6 +239,26 @@ packages/
Package names are checked so unsafe names such as `../bad` are rejected.
## Standard-library path and collection helpers
Claro includes tested, namespaced helpers for everyday programs:
```claro
IMPORT "lib/path.claro" AS path
IMPORT "lib/collections.claro" AS collections
CALL path.join WITH "notes", "today.txt"
SAY RESULT
SET names AS LIST OF TEXT TO LIST
ADD "Ada" TO names
ADD "Grace" TO names
CALL collections.join WITH names, " and "
SAY RESULT
```
The `path` module includes `join`, `basename`, `dirname`, `ext`, `stem`, and `absolute`. The `collections` module includes list length/search/join/reverse helpers and map key/value/default-access helpers. See `docs/STDLIB.md` for the complete, current API.
## Networking
v1.18.26 adds safer beginner networking commands with offline `claro://` test URLs.