Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- -record(monitor, {stations, measurements}).
- -record(measurement, {date, type, value}).
- -record(station, {name, coords}).
- createMonitor() ->
- #monitor{stations = #{}, measurements = #{}}.
- addStation(Monitor, Name, Coords) ->
- {monitor, Stations, Measurements} = Monitor,
- Station = #station{name = Name, coords = Coords},
- maps:put(Name, Station, Stations),
- maps:put(Coords, Station, Stations),
- maps:put(Station, [], Measurements),
- {monitor, Stations, Measurements}.
- z takim dodawaniem też nie działa :( :
- Stations#{Name => Station, Coords => Station},
- Measurements#{Station => []},
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement