Right. Also, to answer the reverse question, a macro can't do anything with the value or type that will be assigned at runtime (this sounds obvious, but comes up very often)
Also note that since a macro is only an AST manipulation, it can't do anything that couldn't be done by typing that same AST into your function in the first place On Saturday, June 21, 2014, Patrick O'Leary <[email protected]> wrote: > The answer to your question about the second part of Jameson's response is > the first part of Jameson's response--at compile time you can still modify > the syntax tree of the program. > > On Saturday, June 21, 2014 1:50:45 PM UTC-5, Andrew McKinlay wrote: >> >> What can I do at compile-time that I can't at run-time? >> On Jun 21, 2014 2:49 PM, "Jameson Nash" <[email protected] >> <javascript:_e(%7B%7D,'cvml','[email protected]');>> wrote: >> >>> A macro inserts the result back into the AST. and it is called at >>> compile-time, not run-time. >>> >>> On Saturday, June 21, 2014, Andrew McKinlay <[email protected] >>> <javascript:_e(%7B%7D,'cvml','[email protected]');>> wrote: >>> >>>> What's the difference between writing macros versus functions that take >>>> `Expr` objects? Is there anything you can't do with a function that takes >>>> expression objects? Are there any advantages of using macros beyond no >>>> having to quote the code you pass as an argument? >>>> >>>
