I am trying to declaring and initializing the record with map (Example: -record(month_names,#{1=> "January",2=>"February",3=>"March",4=>"April",5=>"May",6=>"June",7=>"July",8=>"August",9=>"September",10=>"October",11=>"November",12=>"December"}).
), but while i am trying to access the value of map its not getting the output.
Tried Code:
**
-module(main).
-export([calender/1]).
-record(month_days, #{1=> "31",2 => "28",3=>"31",4=>"30",5=>"31",6=>"30",7=>"31",8=>"31",9=>"30",10=>"31",11=>"30",12=>"31"}).
-record(month_names,#{1=> "January",2 => "February",3=>"March",4=>"April",5=>"May",6=>"June",7=>"July",8=>"August",9=>"September",10=>"October",11=>"November",12=>"December"}).
calender(Year) ->
Day = #month_days{month_days= 1,val= 1},
io:fwrite("~p~n",Year),
io:fwrite("~p~n", [Day#month_days.month_days]).
**
But I am getting the error in the given below :
Error :
**
10> c(main).
main.erl:3: bad record declaration
main.erl:4: bad record declaration
main.erl:8: record month_days undefined
main.erl:10: record month_days undefined
error
**