Wolfram Research has had the same documentation for this function for the last 8 years at least:
Thread[f[args]]
"threads" f over any lists that appear in args.
A lovely circular definition if I've ever seen one.
Does anyone know what the actual semantics are and can provide a proper explanation that is non-circular?
It works similarly to Python's
zip()
function, but in a slightly more general fashion. For example:Thread is a bit like a generalization
zip
from other functional languages.For simple cases, where all the elements of args from your example are lists,
is equivalent to
as shown in the first couple examples in the documentation. The major wrinkle is when you have args that are not lists, in which case they're effectively curried out; for example,
is equivalent to
I usually find myself using Thread to construct lists of rules or lists of equations.