-module(helloworld). -export([start/0]). -record(person, {name = "", id}). start() -> P = #person{name = "John",id = 1}, P1 = P#person{name = "Dan"}, io:fwrite("~p~n",[P1#person.id]), io:fwrite("~p~n",[P1#person.name]).
-module(helloworld). -export([start/0]). -record(person, {name = "", id}). start() -> P = #person{name = "John",id = 1}, io:fwrite("~p~n",[P#person.id]), io:fwrite("~p~n",[P#person.name]).
-module(helloworld). -export([start/0]). start() -> io:fwrite("~w",[tuple_to_list({1,2,3})]).
-module(helloworld). -export([start/0]). start() -> io:fwrite("~w",[list_to_tuple([1,2,3])]).
-module(helloworld). -export([start/0]). start() -> P = {john,24,{june,25}} , io:fwrite("~w",[is_tuple(P)]).
-module(helloworld). -export([start/0]). start() -> P = {john,24,{june,25}} , io:fwrite("~w",[tuple_size(P)]).
-module(helloworld). -export([start/0]). start() -> Lst1 = [{"a",1},{"b",2},{"c",3}], Map1 = maps:from_list(Lst1), io:fwrite("~p~n",[maps:remove("a",Map1)]).
-module(helloworld). -export([start/0]). start() -> Lst1 = [{"a",1},{"b",2},{"c",3}], Map1 = maps:from_list(Lst1), io:fwrite("~p~n",[maps:values(Map1)]).
-module(helloworld). -export([start/0]). start() -> Lst1 = [{"a",1},{"b",2},{"c",3}], Map1 = maps:from_list(Lst1), io:fwrite("~p~n",[maps:put("d",4,Map1)]).
-module(helloworld). -export([start/0]). start() -> Lst1=[{"a",1},{"b",2},{"c",3}], Lst2=[{"d",4},{"e",5},{"f",6}], Map1 = maps:from_list(Lst1), Map2 = maps:from_list(Lst2), io:fwrite("~p~n",[maps:merge(Map1,Map2)]).
We use cookies to provide and improve our services. By using our site, you consent to our Cookies Policy. Accept Learn more