[erlang-questions] ets gives badarg after recompile

Bengt Kleberg bengt.kleberg@REDACTED
Mon Nov 26 08:00:15 CET 2007


greetings,

could you be a little more precise when describing the problem? given 
this file:
-module(t).

-export([t/0]).

t()->
	myname = ets:new(myname, [set, named_table]),
	true = ets:insert( myname, {a,1}),
	[{a,1}] = ets:lookup( myname, a ),
	true = ets:delete( myname ).


i can do:
7> c(t).

{ok,t}
8> t:t().

true
9> t:t().

true
10> c(t).

{ok,t}
11> t:t().

true
12>


bengt
Those were the days...
    EPO guidelines 1978: "If the contribution to the known art resides
    solely in a computer program then the subject matter is not
    patentable in whatever manner it may be presented in the claims."


On 11/25/07 20:46, Andrew Arrow wrote:
> If I create a new ets with
> 
> ets:new(myname, [set, named_table]).
> 
> and do some inserts and lookups from it everything is fine.  At the
> end of the program I call ets:delete(myname).
> 
> I can re-run the program from the shell, no problems.  But if I
> recompile it and then run I get:
> 
> =ERROR REPORT==== 25-Nov-2007::11:38:26 ===
> Error in process <0.3579.10> with exit value:
> {badarg,[{ets,lookup,[myname,53]},{ets_test,my_map,2}]}
> 
> I have to hit control-G and kill the job and create a new shell.  Then
> I can compile and run it fine again.  But on the 2nd compile same
> thing happens.
> 
> Why does c(my_module). make the ets no longer work and require a new shell?
> _______________________________________________
> erlang-questions mailing list
> erlang-questions@REDACTED
> http://www.erlang.org/mailman/listinfo/erlang-questions



More information about the erlang-questions mailing list