Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
tree: d20d388d4f
Fetching contributors…

Cannot retrieve contributors at this time

50 lines (33 sloc) 0.877 kb
% Test for elixir-mode
% This is a single line comment.
defmodule 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 = fn(x, y) -> x + y end
difference = fn(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)
Jump to Line
Something went wrong with that request. Please try again.