I’ve never seen this iteration syntax before. It seems that any function application can be used as a variable of iteration, so long as its arguments (but not necessarily the function itself) are defined, and the function “declaration” is syntactically valid. Where is this documented? Why is it supported? and when would one want to use it?
x = "hi" # "hi" [x for f(x) in 1:3] # ["hi", "hi", "hi"] [f(x) for f(x) in 1:3] # [1, 2, 3] [f(y) for f(y) in 1:3] # ERROR: UndefVarError: y not defined [f(0) for f(0) in 1:3] # ERROR: syntax: "0" is not a valid function argument name [f(x, x) for f(x, x) in 1:3] # ERROR: syntax: function argument name not unique: "x"