Jack William Bell<p>Interesting idea, although I don't know if it needs to be a primitive. The os.tree() function in <a href="https://rustedneuron.com/tags/Python" class="mention hashtag" rel="nofollow noopener noreferrer" target="_blank">#<span>Python</span></a> does this for file systems and, as a model, could be used as the basis for other kinds of tree structures. (Note that os.tree() also properly handles both top down and bottom up processing.)</p><p>> Programming languages should have a tree traversal primitive. <a href="https://blog.tylerglaiel.com/p/programming-languages-should-have" rel="nofollow noopener noreferrer" translate="no" target="_blank"><span class="invisible">https://</span><span class="ellipsis">blog.tylerglaiel.com/p/program</span><span class="invisible">ming-languages-should-have</span></a></p><p><a href="https://rustedneuron.com/tags/programming" class="mention hashtag" rel="nofollow noopener noreferrer" target="_blank">#<span>programming</span></a> <a href="https://rustedneuron.com/tags/C" class="mention hashtag" rel="nofollow noopener noreferrer" target="_blank">#<span>C</span></a> <a href="https://rustedneuron.com/tags/CPP" class="mention hashtag" rel="nofollow noopener noreferrer" target="_blank">#<span>CPP</span></a> <a href="https://rustedneuron.com/tags/algorithms" class="mention hashtag" rel="nofollow noopener noreferrer" target="_blank">#<span>algorithms</span></a> <a href="https://rustedneuron.com/tags/DataStructures" class="mention hashtag" rel="nofollow noopener noreferrer" target="_blank">#<span>DataStructures</span></a></p>