From a08ae1d024ab32e014e847ae7f70a661e7e380a3 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?J=C3=B6rg=20Thalheim?= Date: Thu, 25 Sep 2025 08:45:27 +0200 Subject: [PATCH] doc: Add release notes for C API lazy accessors --- doc/manual/rl-next/c-api-lazy-accessors.md | 16 ++++++++++++++++ 1 file changed, 16 insertions(+) create mode 100644 doc/manual/rl-next/c-api-lazy-accessors.md diff --git a/doc/manual/rl-next/c-api-lazy-accessors.md b/doc/manual/rl-next/c-api-lazy-accessors.md new file mode 100644 index 000000000..bd0604f0d --- /dev/null +++ b/doc/manual/rl-next/c-api-lazy-accessors.md @@ -0,0 +1,16 @@ +--- +synopsis: "C API: Add lazy attribute and list item accessors" +prs: [14030] +--- + +The C API now includes lazy accessor functions for retrieving values from lists and attribute sets without forcing evaluation: + +- `nix_get_list_byidx_lazy()` - Get a list element without forcing its evaluation +- `nix_get_attr_byname_lazy()` - Get an attribute value by name without forcing evaluation +- `nix_get_attr_byidx_lazy()` - Get an attribute by index without forcing evaluation + +These functions are useful when forwarding unevaluated sub-values to other lists, attribute sets, or function calls. They allow more efficient handling of Nix values by deferring evaluation until actually needed. + +Additionally, bounds checking has been improved for all `_byidx` functions to properly validate indices before access, preventing potential out-of-bounds errors. + +The documentation for `NIX_ERR_KEY` error handling has also been clarified to specify when this error code is returned. \ No newline at end of file