[erlang-questions] Question about ETS documentation
Mon Mar 31 05:14:31 CEST 2014
ets stores tuples (aka 'objects' in the documentation), where by default
the first element is taken to be the key. The lookup/2 function will return
all objects (ie., tuples) that match the key. Whereas lookup_element/3 will
only return the term stored at the requested position on the matching
Hope this helps,
On Mar 30, 2014 11:45 PM, "Yves S. Garret" <yoursurrogategod@REDACTED>
> I've been reading this documentation:
> What I have a hard time figuring out is what the Pos means. Why would it
> be needed at all? I'm looking at this code:
> Cx_PId = ets:lookup_element(IdsNPIds, Cx#cortex.id, 2),
> And I have no idea what this and why have it there. I've already
> specified the element that we're searching for, why the position? Does the
> position refer to the element that's located inside of the return value?
> As in, I want the 2nd element from the return value?
> Thanks in advance.
> erlang-questions mailing list
-------------- next part --------------
An HTML attachment was scrubbed...
More information about the erlang-questions