Skip to main content

Questions tagged [macro]

Use this tag for questions about design or implementation of language preprocessor macros that are able to perform limited rewriting of source code before evaluation. Do not use for questions about editor macros or design of automation languages.

1 vote
0 answers
163 views

I'm considering writing a formatter for Jinja2. Jinja is a template language that can preprocess a wide variety of different languages, mostly HTML but it's also commonly used for XML, SVG, JSON, YAML,...
mousetail's user avatar
  • 9,627
1 vote
1 answer
203 views

In Rust: #[derive(Display)] struct Foo<T>(T); If T conforms to the Display trait, ...
Jw C's user avatar
  • 243
9 votes
1 answer
801 views

Rust's macros require them to be delimited by either parentheses, braces, or brackets, such as println!(arg) or foo! { bar, baz }...
Seggan's user avatar
  • 3,412
31 votes
3 answers
13k views

Why did the designers of the Rust programming language require that macro names have to end with an exclamation point? I observe that both Common Lisp and Emacs Lisp language variants do not appear, ...
bgoodr's user avatar
  • 413
3 votes
2 answers
158 views

A controversial topic among programming language designers is preprocessor macros such as #define directives in C. They can cause problems if used incorrectly. <...
CPlus's user avatar
  • 10.5k
19 votes
6 answers
2k views

A part of why Lisp's macros work so well is that the code is just a list of symbols, and it is therefore simple to manipulate using a regular Lisp function. How could a language that uses a syntax ...
kouta-kun's user avatar
  • 1,747