Sha256: 78644b0e7ba405c720d385d6c0f1e0753d94662ae3d8b7aab1f99bc2b49ce816

Contents?: true

Size: 793 Bytes

Versions: 6

Compression:

Stored size: 793 Bytes

Contents

# Native

User-defined tuple predicate

## Signature

native(predicate: (Tuple -> Boolean)) -> Predicate

## Examples
->(t){ t.city == 'London' }

## Description

So called 'native' predicates are functions computing truth values from
tuples.

## Implementation notes

Native predicates can be any ruby Proc object of arity 1. The argument
will be a Tuple instance. the Proc SHOULD return true or false, but ruby
patterns for boolean expressions are supported to (such a nil evaluating
to false, etc.).

Note that, as of current Alf version, native predicates cannot be delegated
to an underlying data engine, and are not compiled to SQL in particular.
Please always use predicate factories such as `eq(:city, 'London')` if
possible, as they do not hurt logical optimizations and compilation.

Version data entries

6 entries across 6 versions & 1 rubygems

Version Path
alf-shell-0.16.4 doc/txt/native.txt
alf-shell-0.16.3 doc/txt/native.txt
alf-shell-0.16.2 doc/txt/native.txt
alf-shell-0.16.1 doc/txt/native.txt
alf-shell-0.16.0 doc/txt/native.txt
alf-shell-0.15.0 doc/txt/native.txt