# Pre-SIP: Export Macros

**URL:** <https://contributors.scala-lang.org/t/pre-sip-export-macros/6168>\
**Category:** Language Design\
**Created:** [April 23, 2023, 4:45am UTC](https://contributors.scala-lang.org/t/pre-sip-export-macros/6168 "2023-04-23T04:45:03Z")\
**Posts on this page:** 1\
**Showing post:** 11

<div class="post-metadata">

**Author:** ![markehammons](https://contributors.scala-lang.org/user_avatar/contributors.scala-lang.org/markehammons/32/1174_2.png) [@markehammons](https://contributors.scala-lang.org/u/markehammons)\
**Post date:** [June 12, 2023, 12:00pm UTC](https://contributors.scala-lang.org/t/pre-sip-export-macros/6168/11 "2023-06-12T12:00:11Z")

</div>

> [@MateuszKowalewski](#):
>
> The point about the current macros is that they don’t allow to introduce any new “typer visible” definitions.

Current macros can in fact introduce new definitions, and those definitions can affect your program. The thing is that current macros only produce expressions at the end of the day, meaning that any definitions you create are not visible outside of the Expr that contains them.

> [@MateuszKowalewski](#):
>
> So in the end of the day you can’t generate arbitrary code (like for example class hierarchies), besides filling out string templates and writing those to disk as an external (pre)build step.

You can in fact do that with current macros, you just cannot have them visible outside of the Expr. However, since we would be using Expr.show to produce writeable files instead of splicing Expr into your code, that ends up not being a problem anymore.

The problems at present is

1. The requisite api is still experimental: [SymbolModule](https://scala-lang.org/api/3.x/scala/quoted/Quotes$reflectModule$SymbolModule.html#newClass-f47)

2. The requisite api also doesn’t allow non-empty constructors

3. The macro system only checks the sanity of Exprs borne from Terms when used normally.

---

_[View the full topic](https://contributors.scala-lang.org/t/pre-sip-export-macros/6168)._
