I encounter a code snippet like this
struct F
matt::Mtype
latt::LType
end
function (U::F)(x::Tuple)
idx = getindex(U.latt, x)
getindex(U.matt, idx...)
end
I can call the function using an instance of F
, say A=F()
, and A((3,2))
gives some sensible answer.
methods(A)
gives 1 method for for generic function "(::F)"
I couldn’t find where this type of usage is documented and how to understand this syntax. Any pointer will be appreciated.