These are chat archives for rust-lang/rust

19th
Aug 2016
Zakarum
@omni-viral
Aug 19 2016 09:27
This message was deleted
Robert Deusser
@iamthemuffinman
Aug 19 2016 15:46
When would someone use a macro over a function?
an example
ven
@vendethiel
Aug 19 2016 15:53
@iamthemuffinman when something is expressed as syntax, instead of data transformation.
Robert Deusser
@iamthemuffinman
Aug 19 2016 15:56
@Bastacyclop So you can't do that what he did with a function?
Thomas Koehler
@Bastacyclop
Aug 19 2016 15:57
with a function you will get the panic location inside the function
with the macro you get the panic location where the macro is expanded
Robert Deusser
@iamthemuffinman
Aug 19 2016 15:57
Ahhhhhh.
That makes sense.
Peter Atashian
@retep998
Aug 19 2016 20:36
@iamthemuffinman I use macros in places to make the code simpler such as when defining types so I don't have to do a bunch of boilerplate