dwyl / dwyl/learn-elixir

Shortcut syntax for key/value pair lists and maps used in this tutorial

Open
#59 3 comments 1 reaction 1 assignee Claimed by @iteles View on GitHub
T25m
Dominant language
Elixir
Stars
1.7k
Forks
112
PR merge metrics
No merged PRs in 30d

Description

In most beginner learning resources I have seen, map literals are presented as:
```elixir
animal = %{
:name => "Rex",
:type => "dog",
:legs => 4
}
```

In this repo, we dive straight into using the shortcut for key/value maps (https://github.com/dwyl/learn-elixir#maps).
```elixir
animal = %{
name: "Rex",
type: "dog",
legs: 4
}
```

My understanding is that whilst this is the most common usage, it's also only able to be used if the keys are atoms. Is it worth mentioning that this is a possible syntax so that beginners who see other resources are not confused?

Contributor guide

No contributing guide indexed for this repository

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.