-
Notifications
You must be signed in to change notification settings - Fork 7
/
Copy pathtest.ex
50 lines (33 loc) · 866 Bytes
/
test.ex
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
% Test for elixir-mode
% This is a single line comment.
module Hello % module definition
def hello (person := "world") % method definition, with argument defaults
"Hello, " + person + "." % using + as a string method
end % ending indentation
end
% Defining a variable
answer = 42
% Functions
sum = (x, y) -> x + y
difference = (x, y) do
x - y
end
% Erlang builtins
Erlang.is_atom(true) %=> true
% If elixir-mode-higlight-operators is enabled, these will be colored.
lotsofoperators = ((((4 + 4) div 2) * 3 - 4) rem 5 / 2).to_s % arithmetic and method operators
h = #Hello() % `#' operator
!false %=> true
true && true %=> true
true || false %=> true
% Here are some atoms
true
false
nil
'foo
'bar
% Here are some regular expressions
-r("[ \n\t]")
% Some modules
Date.today
Timer.ms(-> 1 + 2)