The head isn’t a Symbol call but literally a comprehension. Is call for all non-built-in functions?
The first Arg for comprehension Expr isn’t a Symbol but an expression. 1: Expr.
How do we know which functions have Symbols as their first Arg and which have expressions? And why don’t all functions have Symbols as their first Arg?
call is for function calls. Comprehensions are not a function call (at one level of understanding, you can’t write a new method for comprehension)
The structure of :comprehension expressions is different to :call. But even :call might not have a symbol as their first argument:
julia> dump(:(a.x(1)))
Expr
head: Symbol call
args: Array{Any}((2,))
1: Expr
head: Symbol .
args: Array{Any}((2,))
1: Symbol a
2: QuoteNode
value: Symbol x
2: Int64 1
Perhaps a better question to start with is, What are you trying to do?
You might also be interested in looking at the lowered IR. In general most syntax in julia corresponds to function calls, but they don’t show up until lowering:
There is a bit of junk here to set up the (_,_)->rand() closure, but the key part is at the bottom. You can see the comprehension essentially lowers to: collect(Base.Generator((_, _)->rand(), Base.product(1:3, 1:3)))