[erlang-questions] public,private ets

Ulf Wiger <>
Mon Dec 18 21:03:41 CET 2006


Out of curiosity, I did this:

6> ets:new(tab,[public,private]).
16
7> ets:info(16, protection).
private

Further testing indicated that the order doesn't matter.
Repeating an option is fine, although it doesn't give it
more weight.
[private,public] will also result in a private tab.

ets:new(tab, [private,protected]) will give a ... you guessed it:
private table.

ets:new(tab, [protected, public]) then of course results in a
public table.

The documentation doesn't state what should happen when conflicting
options are given. Personally, I'd like for the interface to be a
little bit less entertaining, and simply forbid conflicting options.

BR,
Ulf W




More information about the erlang-questions mailing list