The atom ok
is often used for that:
try
ets:new(TableName,[options])
catch
% if the ets table has been initialized in the earlier test.
error:badarg->
ok
end.
It's not strictly speaking a "null statement", since it does have an effect: it becomes the return value of the expression. For example, the above try
expression will return an ETS table id if table creation succeeds, and the atom ok
if it fails. Of course, as long as you are ignoring the return value, that doesn't matter.
EDIT: You need to do this as there are no statements in Erlang, everything is an expression and returns a value.