From 61e37ce8ecf1af77c552bef0bf117ccb14623aea Mon Sep 17 00:00:00 2001 From: Denis Kiptui <115914094+kiptuidenis@users.noreply.github.com> Date: Tue, 23 Sep 2025 18:59:14 +0300 Subject: [PATCH] docs: fix misleading comment on walker traversal of FriendsWith edges The current documentation for walker traversal shows the example: # Now, tell the walker to go to all connected friends visit [->:FriendsWith:->]; However, this is misleading. The walker does *not* visit "all connected friends" if the graph contains edges pointing into the current node. For example, starting the walker from Bob or Charlie in a simple FriendsWith network will skip some connections, because [->:FriendsWith:->] only follows *outgoing* edges. To correctly traverse all connected friends regardless of edge direction, the example should use: visit [<-:FriendsWith:->]; This tells the walker to follow both incoming (<-) and outgoing (->) FriendsWith edges, which matches the intended "all connected friends" behavior. This commit updates the comment and example code in the docs to prevent confusion for new Jac learners. It also aligns the explanation with the actual runtime behavior. --- docs/docs/jac_book/chapter_1.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/docs/docs/jac_book/chapter_1.md b/docs/docs/jac_book/chapter_1.md index b48a509c03..8f55799821 100644 --- a/docs/docs/jac_book/chapter_1.md +++ b/docs/docs/jac_book/chapter_1.md @@ -182,7 +182,7 @@ walker GreetFriends { print(f"Hello, {here.name}!"); # Now, tell the walker to go to all connected friends - visit [->:FriendsWith:->]; + visit [<-:FriendsWith:->]; } } }