manifest { t_data = 0, t_left = 1, t_right = 2, sizeof_t = 3 } let info = nil; let coroutA = nil, coroutB = nil, coroutC = nil; let scan(tptr) be // tptr is the pointer to the root node of the tree, { let ok; if ptr = nil then return; scan(tptr ! t_left); info := tptr ! t_data; resume(coroutA); scan(tptr ! t_right); } let checker() be { while true do { let data1 = nil, data2 = nil; if alive(coroutB) then { resume(coroutB); data1 := info } if alive(coroutC) then { resume(coroutC); data2 := info } if data1<>data2 then { outs("They are different\n"); return } unless data1 \/ data2 do { outs("They are the same\n"); return } } } let start() be { let tree1, tree2; // fill the two trees with data coroutA := create_coroutine(checker); coroutB := create_coroutine(scan, tree1); coroutC := create_coroutine(scan, tree2); resume(coroutA) }