@@ -271,9 +271,23 @@ Multiple binding sets specified this way are independent of each other. The abov
271271 - If ``y `` is bound, then ``x `` and ``y `` are bound.
272272
273273That is, ``bindingset[x] bindingset[y] ``, which states that at least one of ``x `` or ``y `` must
274- be bound, is different from ``bindingset[x,y] ``, which states that both ``x `` and ``y `` must be
274+ be bound, is different from ``bindingset[x, y] ``, which states that both ``x `` and ``y `` must be
275275bound.
276276
277+ The latter can be useful when you want to declare a :ref: `predicate with result <predicates-with-result >` that takes multiple input arguments.
278+ For example, the following predicate takes a string ``str `` and truncates it to a maximum length of ``len `` characters::
279+
280+ bindingset[str, len]
281+ string truncate(string str, int len) {
282+ if str.length() > len
283+ then result = str.prefix(len)
284+ else result = str
285+ }
286+
287+ You can then use this in a :ref: `select clause <select-clauses >`, for example::
288+
289+ select truncate("hello world", 5)
290+
277291.. _database-predicates :
278292
279293Database predicates
@@ -283,7 +297,7 @@ Each database that you query contains tables expressing relations between values
283297("database predicates") are treated in the same way as other predicates in QL.
284298
285299For example, if a database contains a table for persons, you can write
286- ``persons(x, firstName, _, age) `` to constrain ``x ``, ``firstName `` and ``age `` to be the
300+ ``persons(x, firstName, _, age) `` to constrain ``x ``, ``firstName ``, and ``age `` to be the
287301first, second, and fourth columns of rows in that table.
288302
289303The only difference is that you can't define database predicates in QL. They are defined by the
0 commit comments