Elixir

595 readers
2 users here now

founded 2 years ago
MODERATORS
26
 
 

In a third-party project, in the models, I've encountered functions like this:

  def changeset(model \\ %__MODULE__{}, params) do
    model
    |> cast(params, @required_fields ++ @optional_fields)
    |> validate_required(@required_fields)
  end

How can a function have a default argument which is both a) first and b) followed by a mandatory one?

What's interesting, they work properly.

27
28
 
 

@axelson demoing a 7-color e-ink display powered by @elixir and @NervesProject. Super cool!

#MyElixirStatus #ElixirConf2023

29
30
31
32
33
 
 
34
35
36
 
 

Against the Grain: tricky situations and how to get ourselves out of them by making some atypical choices: learn from
@sasajuric at #CodeBEAMEurope 2023 ๐Ÿ™Œhttps://codebeameurope.com/

#codebeam #myelixirstatus #elixirinaction #elixirlang @elixir

37
38
39
40
41
42
 
 

Does anyone else think that Elixir could be really well-suited to writing fediverse applications? I'm really tempted to try my hand at writing an alternative Lemmy backend. If anyone is feeling the same way, I'd be more than happy to host a project on my GitHub and give y'all access and we can see what we can do.

43
 
 

A post on mutability and state in Elixir. Functional yes. Immutable? Eeh..

44
 
 

We couldn't get Dialyzer to work well until I found this, hope it's helpful for others!