PluginProbe
Code Block Pro – Beautiful Syntax Highlighting / 1.13.0
Code Block Pro – Beautiful Syntax Highlighting v1.13.0
1.27.1 1.27.2 1.27.3 1.27.4 1.27.5 1.27.6 1.27.7 1.28.0 1.3.0 1.4.0 1.5.0 1.5.1 1.5.2 1.6.0 1.7.0 1.8.0 1.9.0 1.9.1 1.9.2 1.9.3 trunk 1.1.0 1.10.0 1.11.0 1.11.1 All 63 releases
← All changes | build/shiki/samples/elixir.sample +7 -25 1.28.01.13.0 View file →
@@ -1,26 +1,8 @@
1 -# [] can be used, first match returned
2 -1 = [a: 1, b: 2, a: 3][:a]
1 +# module_name.ex
2 +defmodule ModuleName do
3 + def hello do
4 + IO.puts "Hello World"
5 + end
6 +end
3 7
4 -# [] missing value is nil
5 -nil = [a: 1, b: 2, a: 3][:c]
6 -
7 -# Keyword get also works
8 -1 = Keyword.get([a: 1, b: 2, a: 3], :a)
9 -
10 -# missing value is nil
11 -nil = Keyword.get([a: 1, b: 2, a: 3], :c)
12 -
13 -# an optional default value can be specified
14 -# for missing keys
15 -"missing" = Keyword.get([a: 1, b: 2, a: 3], :c, "missing")
16 -
17 -# Keyword.take returns a list of matching pairs
18 -[a: 1, a: 3] = Keyword.take([a: 1, b: 2, a: 3], [:a])
19 -
20 -[] = Keyword.take([a: 1, b: 2, a: 3], [:c])
21 -
22 -# dot syntax does NOT work
23 -# results in compile error
24 -[a: 1, b: 2, a: 3].a
25 -
26 -# From https://elixir-examples.github.io/single-page
8 +# From https://elixir-lang.org/crash-course.html#elixir