You can also use @with
from @Mason’s StaticModules.jl package:
It works on any object that supports both propertynames
and getproperty
, which includes structs, named tuples, and dataframes.
Although since he didn’t mention it himself, perhaps he prefers not to promote that package.