-module(helloworld).
-export([start/0]).
start() ->
Lst1 = [{"a",1},{"b",2},{"c",3}],
-module(helloworld).
-export([start/0]).
start() ->
Lst1 = [{"a",1},{"b",2},{"c",3}],
-module(helloworld).
-export([start/0]).
start() ->
Lst1 = [{"a",1},{"b",2},{"c",3}],
-module(helloworld).
-export([start/0]).
start() ->
Lst1 = [{"a",1},{"b",2},{"c",3}],
-module(helloworld).
-export([start/0]).
start() ->
M1 = #{name=>john,age=>25},
io:fwrite("~w",[map_size(M1)]).
-module(helloworld).
-export([start/0]).
start() ->
io:fwrite("~p~n",[split_binary(<<1,2,3,4,5>>,3)]).
-module(helloworld).
-export([start/0]).
start() ->
io:fwrite("~p~n",[term_to_binary("hello")]).
-module(helloworld).
-export([start/0]).
start() ->
io:fwrite("~p~n",[is_binary(<<1,2,3>>)]).
-module(helloworld).
-export([start/0]).
start() ->
io:fwrite("~p~n",[binary_part(<<1,2,3,4,5>>,{0,2})]).
-module(helloworld).
-export([start/0]).
start() ->
io:fwrite("~p~n",[erlang:memory()]).
-module(helloworld).
-export([start/0]).
start() ->
io:fwrite("~p~n",[erlang:localtime()]).
-module(helloworld).
-export([start/0]).
start() ->
put(1,"One"),
put(2,"Two"),
-module(helloworld).
-export([start/0]).
start() ->
put(1,"One"),
put(2,"Two"),
-module(helloworld).
-export([start/0]).
start() ->
io:fwrite("~p~n",[float(5)]).
-module(helloworld).
-export([start/0]).
start() ->
io:fwrite("~p~n",[element(2, {a, b, c})]).
-module(helloworld).
-export([start/0]).
start() ->
io:fwrite("~p~n",[byte_size(<<1,2,3>>)]).
% Erlang日期 date()
-module(helloworld).
-export([start/0]).
start() ->
io:fwrite("~p~n",[date()]).
-module(helloworld).
-export([start/0]).
start() ->
io:fwrite("~p~n",[tuple_to_list({1,2,3})]),
-module(helloworld).
-export([display/1,start/0]).
display(N) when N > 10 , is_integer(N) ->
io:fwrite("greater then 10");
-module(helloworld).
-export([start/0]).
start() ->
N = 9,
if
N > 10 ->
io:fwrite("N is greater than 10");
-module(helloworld).
-export([start/0]).
start() ->
A = 9,
case A of {A} when A>10 ->
io:fwrite("The value of A is greater than 10"); _ ->
-module(helloworld).
-export([display/1,start/0]).
display(N) when N > 10 ->
io:fwrite("greater then 10");
-module(helloworld).
-export([start/0]).
-define(macro1(X,Y),{X+Y}).
start() ->
io:fwrite("~w",[?macro1(1,2)]).
-module(helloworld).
-export([start/0, call/2]).
call(Arg1, Arg2) ->
io:format("~p ~p~n", [Arg1, Arg2]).
-module(helloworld).
-export([start/0, call/2]).
call(Arg1, Arg2) ->
io:format("~p ~p~n", [Arg1, Arg2]).
-module(helloworld).
-export([start/0, call/2]).
call(Arg1, Arg2) ->
io:format("~p ~p~n", [Arg1, Arg2]).
-module(helloworld).
-export([start/0, call/2]).
call(Arg1, Arg2) ->
io:format("~p ~p~n", [Arg1, Arg2]).
-module(helloworld).
-export([start/0]).
start() ->
Adder = fun(X) -> fun(Y) -> io:fwrite("~p~n",[X + Y]) end end,
-module(helloworld).
-export([start/0]).
start() ->
B = 6,
A = fun(X) ->
io:fwrite("~p~n",[X]),
-module(helloworld).
-export([start/0]).
start() ->
A = fun(X) ->
io:fwrite("~p~n",[X])