Тёмный

How to turn maps and keyword lists into Elixir structs 

German Velasco
Подписаться 1,5 тыс.
Просмотров 696
50% 1

One nice way of turning a map or keyword list into an existing struct is to use
`struct/2` or `struct!/2`.
- `struct/2` will drop any attributes that are not part of the struct
- `struct!/2` will raise an error if there are attributes that are not part of
the struct
But not only can they create structs, they can also update them!
For more videos like this, check out www.elixirstreams.com/

Наука

Опубликовано:

 

17 июл 2023

Поделиться:

Ссылка:

Скачать:

Готовим ссылку...

Добавить в:

Мой плейлист
Посмотреть позже
Комментарии : 7   
@danieljaouen9384
@danieljaouen9384 11 месяцев назад
Pretty cool! 👍✌️
@armanmirk
@armanmirk 7 месяцев назад
That’s really cool. Thanks for sharing
@germanvelasco
@germanvelasco 7 месяцев назад
Glad you liked it! Always great to see what people enjoy.
@tkemaladze
@tkemaladze 5 месяцев назад
how do you send lines to iex session?
@germanvelasco
@germanvelasco 5 месяцев назад
That's a vim + tmux workflow. I use a package called tslime to send commands to an arbitrary tmux pane.
@tkemaladze
@tkemaladze 5 месяцев назад
@@germanvelasco thanks for reply
@elixirfun
@elixirfun 8 месяцев назад
What plugin do you use to send a line from vim to the iex session? 🙏
Далее
Elixir Structs
10:37
Просмотров 1,6 тыс.
Sinfdosh xotin 7😂
01:01
Просмотров 1,8 млн
🎤Пою РЕТРО Песни ✧˖°
3:04:48
Просмотров 1,7 млн
Why Does Scrum Make Programmers HATE Coding?
16:14
Просмотров 496 тыс.
Solving one of PostgreSQL's biggest weaknesses.
17:12
Просмотров 176 тыс.
All Rust string types explained
22:13
Просмотров 151 тыс.
Giant Boeing 747 Vertical Takeoff | X-Plane 11
10:25
Просмотров 167 млн
Elixir map syntax clarified (for beginners)
5:04
Просмотров 2,7 тыс.
Elixir in 100 Seconds
2:35
Просмотров 599 тыс.
25 Nooby Pandas Coding Mistakes You Should NEVER make.
11:30
FullHD в 8К БЕЗ ПОТЕРЬ? | РАЗБОР
20:42