Fork me on GitHub
#beginners
<
2016-03-20
>
ivar20:03:47

I’m not sure I understand the term ‘predicate’.. is it basically any expression that returns a boolean value ?

tmtwd20:03:21

I think that is accurate

ivar20:03:41

thanks, I saw predicate used in a clojure context and actually consulted the above wikipedia page, but was not totally sure

adamkowalski20:03:49

ivar a predicate practically can be thought of as what you said

adamkowalski20:03:33

if you are filtering over a vector you pass a “predicate” function to the filter function and any elements of the vector which pass the predicate are kept in the new vector

adamkowalski20:03:51

(filterv even? [1 2 3 4 5]) -> [2, 4]