Please note, this is a STATIC archive of website www.tutorialspoint.com from 11 May 2019, cach3.com does not collect or store any user information, there is no "phishing" involved.
Tutorialspoint

map_key

% hello world program
-module(helloworld).
-export([start/0]).

input(M) -> input(M,[]).
input([],Acc) -> Acc;
input([#{id:=Id,status:=Status}|T],Acc) -> 
 if 
    Status==active->
     input(T,Acc++[Id]);
     true -> input(T,Acc)
    end.
    %io:format("~p :",[D]).

start() ->

M = [#{id=>1, status=>active},
#{id=>2, status=>active},
#{id=>3, status=>inactive},
#{id=>4, status=>active}],
D = input(M),
io:format("~p :",[D]).
    %io:fwrite("Hello, world!\n").

Advertisements
Loading...

We use cookies to provide and improve our services. By using our site, you consent to our Cookies Policy.