File tree Expand file tree Collapse file tree 1 file changed +9
-3
lines changed
docs/language/ql-handbook Expand file tree Collapse file tree 1 file changed +9
-3
lines changed Original file line number Diff line number Diff line change @@ -83,7 +83,7 @@ For example::
8383 result = x * y
8484 }
8585
86- This predicates returns the following results:
86+ This predicate returns the following results:
8787
8888+---+---+--------+
8989| x | y | result |
@@ -96,8 +96,14 @@ This predicates returns the following results:
9696+---+---+--------+
9797
9898A benefit of writing a query predicate instead of a select clause is that you can call the
99- predicate in other parts of the code too. In contrast, the select clause is like an anonymous
100- predicate, so you can't call it later.
99+ predicate in other parts of the code too. For example, you can call ``getProduct `` inside
100+ the body of a :ref: `class <classes >`::
101+
102+ class MultipleOfThree extends int {
103+ MultipleOfThree() { this = getProduct(_, _) }
104+ }
105+
106+ In contrast, the select clause is like an anonymous predicate, so you can't call it later.
101107
102108It can also be helpful to add a ``query `` annotation to a predicate while you debug code. That
103109way you can explicitly see the set of tuples that the predicate evaluates to.
You can’t perform that action at this time.
0 commit comments