Hacker News new | ask | show | jobs
by VladD2 5514 days ago
Macros are expending in the typing process. In macro you can use compiler API to type some untyped AST (for example, argument of macro).

For example, "foreach" macro use compiler API to infer type of collection. This macro generate specialized code for different collection kind (array/list/IEnumerable).