Understanding behavior of recursive functions
I am trying to see if I can get a better understanding of this example
In the statement
let $parent in transitive_places($middle);, is the variable $parent scoped only to its branch of the disjunction or the entire disjunction?1 Reply
Entire disjunction.
I've tried to explain the variable naming rules here: https://typedb.com/docs/core-concepts/typeql/query-variables-patterns#_disjunctions
The tl;dr is variable names are scoped to the pipeline - in this case the whole body of the function.
(Select, delete, and (I think) reduce stages free up variable names to be re-used in subsequent stages)