-
Notifications
You must be signed in to change notification settings - Fork 2
Open
Description
Don't try to understand the title. Look at this scenario instead:
What is your root question?
> Who wrote Gödel, Escher, Bach?
Question: [$1: Who wrote Gödel, Escher, Bach?]
Scratchpad: [$2: ]
Subquestions:
> ask $1
Question: [$1: Who wrote Gödel, Escher, Bach?]
Scratchpad: [$2: ]
Subquestions:
1.
[$q1: [$1: Who wrote Gödel, Escher, Bach?]]
$a1
$w1
> unlock $a1
Question: [$1: $3]
Scratchpad: [$2: ]
Subquestions:
> ask $1
[Goes into endless loop.]
The same happens with sub-questions of sub-questions.
The endless loop occurs in Context.is_own_ancestor:
def is_own_ancestor(self, db: Datastore) -> bool:
initial_workspace = db.canonicalize(self.workspace_link)
context: Optional[Context] = self.parent
while context is not None:
if context == self and db.canonicalize(context.workspace_link) == initial_workspace:
return True
context = context.parent
return FalseApparently the context has become its own ancestor, so context.parent never is None.
Of course it doesn't make sense to re-ask a context's question, so patchwork should detect this kind of scenario and raise an error. More concretely: Raise an error if the argument to AskSubquestion is a pointer to the current context's question.
This is related to issue #12.
Metadata
Metadata
Assignees
Labels
No labels