Latest #defstruct Threads 
In the official docs, it’s written that ideally structs should have less than 32 fields (source here).
Do you go around that limitation?...
New
What’s the best/most succinct way to define a struct that is only used inside of one module? I sometimes have structures that I want to b...
New
nested_dict.exs
defmodule Customer do
defstruct name: "", company: ""
end
defmodule BugReport do
defstruct owner: %Customer{}, det...
New
I’m considering writing an integration with Salesforce. Salesforce has SObjects of various types like Case, Quote, Lead, CustomObject__c...
New
Is there way to get the types from struct defined as bellow, and generate functions based on your types; like binary(), integer()?
Can...
New
Background
Let’s say I have a TypedStruct that has some common fields:
typedstruct do
@typedoc "A product."
field(:item_id, Str...
New
Hi all,
Let’s suppose I have the following struct:
defmodule DataType do
defstruct ~w(a b c d e f)a
end
This struct is parsed from a...
New
I have a struct representing a session request with only two fields, email and bytes. Basically the struct should either be passed around...
New
I want to load a json (list of objects) into list of structs in a module attribute.
Seems like I need three modules for that.
json
[
...
New
I just tried to create a struct without fields (because: why not?).
It’s not possible with defstruct, which insists on an argument.
Bes...
New
This Week's Trending
This Month's Trending
This Year's Trending
In the official docs, it’s written that ideally structs should have less than 32 fields (source here).
Do you go around that limitation?...
New
Last Three Year's Trending
I’m considering writing an integration with Salesforce. Salesforce has SObjects of various types like Case, Quote, Lead, CustomObject__c...
New
What’s the best/most succinct way to define a struct that is only used inside of one module? I sometimes have structures that I want to b...
New
nested_dict.exs
defmodule Customer do
defstruct name: "", company: ""
end
defmodule BugReport do
defstruct owner: %Customer{}, det...
New
Trending Over Three Years
For example I have multiple currencies
dollar.ex
defmodule Multicurrency.Currency.Dollar do
@enforce_keys [:amount]
defstruct [:amo...
New
I have a struct representing a session request with only two fields, email and bytes. Basically the struct should either be passed around...
New
We ran into an issue today with structs that I found a bit surprising.
The essence of the issue is:
A struct is a Map under the hood
y...
New
I am wondering how to document fields in defstruct properly. The convention seems to be to list fields in @moduledoc, but I find that cum...
New
I just tried to create a struct without fields (because: why not?).
It’s not possible with defstruct, which insists on an argument.
Bes...
New
I was just going through some stuff with some jr. devs about how structs work, and we were fooling around with what can be done with them...
New
Background
I have a custom struct and I want to define a type for it so I can run Dialyzer checks. However Dialyzer is complaining that I...
New
I want to load a json (list of objects) into list of structs in a module attribute.
Seems like I need three modules for that.
json
[
...
New
Hey everyone.
I was wondering about how I should initialize a struct where I have some values and some computed values.
For now I came ...
New
Background
Let’s say I have a TypedStruct that has some common fields:
typedstruct do
@typedoc "A product."
field(:item_id, Str...
New
Is there way to get the types from struct defined as bellow, and generate functions based on your types; like binary(), integer()?
Can...
New
Hi all,
Let’s suppose I have the following struct:
defmodule DataType do
defstruct ~w(a b c d e f)a
end
This struct is parsed from a...
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:
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







