Just a note with regards to DataFrames, unfortunately this isn’t possible to make performant with DataFrames. See this post outlining a similar feature yesterday.
Since the property names of a dataframe aren’t inferrable, any expression whose final form depends on the types in an if/else
way won’t have all the optimizations available that normal functions have. If you don’t want special designations for columns, i.e. df.x
referenced by the Symbol
:x
then you would need to treat every “variable” in the expression as a column. This can get complicated very quickly.