[erlang-questions] [clarify] ets API
Adam Lindberg
adam@REDACTED
Fri May 16 21:30:50 CEST 2008
On Fri, May 16, 2008 at 7:01 PM, Matthew Dempsky <matthew@REDACTED>
wrote:
> > What are the reasons for ets to exit with badarg when creating duplicate
> > tables?
> Duplicate named tables? Because the name is the only way to reference
> the table, and you can't specify which table you mean in future calls
> if two share a name.
Well, yes of course. Let me rephrase my question: What is the reason for ets
to exit with badarg instead of, for example, {error, duplicate_table}?
> How would I differ from a real badarg and a duplicate table? I guess I
> > can't?
>
You can check a table's existence with ets:info/2.
Which ets already does for me, except that it crashes with badarg. This is
harder to debug since you cannot differ between a bad argument (e.g.
ets:new("MyTable")) or a duplicate named table.
/Adam
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://erlang.org/pipermail/erlang-questions/attachments/20080516/7744ef0e/attachment.htm>
More information about the erlang-questions
mailing list