In Julia, is there a way to write a macro that compiles based on the (compile-time) type of its arguments, at least for arguments whose types can be inferred at compile time? For example, in the example below, I created a function called code_type that returns the compile time type x . Is there any function like this, or any way to produce this behavior? (Or macros expand before types are inferred, so this is not possible.)
macro report_int(x) code_type(x) == Int64 ? "it an int" : "not an int" end
Jeff source share