I don't think this is correct actually. With Julia's metaprogramming 
abilities, all macros could be handled by runtime functions. 

The rule I follow is that macros should be used when some processing needs 
to be done at compile time / source-processing time. Usually, that's 
exactly when you want to programmatically generate code for a function. In 
particular, I thought it was widely regarded that calling on 'eval' was a 
sign you should consider using macros for your problem if possible.

So I think the first reply from Mauro is the most Julian solution. Unless 
there's something really weird like the function name isn't known until 
runtime, in which case no macro can work.

On Sunday, May 31, 2015 at 5:48:41 AM UTC-7, Tom Lee wrote:
>
> ...
>
> Also, I should clarify that when I wrote "My understanding is that you 
> should never use a macro if you can easily write an equivalent function" I 
> meant you should not create a new macro to do something that can just as 
> easily be done by a function - not that existing macros like @eval should 
> be avoided.
>

Reply via email to