Reputation: 19
I need to convert this Erlang code to Elixir.
fun(OtpTemp, otp) when OtpTemp#otp.genenrated_time < time ->
[OtpTemp | otp];
(_, otp) ->
IO.inspect(otp)
end,
Upvotes: 1
Views: 60
Reputation: 121010
This is not a valid erlang code in the first place. Erlang has no clue about IO.inspect/1
and (_, otp)
would raise as well.
Record might (or might not) be a map in elixir, funs are funs.
fn
%{generated_time: gt} = temp, otp when gt < time -> [temp | otp]
_, otp -> IO.inspect(otp)
end
Upvotes: 2