Latest #macros Threads 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
mudasobwa
I’ve been heavily working with macros for more than 10 years already and I always used kinda ad-hoc code to expand/debug/test those when ...
New
carlosfritz
I want to model the following relationship: A location has zero or one of multiple (currently 7) specifications (each specification is a...
New
New
pertsevds
Hey folks, I made a tiny macro that lets you assign a piped value to a variable without breaking the flow. For example: data |> tran...
New
Oliver
iex(25)> quote do ...(25)> 1 |> rem(2) |> div(4) ...(25)> end |> ...(25)> Macro.expand(__ENV__) |> ...(25)> Ma...
New
tomekowal
Hi! I have a piece of code that parses some json and creates validations from them. In one place, I need to create a regular expression ...
New
tomekowal
I have a macro that is used for parsing: defmacro left <~> right do quote do case unquote(left) do :error -&gt...
New
kerryb
I have some AST rewriting code (using Sourceror) that has started failing in Elixir 1.18 – I believe because unquote has become stricter ...
New
m1dnight
Hi, I’m experimenting with macros to create a framework for defining a sort of tests. I’m trying to figure out how to create a graph of...
New

This Week's Trending Top

This Month's Trending Top

This Year's Trending Top

amalbuquerque
Hi there, After reading @ericmj response here (Using unquote outside of quote block - #6 by ericmj) about “unquote fragments”, I still c...
New
mudasobwa
I’ve been heavily working with macros for more than 10 years already and I always used kinda ad-hoc code to expand/debug/test those when ...
New
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
carlosfritz
I want to model the following relationship: A location has zero or one of multiple (currently 7) specifications (each specification is a...
New

Last Three Year's Trending Top

Crowdhailer
It is rare to use direct calls to send in elixir. The call is normally wrapped in a function which is responsible for sending the correct...
New
sodapopcan
I can dynamically define functions in a “loop” like this: defmodule Foo do for {f, i} <- [{:foo, "foo"}, {:bar, "bar"}] do def ...
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
thmsmlr
Hey y’all so i’m working on a project that takes in Ecto schema and generates JSONSchemas for them. Part of the project requires that the...
New
overcomeoj
I am trying to define a macro that defines a render(assigns) function but the compiler keeps rejecting the sigil, claiming that no assign...
New
rmoorman
Summary I am currently trying to get a better understanding of elixir macros and in doing so encountered the section about dynamic querie...
New
Wigny
I’m currently writing a specie of DSL and I’m trying to understand how can I escape an anonymous function in a module attribute. I’m not ...
New
pertsevds
Hey folks, I made a tiny macro that lets you assign a piped value to a variable without breaking the flow. For example: data |> tran...
New
smetana
Hello all, I need to convert AST with possible long binary to string. Macro.to_string() uses Inspect and Inspect has the printable_limi...
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
Ridtt
Hex: bin_struct | Hex Git: GitHub - 4ait/bin_struct · GitHub Docs: bin_struct v0.2.34 — Documentation BinStruct is a library which mai...
New
linusdm
After reading Metaprogramming Elixir, and the hexdocs on metaprogramming and macros, I was wondering how this ties into macros we use eve...
New
budgie
I’m trying to build a macro for edge definitions in a graph. How can I access parameters from the outer macro inside the inner macro? T...
New
cosmicrose
I’m trying to implement template fragments in EEx. My extremely rough draft lets you create a template file that looks like this: <%|...
New
jarlah
Hi everyone Not sure if this is usable and/or interesting, but I have been working on a pet project of mine, that in lack of better fant...
New

Trending Over Three Years Top

BartOtten
Currently I am writing a small macro which adds authorization functionality to a function. Rewrite ‘def’ to ‘defprot’ and add the rules t...
New
nelsonic
This is a bit of a “strange” question but please bare with me; I expect it will be useful/insightful to others learning Elixir/Phoenix wa...
New
arjan
Hi, I am writing the Elixir integration for AppSignal, an application metrics solution. As of such, I am looking for a way to decorate f...
New
myronmarston
In a macro, can you access a module attribute outside quote?. I know about Module.get_attributes/2 but I can only get it to work inside ...
New
atomkirk
Do you think theres a way to write a function that matches a list of patterns with a list of values ignoring order? We use UXID and inser...
New
Crowdhailer
I have been updating a library that allows you to pipe between functions that use the erlang result tuple convention. Assuming you have ...
New
stephen_m
Hi, When writing the following code, elixir correctly and thankfully warns that there is a conflict: function/macro 1: defmacro static...
New
NobbZ
I’ve forked an abondoned hex-package and continue to maintain it under a new name. The old code-base does provide a macro that we call f...
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
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
Qqwy
Certain kinds of algorithms can be sped up (or even: are only possible) by using cyclic data structures. Functional languages make it ha...
New
Qqwy
This morning, I came to a sudden realization: Elixir’s Macro system is even more powerful than I’d thought. My mind is blown. Let me tr...
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
hansonkd
Hi. I am making a library for user submitted templates (so users can customize email content). I have a parser which parses the template...
New
wfgilman
I’m trying to implement a conceptual test with the following macro. I want to be able to pass an action argument which will call a funct...
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

Options

Thread Display Mode




Thread Preview

Skip Thread Previews