Fwd: bug in docs or in ets:info/1?

Gunilla Arendt gunilla@REDACTED
Mon Jun 27 13:55:12 CEST 2005


Hi,

The documentation for ets has now been updated, saying that ets:info/1 
returns a tuple.

Best regards, Gunilla

Fredrik Thulin wrote:
> 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
> 
> -------------------------------------------------------
> 
> 


-- 
_____Gunilla Arendt______________________________________________
Erlang/OTP development
Gunilla.Arendt@REDACTED  +46-8-7275730  ecn 851 5730



More information about the erlang-questions mailing list