Predicate
A predicate is a condition, expression, or function evaluated against an input or context to determine whether a specified criterion holds.
Clojure: The Essential Reference
A predicate is a function whose result is interpreted as a boolean condition, even when its returned value is not literally boolean.
- How it is used
- Uses predicates to select collection items, answer all-or-any questions, compose checks, and enforce function conditions.
- How deep it goes
- Defines the unary contract and truth-value interpretation, then details return values, short-circuiting, laziness, and assertion failures.
- Examples
- Demonstrates odd-number filtering, palindrome checks, email spam detection, prize lookup, and validation before and after saving an item.
- What you can do after
- Apply it via Clojure's filter, remove, every?, some, every-pred, and some-fn to select values and combine checks.
Read how Clojure: The Essential Reference explains predicate →
Kafka Streams in Action, Second Edition
Predicate is a boolean-valued functional interface that evaluates a record to determine whether it belongs in a branch.
- How it is used
- Routes Kafka Streams records through filters, branches, and data-driven aggregation decisions.
- How deep it goes
- Explains predicate use through filter and split APIs, then shows Processor API tests without detailing predicate internals.
- Examples
- Uses reward-qualifying purchases, coffee and electronics routing, and sensor-driven aggregation.
- What you can do after
- Apply it via Kafka Streams to retain, drop, route, or aggregate records by record-level conditions.
Read how Kafka Streams in Action, Second Edition explains predicate →
Learn SQL in a Month of Lunches
A predicate is a Boolean SQL expression that evaluates whether a condition holds for data involved in a query operation.
- How it is used
- Uses predicates to join related tables, filter query results, and limit multitable updates.
- How deep it goes
- Defines true, false, and unknown evaluation, then demonstrates join, filter, and multitable-update predicate placement without formal evaluation internals.
- Examples
- Demonstrates matching orderheader to customer for order 1001 and changing prices of titles linked to AuthorID 12.
- What you can do after
- Apply predicates to match table rows, restrict results, and recognize product-specific multitable UPDATE syntax.
Read how Learn SQL in a Month of Lunches explains predicate →
Kotlin in Action, 2E
A predicate function is a function that evaluates an input and returns a Boolean indicating whether it satisfies a condition.
- How it is used
- Uses Boolean-returning functions to query, filter, and validate elements in collections and sequences.
- How deep it goes
- Explains predicate syntax, collection behavior, higher-order implementation, negation choices, and empty-collection edge cases.
- Examples
- Demonstrates age checks, collection queries, character filtering, empty collections, and configurable contact-list filtering.
- What you can do after
- Apply predicates via Kotlin collection functions and implement higher-order functions that accept or return filtering logic.
100 C++ Mistakes and How to Avoid Them
A predicate is a Boolean-valued function that determines whether a value satisfies a condition.
- How it is used
- Uses predicates to retain or reject values in ranges and to express Boolean tests directly.
- How deep it goes
- Defines predicates, demonstrates filtering, and refactors a verbose Boolean implementation without descending into internals.
- Examples
- Uses even-number testing, absolute-value transformation, range filtering, and accumulation over retained values.
- What you can do after
- Apply it via std::views::filter and write concise functions that return computed Boolean results directly.
Read how 100 C++ Mistakes and How to Avoid Them explains predicate →
Related concepts
- filteringused by · Filtering is the operation of selecting or excluding items from data or a collection according to specified criteria.
- functionkind of · A function is a callable program unit that performs an operation, may accept inputs, and can produce a result or side effect.
- booleanproduces · A Boolean is a logical type or value representing truth or falsity, conventionally with two states: true and false.
- KStream.splitused by · KStream.split is a Kafka Streams DSL method that begins branching a KStream and returns a BranchedKStream.
- BranchedKStream.branchused by · BranchedKStream.branch is a Kafka Streams method that creates a branch by applying a predicate and branch-processing definition to records.
These guides are generated from the text of Manning books by Manning's knowledge graph and link to the sections they draw on. The full books are available on liveBook and at manning.com.




