I believe we do it for certain functions in Elixir's stdlib and the Erlang compiler (which we invoke) does it too.
*José Valimhttps://dashbit.co/ <https://dashbit.co/>* On Wed, Aug 6, 2025 at 10:00 PM benjamin...@gmail.com < benjaminschult...@gmail.com> wrote: > AFAIK, then the compiler does not perform const evaluation. > > iex(9)> quote(do: 1+2*3) > {:+, [context: Elixir, imports: [{1, Kernel}, {2, Kernel}]], > [1, {:*, [context: Elixir, imports: [{2, Kernel}]], [2, 3]}]} > > iex(10)> quote(do: 1+2*3) > 7 > > Are there any plans to implement this, if not what is the recommended > approach to do this, when working on an AST. > > -- > You received this message because you are subscribed to the Google Groups > "elixir-lang-core" group. > To unsubscribe from this group and stop receiving emails from it, send an > email to elixir-lang-core+unsubscr...@googlegroups.com. > To view this discussion visit > https://groups.google.com/d/msgid/elixir-lang-core/b7b48090-7022-4f14-b92b-2732272fc151n%40googlegroups.com > <https://groups.google.com/d/msgid/elixir-lang-core/b7b48090-7022-4f14-b92b-2732272fc151n%40googlegroups.com?utm_medium=email&utm_source=footer> > . > -- You received this message because you are subscribed to the Google Groups "elixir-lang-core" group. To unsubscribe from this group and stop receiving emails from it, send an email to elixir-lang-core+unsubscr...@googlegroups.com. To view this discussion visit https://groups.google.com/d/msgid/elixir-lang-core/CAGnRm4L2mF_o2j0aE_MYCC7rXX8qZdpdHe_b3zew0g_fY7ztfA%40mail.gmail.com.