bug in docs or in ets:info/1?

Sean Hinde sean.hinde@REDACTED
Mon Jun 27 15:07:22 CEST 2005


Hi,

Presumably this decision was taken in the interests of backwards  
compatibility.

It seems a shame to keep such a non intuitive/non erlang solution  
when even the documentation described a more sensible behaviour.

A better way forward might be to wait until the next major erlang  
release, fix the bug, and place a short note in the backward  
compatibility section of the release notes to say that this function  
is fixed and now produces what is documented.

Anyone updating to R11 will have to deal with other such issues and  
it does seem such a shame to keep broken behaviour with no potential  
for a fix.

Sean


On 27 Jun 2005, at 12:55, Gunilla Arendt wrote:

> 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