Yes, I did even think when I was writing " this is a annulled by how my arguments could be slightly different -- but my intention was more to show how this could be applied to something larger. For this type of thing, it can be very difficult to build contexts for more complex things.
The point here is more something like this: You have a function that does a bunch of steps to convert a `Dict` to the fields in your structure.
You need to build a new dispatch, a new inner constructor, for a `DataFrame` -- because you want the end-user to be able to provide both.
You could write a quick " 1-liner" to do such a dispatch:
MyStruct(d::DataFrame) = MyStruct(Dict(pairs(eachcol(d))))
-- point being it would have been a more nuanced use-case a lot of the time and this is typically used with some constructors with a lot of fields and data -- because it also ruins the point of having such a constructor if there is not much code to the other constructor other than providing fields.
So yes, my example is inadequate, but somewhat intentionally to deliver the concept in the most simple way possible. I mean the one liner is easy if you know all the methods but I think huge method strings can also be confusing if you don't know the return type of each method, or what certain things are for or do -- so I try to keep it simple ! Especially for this style of article -- this gets more reads than my articles about projects and crazier concepts, so its nice to give new crowd exposure. Thus; I also have to explain things like an what an inner constructor actually is -- these articles I feel still remain somewhat beginner friendly despite showing some pretty cool concepts.
Sometimes I do worry this is not always the right choice, but I am glad for your response so I could clarify. Also no problem with anything, thank you for reading! Have a wonderful day.