This Week's Trending
This Month's Trending
This Year's Trending
Last Three Year's Trending
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
Can Elixir code detect whether it is executing at compile time? I would like to write something like the following macro:
defmacro foo()...
New
Hello friends,
I want to create a module inside another module with an atom name:
For example:
defmacro sub_field(name, _type, opts \...
New
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
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
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
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
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
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
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
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
I am currently stuck in implementing a macro :thinking: Here’s the code I currently have (without unnecessary code):
defmacro request(op...
New
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
I’m wondering if the following is possible:
I have an application where I would like to parse boolean expressions and produce correspond...
New
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
defmodule Bar do
@after_compile __MODULE__
defmacro __before_compile__(_env) do
IO.inspect("#{__MODULE__}.__before_compile__")
...
New
Suppose we’ve got the following module:
defmodule TestModule do
defmacro test_macro(param1, param2, param3) do
quote do
para...
New
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
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
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
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
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
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
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
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
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
I have an operator in a variable, for example:
guard = &Kernel.>=/2
How can I use that variable as argument to a macro, e.g. for...
New
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
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
I am building a macro witch has two parameters, one of them I want to unquote and the other one no.
Example:
defmacro x(a, b) do
...
New
Latest on Elixir Forum
Get money off!
The Pragmatic Bookshelf
35% off any eBook
Manning Publications
45% off any item
ElixirCasts
10% off for life
The Pragmatic Studio
20% off any course
AppSignal
10% off for 12 months
Honeybadger
10% off for 12 months
Simply use coupon code "devtalk.com" or "elixirforum" at checkout!
Filter by Type:
Sub Categories:
Popular Tags
- #ecto
- #liveview
- #troubleshooting
- #learning-elixir
- #deployment
- #erlang
- #testing
- #genserver
- #mix
- #absinthe
- #ash-questions
- #remote-other
- #otp
- #plug
- #how-to-question
- #macros
- #postgres
- #channels
- #exunit
- #discussion
- #javascript
- #elixirconf
- #library
- #oban-questions
- #dialyzer
- #docker
- #onsite
- #authentication
- #podcasts
- #full-time-contract
- #umbrella
- #code-sync
- #ecto-query
- #phoenix_html
- #iex
- #graphql
- #genstage
- #elixir-ls
- #nerves-questions
- #podcasts-by-brainlid
- #supervisor
- #websockets
- #distillery
- #advent-of-code
- #blog-post
- #livebook-questions
- #processes
- #forms
- #api
- #metaprogramming







