This Week's Trending Top

This Month's Trending Top

This Year's Trending Top

Oliver
I have a macro that expands into a module definition. The use case is that we take a testcase defined in one elixir module (parent) and m...
New
przemyxe0p
Hi, I am wondering thy elixir added parens at the end not just simply changed \* to + and + to \* Interactive Elixir (1.19.1) - press C...
New

Last Three Year's Trending Top

fceruti
I need to access the application name under which a module was defined, in other words, I need the name defined in the module’s parent mi...
New
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
shahryarjb
Hello friends, I want to create a module inside another module with an atom name: For example: defmacro sub_field(name, _type, opts \...
New
fireproofsocks
Is there any way to override functions generated by a use macro when those functions have NOT been tagged as defoverridable? I’m tapped ...
New
DidactMacros
I have a question regarding a code snippet from part 6 of a really great Macros guide by @sasajuric. This question specifically ranges f...
New
MadsBoydMadsen
I’m working on a macro to support automatic timing for functions. If I have this - say: def double(x) do x + x end I would like to b...
New
Gigitsu
Summary I’m trying to create a macro that takes in input a module name and automatically creates a defdelegate for each function defined ...
New
shahryarjb
Hello friends, I do not think this problem of mine exists in production build ( I did not test it), but in developer mode iex -S mix. im...
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
lud
In order to only have one branch of code in a macro that defines functions with support for guards, I would like to always have a guard. ...
New
Moussenger
Hi! I’m trying to avoid redundant testing (that means, tests that are made in the same way all the time but with slightly different para...
New
janp
I am currently stuck in implementing a macro :thinking: Here’s the code I currently have (without unnecessary code): defmacro request(op...
New
CharlesIrvine
I’m wondering if the following is possible: I have an application where I would like to parse boolean expressions and produce correspond...
New
lud
Hello, I am wondering why it is not needed to unquote with defmodule when using variables that are defined outside of the call to defmod...
New
apoorv-2204
I am trying to write custom logger , as I am tired of writing Logger.xyz() and then interpolate and inspect some variable. Trying to ach...
New

Trending Over Three Years Top

thojanssens1
defmodule Bar do @after_compile __MODULE__ defmacro __before_compile__(_env) do IO.inspect("#{__MODULE__}.__before_compile__") ...
New
bartblast
Suppose we’ve got the following module: defmodule TestModule do defmacro test_macro(param1, param2, param3) do quote do para...
New
sodapopcan
I’m having a bit of trouble wrapping my brain around how I would pass a dynamic fragment to ~p inside a macro: defmacro __using__(opts) ...
New
Fl4m3Ph03n1x
Background So, I am playing around with a concept named “NewType” and I am taking inspiration from languages like F# and Scala. My objec...
New
vrod
This is my first time I am looking at macros. I think I understand they are something like “pre generation” of code. Maybe something li...
New
hst337
Summary Is there any way to write a function which can be invoked in compile time and which can return an AST and Macro.Env of given func...
New
shahryarjb
Hello, I want to load a alias under my __using__, but with opts help like this: defmacro __using__(opts) do quote(bind_quoted: [opts: ...
New
ream88
Hey, I’m currently trying to DRY up some tests which have a lot of boilerplate code in the form of: test "user is updated", %{user_id: ...
New
vrod
Is there a way to put more functions into __using__ block? It gets very long and hard to read. I cannot figure out how to split up the ...
New
PatrickSachs
Hello there, I have the following scenario: I have a library my_lib that is used in my_app. my_lib has a configuration file option that...
New
thojanssens1
For a library, we get the list of all Ecto Schema modules of the user’s app, and want to generate functions (through macros) into a modul...
New
saleyn
How can I create a macro that defines a type using atom that represents the type name? In the macro __type__ below, for the visibility a...
New
zoten
Hi everyone! I’m searching for a hint for a problem I cannot understand if it is in my code or a third party misbehaviour. I’m currentl...
New
zimt28
I’d like to use the ~E sigil inside of a macro. For some reason the assigns variable is not accessible: defmacro __using__(_opts) do q...
New
shahryarjb
Hi friends, I have a nested list that is unstructured, and I really know how much it has nested list or map in itself. I just need to se...
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