Latest #defmacro Threads Top

MeerKatDev
many times we do stuff like (e.g. test setups, json views in phoenix) aaa = ... bbb = ... ccc = ... %{aaa: aaa, bbb: bbb, ccc: ccc} and...
New
roflbobl
I have a problem, where i have a macro the calls another function. I want to be able to add optional guards to my macro, and call the nes...
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
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
Ridtt
Hex: bin_struct | Hex Git: GitHub - 4ait/bin_struct Docs: bin_struct v0.2.34 — Documentation BinStruct is a library which main functio...
New
budgie
I’m trying to unquote multiple blocks of code dynamically depending on the include option passed when use is called. When I try to map ov...
New
spacebat
I’m writing module that will accept a function name and arguments looking like foo(bar, baz) - as Kernel.def/2 does but without a body, a...
New
BradS2S
I watched a great video about a GenServer mental model by Mark Ericksen. I’ve found it very helpful and it has me attempting to make ment...
New
gmile
I am trying to understand why transitive compile-time dependency is there, and what’s a good strategy to remove it. The mix app for examp...
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

This Week's Trending Top

This Month's Trending Top

This Year's Trending Top

Last Three Year's Trending Top

Ridtt
Hex: bin_struct | Hex Git: GitHub - 4ait/bin_struct Docs: bin_struct v0.2.34 — Documentation BinStruct is a library which main functio...
New
gmile
I am trying to understand why transitive compile-time dependency is there, and what’s a good strategy to remove it. The mix app for examp...
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
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
shahryarjb
Hello, Based on typed_struct/lib/typed_struct.ex at main · ejpcmac/typed_struct · GitHub , I am practicing to learn more about macro in e...
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
BradS2S
I watched a great video about a GenServer mental model by Mark Ericksen. I’ve found it very helpful and it has me attempting to make ment...
New
roflbobl
I have a problem, where i have a macro the calls another function. I want to be able to add optional guards to my macro, and call the nes...
New
MeerKatDev
many times we do stuff like (e.g. test setups, json views in phoenix) aaa = ... bbb = ... ccc = ... %{aaa: aaa, bbb: bbb, ccc: ccc} and...
New
budgie
I’m trying to unquote multiple blocks of code dynamically depending on the include option passed when use is called. When I try to map ov...
New
spacebat
I’m writing module that will accept a function name and arguments looking like foo(bar, baz) - as Kernel.def/2 does but without a body, a...
New

Trending Over Three Years Top

vshesh
I’m trying to use one macro inside another macro and running into issues: defmodule Test do defmacro somemacro(arg1, do: block) do ...
New
tmbb
CodeGen (experimental!) code here: GitHub - tmbb/ex_code_gen: Flexible code generation for Elixir Suppose you want to have your library ...
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
lok0613
Hello all, I’m recently doing something similar to ExUnit, keeping a bunch of variables on “setup” block and then pass it to the next bl...
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
davemccrea
Is it possible to generate the module name as an atom within a macro? defmodule MyProject.Schema do defmacro __using__(opts) do qu...
New
riccardomanfrin
I’m trying to understand how macros and module definitions interact with each others and I’m having few cases which I don’t understand. T...
New
shahryarjb
Hi, for practicing I wanted to create a custom CRUD function which is using Repo. But on the way I have some problems with basic. Proble...
New
LukasKnuth
Consider the following simple example: defmodule Test.Foo do defmacro foo(regex) do IO.inspect(regex) end end defmodule Test do...
New
shahryarjb
Hello, I try to create a custom macro to implement some functions and structure I need in my project and my goal is to make a custom tool...
New
fabioticconi
Hi all, I’m trying to solve a practical problem - make an ExUnit “data case” with async true as default, instead of false. So if a user...
New
saleyn
Is there a way to create a macro called required that could be used like this: with required(var) <- Map.get(map, key) do var else ...
New
cpiemontese
Hello! I’m working with macros and I am trying to inject some code into a use macro to be used “as-is” but I’m having some trouble makin...
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