I’m building a function that receives an object as input, and depending on whether the type of this object is standard or user-defined (=composite type defined by the user through a struct) it must do one thing or another. Something like
function kroky(x) if typeof(x) == user_defined println("user-defined variable") else println("system-defined variable") end end
such that if I define
mutable struct conch x :: Int y :: Float64 conch() = new() end
zz = conch() zz.x = 1 zz.y = 3.1416
kroky(zz) > user-defined variable kroky(3.0) > system-defined variable
Of course the action example is quite basic in this case, but I hope you get the idea of what I am after.
Thx for your help and happy new year