Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

ERL-657: some ets funs does not comply for tab() as it in their spec. #3702

Closed
OTP-Maintainer opened this issue Jun 28, 2018 · 1 comment
Closed
Assignees
Labels
not a bug Issue is determined as not a bug by OTP priority:low team:VM Assigned to OTP team VM

Comments

@OTP-Maintainer
Copy link

Original reporter: profetasajt
Affected version: OTP-20.2
Component: stdlib
Migrated from: https://bugs.erlang.org/browse/ERL-657


Some of ets funs (for example: ets:i/1, ets:delete/1)  are throwing bad argument exception when atom() name is used instead of tid() even if their spec are using tab() which is atom() | tid().

---- sample log here ---

Erlang/OTP 20 [erts-9.2] [source] [64-bit] [smp:4:4] [ds:4:4:10] [async-threads:10] [hipe] [kernel-poll:false]

Eshell V9.2  (abort with ^G)
1> ets:new(tab,[public]).
#Ref<0.3892917531.4052353025.47844>
2> ets:delete(tab).
** exception error: bad argument
     in function  ets:delete/1
        called as ets:delete(tab)
3> 




@OTP-Maintainer
Copy link
Author

john said:

You forgot to pass the {{named_table}} option to {{ets:new/2}}, so you can't refer to it by name in ETS functions. The documentation ought to be a bit clearer on this point. :/

The following works fine:

{code:java}
tab = ets:new(tab,[public, named_table]), %% note that it returns the tid()!
ets:delete(tab).
{code}

http://erlang.org/doc/man/ets.html#new-2

@OTP-Maintainer OTP-Maintainer added not a bug Issue is determined as not a bug by OTP team:VM Assigned to OTP team VM priority:low labels Feb 10, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
not a bug Issue is determined as not a bug by OTP priority:low team:VM Assigned to OTP team VM
Projects
None yet
Development

No branches or pull requests

2 participants