This Week's Trending Top

This Month's Trending Top

This Year's Trending Top

Last Three Year's Trending Top

addrummond
Can Elixir code detect whether it is executing at compile time? I would like to write something like the following macro: defmacro foo()...
New
cjbottaro
I know this has been asked before, but I still can’t get it to work. I have code like this… def case_stmt(input) do [c1, c2, c3, c4] =...
New
jeroenbourgois
I would like to add a function to my project that is available throughout all modules without aliasing/importing it. How should I go abou...
New
lud
I’m trying to build a protocol and a test suite to implement different adapters (impls of the protocol). I tried to use a CaseTemplate, ...
New
arjan
I am trying to hook into the @doc deprecated: "message" annotation using __on_definition__. defmodule ExampleCompiler do def __on_defi...
New
zoedsoupe
I’m developing a Supabase client for Elixir with complete support for all their services, like: storage auth realtime UI (live view) S...
New
christhekeele
I’m doing some questionable meta-programming, and could use your help! I’m using Macro.prewalk to traverse some source code, with the go...
New
zoedsoupe
I’m not very used to macros/compile time manipulation, but I will explain what I want to achieve and would like to know if it’s possible ...
New
gavid
I have a system that has thousands of run-time generated modules, some of which I want to cache for future reloading. Ordinarily, the BE...
New
rcm765
With the following code: defmodule Foobar do defmacro b(arg) do arg |> String.split("\n") |> IO.inspect() end d...
New
Sebb
I have this weird behaviour with quoting n in iex. (1.14.3-otp25 on mac) iex(1)> ast = quote(do: n) {:n, [if_undefined: :apply, conte...
New
PID_ONE
I’m trying to write a couple of mix format plugins for my project. So far I’ve been able to achieve most of what I want (e.g. rewriting f...
New
rcm765
I’m accessing module attributes at compile-time and no guarantee on module compilation state. So I wrote the following: case Code.ensure...
New
jkbbwr
I want to work on a DSL that looks very similar to unit tests, define some steps but the steps are linked step "step 1" do IO.puts("...
New
lkuty
I have a module for which I want to create a function rule_ids/0 at compile time. The code collects the rule ids at compile time from the...
New

Trending Over Three Years Top

valyukov
Hi there, How I can build queries with dynamic fields assignment in Ecto? I try to do next thing: import Ecto.Query field = :id val...
New
augnustin
Hi, I have been coding with Elixir for 9+ months and I encountered several time the concept of quotes and each time, I think “ok, today ...
New
svilen
I have a bunch of functions in a module, that I’d like to dynamically add to a __using__ macro: defmodule A do defmacro __using__(_opt...
New
eksperimental
I’m improving some documentation in Elixir, and in order to do so, I need to dynamically build a list of atoms, but without using string...
New
mruoss
Hi community! What is the correct way to implement the __using__ macro with an option that changes the way generated functions behave? O...
New
thiagomajesk
Hi everyone, I was toying around with macros today and I reached a stagnation point. After trying multiple approaches I started to think ...
New
matteosister
I'm trying to do something similar to wath ecto does when defining schemas. Basically the idea is: defmodule Test do use TableBuilder...
New
sheharyarn
I have three identical methods in my module, that do (almost) exactly the same thing. Instead of repeating the function definitions, I am...
New
lakret
I’m struggling with overriding hygiene during manual manipulation of AST with Macro.postwalk. In short, I want to provide a syntax for in...
New
AndyL
Elixir newbie here working on a stemmer for a document indexing engine. The stemming algorithm has dozens of steps with many tests per s...
New
cjbottaro
I want to programmatically generate input objects from introspecting my schema, but I can’t figure out the metaprogramming to do so. Ess...
New
tangui
Hi all, I’ve been playing with Specify lately and I’m trying to get the @type module attribute like the @doc one, so as to link to that ...
New
thojanssens1
defmodule Bar do @after_compile __MODULE__ defmacro __before_compile__(_env) do IO.inspect("#{__MODULE__}.__before_compile__") ...
New
cjbottaro
Easiest to ask this in code... defmodule Foo do use Tagger tag(:red) end defmodule Bar do use Tagger tag(:blue) end Then at ...
New
Eiji
Hi, I looked about generating functions and found one example. I tried to make it work inside macro, but i don't know how I can fix it. H...
New
  • Follow
  • Join
  • Shape
the conversation

Latest on Elixir Forum

Elixir Forum

Similar Portals

    None added yet

We're in Beta

About us Mission Statement