Latest #syntax Threads Top

arcanemachine
Just wondering since the knowledge cutoff for LLMs is about a year or so behind the current date. It would be nice if the models were ab...
New
manhvu
In a large repo, working with module need to add alias too much is quite annoyed and not good for organizing code. I think better add su...
New
feviskus
From here: Work with pipe query syntax  |  BigQuery  |  Google Cloud Documentation HN: https://news.ycombinator.com/...
New
sodapopcan
So this is just a dumb little post regarding syntax. I’ve been pairing with a colleague who is new to Elixir lately and today we were br...
New
bartblast
This could resolve to {[a: 1, b: 2]}. Was it ever considered to allow such syntax? Notice this: {:abc, a: 1, b: 2} and this: my_fun(:abc,...
New
monte_claro
In the latest versions. For the definitions of the functions as well as for calls. What’s recommended?
New
derek-zhou
If a function takes a keyword as one of its parameters, we normally put it last: def my_func(a, b, attrs \\ []) do ... end So at call s...
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
ghalestrilo
Hi :person_raising_hand: so, the Regex module supports named captures. Here’s an example from the docs for named_captures/3, which extrac...
New
JsonKody
This is highly subjective but in my mind Haskell and Ruby/Rust has one of the most beautiful lambda syntax \a b → a + b and |a, b| a +...
New

This Week's Trending Top

This Month's Trending Top

This Year's Trending Top

arcanemachine
Just wondering since the knowledge cutoff for LLMs is about a year or so behind the current date. It would be nice if the models were ab...
New
manhvu
In a large repo, working with module need to add alias too much is quite annoyed and not good for organizing code. I think better add su...
New

Last Three Year's Trending Top

ollran
How can I pattern match against an arbitrary sized tuple? This works: {status, _, _} = {:ok, 1, 2} But what if I don’t know the structu...
New
bmitc
The question in the subject line is pretty self-explanatory, and I’m trying to understand perhaps a hidden misunderstanding. My understan...
New
grantwest
If I have nested structures, and I want to fetch a field from the a nested structure, but handle a nil case, is there a succinct way to d...
New
aceupmysleeves
Hi! I’m working in a liveview and want to fill attributes such as id, for label and title with a value from a for-loop. <ul> ...
New
JsonKody
This is highly subjective but in my mind Haskell and Ruby/Rust has one of the most beautiful lambda syntax \a b → a + b and |a, b| a +...
New
sodapopcan
So this is just a dumb little post regarding syntax. I’ve been pairing with a colleague who is new to Elixir lately and today we were br...
New
ghalestrilo
Hi :person_raising_hand: so, the Regex module supports named captures. Here’s an example from the docs for named_captures/3, which extrac...
New
derek-zhou
If a function takes a keyword as one of its parameters, we normally put it last: def my_func(a, b, attrs \\ []) do ... end So at call s...
New
feviskus
From here: Work with pipe query syntax  |  BigQuery  |  Google Cloud Documentation HN: https://news.ycombinator.com/...
New
monte_claro
In the latest versions. For the definitions of the functions as well as for calls. What’s recommended?
New
bartblast
This could resolve to {[a: 1, b: 2]}. Was it ever considered to allow such syntax? Notice this: {:abc, a: 1, b: 2} and this: my_fun(:abc,...
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

Trending Over Three Years Top

dylan-chong
def fun(options) do [parameter1: parameter1, parameter2: parameter2] = Enum.into(options, parameter1: 1, parameter2: 2) Is there an ...
New
Crowdhailer
I’ve been hearing much about the new formatter and it’s something I have been keen to try. I find examples buy far the most illuminating...
248 19148 150
New
ion
I’ve seen -> and <- used in Elixir books and articles, but I have not found a clear explanation to what they are called, and when t...
New
minhajuddin
I have seen the pattern %_{} being used to match against structs (notice the _ after the %). Is this documented somewhere? It seems to m...
New
Secretmapper
Hello! Elixir's syntax is pretty and expressive, but at the same time this comes on the cost of knowing just what the best way to write s...
New
Crowdhailer
Experimenting with this code. OK.try do user <- fetch_user(1) cart <- fetch_cart(1) order = checkout(cart, user) save_or...
New
New
leifericf
Hello, friends! Context: As you might know from this thread, I’m working on a presentation. Following a tour of Erlang history, I have...
New
pillaiindu
For example the following, iex(16)> cond do ...(16)> 2 + 2 == 5 -> ...(16)> "Not true" ...(16)> 2 * 2 == 3 -> ...(...
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
ollran
I think that this is called a function reference but I’m not sure. Anyway, this works: def start_link(_arg) do Task.start_link(&c...
New
TrailingDots
In the source code I find this pattern repeated over and over. As an example, in the elixir-1.5.3/lib/elixir/lib/enum.ex I find: @sp...
New
Qqwy
In Elixir, operators are also simply functions. A unary operator takes a single argument, a binary infix operator takes two. It is there...
New
MeerKatDev
I was wondering what Elixir developers think about this: how to treat piping into an ok_tuple? I have no idea if there was a similar ques...
New
sodapopcan
I’m wondering exactly what a do block is. Is it a closure? Is it a procedure? Is it an anonymous function? Is it a lambda? Is it som...
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