Pred multimethod

Methods

Pred(anything:BasicTypeInstance)deprecated Source: stdlib.ngs:247
Convert anything to a predicate.

Parameters

anythingThe value to compare to

Returns

A function that compares the only argument to the given value
Pred(h:Hash) Source: stdlib.ngs:255
Convert Hash to a predicate. The predicate asserts that object fields named after h hash keys return true for predicates made of corresponding hash values. Inspired by underscorejs' "matcher"
Pred(f:Fun) Source: stdlib.ngs:267
Convert a function to predicate.

Returns

The given function, without any transformation
Pred(t:Type) Source: stdlib.ngs:272
Convert a type to a predicate.

Parameters

tA type

Returns

A function that checks whether the only argument is of type t
Pred(s:SubSeq) Source: stdlib.ngs:5697
Undocumented
Pred(r:RegExp) Source: stdlib.ngs:5883
Convert regular expression to a predicate.

Returns

A function that checks whether the only argument (of type Str) matches r

Example

%[w1 w2].filter(/1/)  # %[w1]