This Week's Trending Top

This Month's Trending Top

This Year's Trending Top

rcm765
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
roganjoshua
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 Top

Trending Over Three Years Top

gshaw
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
Exadra37
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
acrolink
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
New
ijverig
Using guards like this works fine: iex(1)> defmodule M do ...(1)> def update_position({pos, max_pos}) when pos < max_pos, do:...
New
helicon
Hey! I have a function @doc """ Check if given id has 64-bit size Examples: > MyModule.has_64_bit_size(132700114308300801) true &g...
New
dimitarvp
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
mmmries
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
Maxximiliann
This case statement is perfectly functional, but it repeats code: case foo do {:pass, _} = reason -> Logger.info(reason) {:o...
New
oliverandrich
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
elt547
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
jgonet
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
niels_bom
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
xadhoom
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
emeryotopalik
Hello. I am experiencing an unexpected behavior with the way Elixir is handling a guard clause exception. Take the following: defmodule ...
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