Latest #defstruct Threads Top

ryanzidago
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
budgie
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
holasoymas
nested_dict.exs defmodule Customer do defstruct name: "", company: "" end defmodule BugReport do defstruct owner: %Customer{}, det...
New
chazwatkins
I’m considering writing an integration with Salesforce. Salesforce has SObjects of various types like Case, Quote, Lead, CustomObject__c...
New
ntd23
Is there way to get the types from struct defined as bellow, and generate functions based on your types; like binary(), integer()? Can...
New
Fl4m3Ph03n1x
Background Let’s say I have a TypedStruct that has some common fields: typedstruct do @typedoc "A product." field(:item_id, Str...
New
ahamez
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
elt547
I have a struct representing a session request with only two fields, email and bytes. Basically the struct should either be passed around...
New
Sebb
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
Sebb
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 Top

This Month's Trending Top

This Year's Trending Top

ryanzidago
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 Top

chazwatkins
I’m considering writing an integration with Salesforce. Salesforce has SObjects of various types like Case, Quote, Lead, CustomObject__c...
New
budgie
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
holasoymas
nested_dict.exs defmodule Customer do defstruct name: "", company: "" end defmodule BugReport do defstruct owner: %Customer{}, det...
New

Trending Over Three Years Top

lessless
For example I have multiple currencies dollar.ex defmodule Multicurrency.Currency.Dollar do @enforce_keys [:amount] defstruct [:amo...
New
elt547
I have a struct representing a session request with only two fields, email and bytes. Basically the struct should either be passed around...
New
brettp
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
evnu
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
Sebb
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
tadiou
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
Fl4m3Ph03n1x
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
Sebb
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
mxst
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
Fl4m3Ph03n1x
Background Let’s say I have a TypedStruct that has some common fields: typedstruct do @typedoc "A product." field(:item_id, Str...
New
ntd23
Is there way to get the types from struct defined as bellow, and generate functions based on your types; like binary(), integer()? Can...
New
ahamez
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
  • Follow
  • Join
  • Shape
the conversation

Latest on Elixir Forum

Elixir Forum

Similar Portals

    None added yet

We're in Beta

About us Mission Statement