January 2020
Intermediate to advanced
532 pages
13h 31m
English
In Julia, functions are first class. This means that functions can be passed around as variables and can appear in method arguments. Since we have learned about the covariance property of method arguments, how do we handle the situation where functions are passed as arguments?
The best way to understand this is to see how functions are typically passed. Let's pick a simple example from Base:

The all function can be used to check whether a certain condition is evaluated as true for all elements in an array. To make it more flexible, it can accept a custom predicate function. For example, we can check whether all numbers ...
Read now
Unlock full access