This creates a compiled function that is listable:
It operates on a single input in normal fashion:
When the arguments include a list that does not match the input specification, it threads the function over that argument:
This compiled function is not listable:
An error results when the argument specification does not match:
If there is a branch, listability needs a function to be defined, as shown below using
Function:
A listable compiled function does the same thing much faster:
A listable compiled function can run in parallel, giving an acceleration on multicore machines: