Struct, the method uses data from struct

Will you help me, how the method can access to struct data?
For instance:

struct DF{Td}
data::Td
function square()
return data^.2
end
end

It seems you are trying to use Julia like C++, but it is a very different language. You may want to read the manual, at least up to “Methods”.

(Please quote your code).

5 Likes