[erlang-questions] small ETS wierdness...

Bob Ippolito bob@REDACTED
Sat Oct 18 11:29:00 CEST 2008


Take a closer look at the documentation for ets:new/2

Particularly these lines (my emphasis):
The parameter Options is a list of atoms which specifies table type,
access rights, key position and if the table is named or not. If one
or more options are left out, the default values are used. This means
that not specifying any options ([]) is the same as specifying
***[set,protected,{keypos,1}]***.

named_table ***If*** this option is present, the name Name is
associated with the table identifier. The name can then be used
instead of the table identifier in subsequent operations.

On Sat, Oct 18, 2008 at 1:19 AM, deepblue_other <cktgatb@REDACTED> wrote:
>
> hello...
> so this is pretty minor yet is slightly pissing me off...
> ets:new(tableName,[]) creates the table with name tableName... why in all
> examples people use the ID returned by this func, instead of using the
> tableName as a reference in other ops. Its their choice, but when I try to
> use tableName in for example ets:info(tableName) it tells me its undefined,
> and all the other ets: functions also fail with badArg when I use the
> tableName atom instead of the table ID returned from ets:new().
>
> same thing is not an issue with dets:
> strange...
> thanks
> --
> View this message in context: http://www.nabble.com/small-ETS-wierdness...-tp20045004p20045004.html
> Sent from the Erlang Questions mailing list archive at Nabble.com.
>
> _______________________________________________
> erlang-questions mailing list
> erlang-questions@REDACTED
> http://www.erlang.org/mailman/listinfo/erlang-questions
>



More information about the erlang-questions mailing list