I think it may just boil down to being a historical artifact - until
recently (and only in v0.5, AFAIK), macros were handled rather differently
from functions.
Now that macros actually act like functions, and have different methods (of
course limited to types known at parse time, symbols, numeric literals,
etc.),
it might be more consistent to simply have macros defined as functions.
I.e. instead of:
macro foo(x)
return :( $(string("Prefix",x)))
end
you could have
foo(x) = :( $(string("Prefix",x)))
On the other hand, that would prevent having a function with the same name
as a macro.
On Sunday, June 5, 2016 at 10:48:51 AM UTC-4, Rafael Fourquet wrote:
>
> I think the OP's question is not about the difference between a macro
> and a function, but rather about the syntactic way of defining a
> macro: if a macro can be seen as a function taking an expression and
> returning another one, why can't we just define a macro with the
> standard function syntax (i.e. without the macro keyword), and inform
> the compiler that we want to use it as a macro only at the call site,
> by invoking it prepended with the @ sign.
>