From 8d661a1e0645554d9bdee7026440510199355ce0 Mon Sep 17 00:00:00 2001 From: jackfoxy Date: Tue, 6 Jan 2026 08:59:52 -0800 Subject: [PATCH] add example to tree addressing peg doc --- content/hoon/stdlib/1b.md | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/content/hoon/stdlib/1b.md b/content/hoon/stdlib/1b.md index 50316dc8..32e13e8b 100644 --- a/content/hoon/stdlib/1b.md +++ b/content/hoon/stdlib/1b.md @@ -289,6 +289,13 @@ An `$atom`. %2 ``` +``` +> %+ peg + (add (mul 2 +:(~(dig by outer) outer-key)) 1) + (add (mul 2 +:(~(dig by inner) inner-key)) 1) +477 +``` + #### Discussion In other words, the subtree at address `.a` is treated as a tree in its own right (starting with root `+1`, head `+2`, and tail `+3`). Relative address `.b` is found with respect to `.a`, and then its absolute address, within the greater tree, is returned.