Please help me with the meaning of dot and three dots (...) in this code line:

(x → typeof(x)).(values(complexity_of_operators))…,
Notes: complexity_of_operators is a dictionary
I don’t know what the dot between the two parentheses means or what the … means at the end.

. Multi-dimensional Arrays · The Julia Language
Frequently Asked Questions · The Julia Language…-operator:-slurping-and-splatting

1 Like

And to answer the first part of your question:

The (x -> typeof(x)) part is an anonymous function that maps x to the type of x (the arrow should be two ascii characters, not the Unicode arrow in your example, at least on my system). The dot broadcasts the function to operate over the values of an array, returning an array as a result. So you can do in the REPL:

julia> (x -> typeof(x)).([1, 'x', "x"])                                                                                       
3-element Vector{DataType}:                                                                                                    
1 Like

Note also that there’s no reason to create an anonymous function here. This is the same as just typeof.


is just

typeof.([1, 'x', "x"])
1 Like