[erlang-questions] What is a tid()?

Kostis Sagonas kostis@REDACTED
Mon May 24 14:33:43 CEST 2010


Per Hedeland wrote:
> Hi,
> 
> I never saw any response to the below... If the fact that the ets module
> "claims" a builtin/"global" type tid() instead of ets:tid() is *not* a
> bug, is there perhaps some rationale for this?

I have made all changes that take out tid() from the list of built-in 
types. My intention is that this will be pushed to main OTP repository 
soon. Whether this change will be included in R14 or not is a matter of 
priorities of me and OTP developers and will also depend on the deadline 
for the code freeze. But this will eventually happen.

Kostis

> Per Hedeland <per@REDACTED> wrote:
>> Per Hedeland <per@REDACTED> wrote:
>>> Kostis Sagonas <kostis@REDACTED> wrote:
>>>> Per Hedeland wrote:
>>>>> $ erlc test.erl
>>>>> ./test.erl:5: referring to built-in type tid as a remote type; please take out the module name
>>>> tid() is a built-in opaque type for ETS table identifiers.
>>> Thanks - maybe it's already in the queue for an update to
>>> http://www.erlang.org/doc/reference_manual/typespec.html?
>>>
>>>> These cannot be redefined.
>>>>
>>>> However, the warning you have run into predates the introduction of 
>>>> remote types and is probably a bug.  Although one should currently use 
>>>> tid() to refer to ets:tid(), it should be possible to use a tid() type 
>>>> that one of their modules export.
>>> Well, it can't be defined in the other module anyway, can it? If so
>>> that's perfectly OK by me, and the error is appropriate - it's just a
>>> documentation omission.
>> Actually, I take that back - thinking about it, it seems very wrong that
>> this tid() should be built-in. Or rather, that it has the "global" name
>> tid() instead of only ets:tid(), which would be both clearer and more
>> logical (currently ets:tid() can't even be used). It's even listed along
>> with match_spec() (which *requires* the ets: prefix) in ets(3).
>>
>> As far as I can see (only looking in the documentation....), all the
>> other built-in / "global" types are defined in terms of the language,
>> either as fundamental types or derived from other types - whereas tid()
>> can only be defined in terms of a specific module (that the module
>> happens to be partially implemented in the VM shouldn't be relevant).
>>
>> Surely this is actually a bug, and the typespec documentation that omits
>> tid() is correct?
>>
>> --Per
> 
> ________________________________________________________________
> erlang-questions (at) erlang.org mailing list.
> See http://www.erlang.org/faq.html
> To unsubscribe; mailto:erlang-questions-unsubscribe@REDACTED



More information about the erlang-questions mailing list