This Week's Trending
This Month's Trending
This Year's Trending
I’d like a guard to determine if the value is a keyword list or not. I’ve tried the following macro:
defmacro is_keyword([{key, _value} ...
New
I have defined a guard in a definitions module and file.
defguard is_maximum_tiles_in_rack(value)
when is_integer(value) an...
New
Last Three Year's Trending
Trending Over Three Years
What is the idiomatic way of matching for not nil in Elixir?
E.g.,
First way:
defp halt_if_not_signed_in(conn, signed_in_account) when...
New
Sometimes I want to check if the input into a function is not a blank string.
My first approach:
defmodule Example do
def do_stuff(s...
New
I want to learn some basics of this great langauge. I have put this code together:
defmodule Xe do
def call(input) do
with {:ok, ...
New
I want to know more about WHEN statement in elixir
New
Using guards like this works fine:
iex(1)> defmodule M do
...(1)> def update_position({pos, max_pos}) when pos < max_pos, do:...
New
Hey!
I have a function
@doc """
Check if given id has 64-bit size
Examples:
> MyModule.has_64_bit_size(132700114308300801)
true
&g...
New
Hello,
Is it possible to check if an argument to a guard is a particular structure?
Context: I am trying to have a defguard definition ...
New
I maintain a library where a user can publish a message and I want to accept any iodata (I end up writing it to a TCP connection), but I ...
New
This case statement is perfectly functional, but it repeats code:
case foo do
{:pass, _} = reason ->
Logger.info(reason)
{:o...
New
Hi,
I am currently trying to implement a guard which validates that a parameter is a valid URL. Is it possible to call URI.parse or Rege...
New
Curious as to why this is not permitted. I suspect it has something to do with or only accepting a boolean as the first operand. But why ...
New
I was creating simple RPN calculator function, but I stumbled upon a problem in matching functions in guards.
Code looks like so:
def c...
New
I just found myself writing this:
def foo([], _), do: []
def foo(_, 0), do: []
But then I thought I could also use a guard clause with ...
New
Well,
while migrating to elixir 1.11.3 (from 1.10.4) I’ve a new warning about a somewhat complex guard expression that has incompatible ...
New
Hello. I am experiencing an unexpected behavior with the way Elixir is handling a guard clause exception. Take the following:
defmodule ...
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
- #library
- #erlang
- #testing
- #genserver
- #mix
- #absinthe
- #remote-other
- #otp
- #plug
- #how-to-question
- #macros
- #postgres
- #channels
- #exunit
- #elixirconf
- #discussion
- #javascript
- #podcasts
- #code-sync
- #onsite
- #dialyzer
- #docker
- #authentication
- #umbrella
- #full-time-contract
- #podcasts-by-brainlid
- #ecto-query
- #elixir-ls
- #phoenix_html
- #iex
- #blog-post
- #graphql
- #genstage
- #ai
- #websockets
- #supervisor
- #advent-of-code
- #distillery
- #api
- #processes
- #forms
- #metaprogramming
- #security
- #performance
- #hex







