Elektrine lite

← Feed

@chemoelectric@masto.ai

Post #2191177

2026-05-05 18:30 UTC

Say you want to go forwards in-order. Your iterator is something that can go in various ways. Here what it must first do is start at the root node and then follow every left node until it reaches the leaf. This is its actual start point. Along the way it must store backtracking data. The next node is the first backtrack. After that comes the right subtree of the first backtrack. Then one must do the second backtrack. And so on like that. Can this be done in continuation-passing style?

Replies (1)

  • @chemoelectric@masto.ai 2026-05-05 18:31

    It occurs to me that perhaps it can be, using a dispatch table. But I would have to look into it. In Scheme it can be done simply by writing a continuation point into a variable.

    Open ##2191178