Switch to edit mode.
Name(s): chparent_info1: ":chparent_info(from, to) => { disinheritors, inheritors }"
2: "Returns a list of all objects who would lose a descendant,"
3: "and a list of all objects who would gain a descendant, if"
4: "an object were chparent'd from 'from' to 'to'."
5: "(cf. :move_info)."
6: disinheritors = {}
7: o = args[1]
8: while (valid(o))
9: disinheritors = listappend(disinheritors, o)
10: o = parent(o)
11: endwhile
12: inheritors = {}
13: o = args[2]
14: while (valid(o))
15: inheritors = listinsert(inheritors, o)
16: o = parent(o)
17: endwhile
18: while (disinheritors && inheritors && inheritors[1] == disinheritors[length(disinheritors)])
19: inheritors = listdelete(inheritors, 1)
20: disinheritors = listdelete(disinheritors, length(disinheritors))
21: endwhile
22: return {disinheritors, inheritors}