[erlang-questions] ETS In Erlang

Kenneth Lundin kenneth.lundin@REDACTED
Tue Nov 27 08:18:19 CET 2012


>From the documentation of ets:

{keypos,Pos} Specfies which element inthe stored tuples should be used as
key. By default, it is the first element, i.e. Pos=1.However, this is not
always appropriate. In particular, we do not want the first element to be
the key if we want to store Erlang records in a table.

Note that any tuple stored in the table must have at least Pos number of
elements.

http://erlang.org/doc/man/ets

The keypos option does not change the tuples that are stored in the table,
it just
tell which element that should be used as key for the table in question.

/Kenneth Erlang/OTP Ericsson
Den 27 nov 2012 07:47 skrev "Lucky Khoza" <mrkhoza@REDACTED>:

> Hi Erlang Developers,
>
> I would like to ask about this tuple {keypos,pos} when creating set
> collection in Erlang Term Storage collection.
>
> What is the effect of this tuple in the collection? What does it do on the
> collection's rows?
>
> Thanks for your help in advance
>
> Kindest Regards
> Lucky
>
> _______________________________________________
> erlang-questions mailing list
> erlang-questions@REDACTED
> http://erlang.org/mailman/listinfo/erlang-questions
>
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://erlang.org/pipermail/erlang-questions/attachments/20121127/f7218195/attachment.htm>


More information about the erlang-questions mailing list