Fwd: bug in docs or in ets:info/1?
Fredrik Thulin
ft@REDACTED
Mon Jun 20 10:38:01 CEST 2005
Hi
When googling for something unrelated, I stumbled upon an old post of
mine that I did not remember ever getting an answer for, and the
problem (if it is a problem) is still there in R10B-5, so I though I'd
bring it up again.
It seems really odd to me that ets:info/1 returns a tuple containing
tuples instead of a list of tuples, like the documentation says it
should. Is this a bug in the documentation or in the code?
/Fredrik
---------- Forwarded Message ----------
Subject: bug in docs or in ets:info/1?
Date: Tuesday 02 November 2004 07.35
From: Fredrik Thulin <ft@REDACTED>
To: erlang-questions@REDACTED
Hi
It seems to me that the documentation of ets:info/1 isn't in sync with
the code, or even more probably the other way around. The R10B-0
documentation says that ets:info/1 returns a list of tuples, when it is
in fact returning a tuple containing a number of tuples. I think a list
of tuples would be more suitable.
Eshell V5.4 (abort with ^G)
1> L = ets:info(inet_cache).
{{memory,277},
...
{protection,public}}
2> is_list(L).
false
3> is_tuple(L).
true
4>
Documentation :
>info(Tab) -> [{Item,Value}] | undefined
>
>Types:
>
>Tab = tid() | atom()
>Item, Value - see below
>
>Returns information about the table Tab as a list of {Item,Value}
>tuples:
The fix in ets.erl seems pretty obvious, but maybe there are concerns
with code that is expecting the current format?
/Fredrik
-------------------------------------------------------
More information about the erlang-questions
mailing list