Ets Question

Matthias Lang matthias@REDACTED
Sat May 25 12:41:50 CEST 2002


Hi,

I can but guess what your vbDecl module is doing, perhaps you forgot
to make the table a named table:

   Erlang (BEAM) emulator version 5.1.1 [source]
   
   Eshell V5.1.1  (abort with ^G)
   1> self().
   <0.23.0>
   2> ets:new(mytable, [public, named_table]).
   mytable
   3> 
   User switch command
    --> s
    --> c
   Eshell V5.1.1  (abort with ^G)
   1> self().
   <0.43.0>
   2> ets:lookup(mytable, bla).
   []

Matthias

--------------------

Alex Peake writes:

 > Trouble is, in the second shell, the table is not visible.
 > 
 > 1>  ets:lookup(vbDecl, varchar).
 > ** exited: {badarg,[{ets,lookup,[vbDecl,varchar]},
 >                     {erl_eval,expr,3},
 >                     {erl_eval,exprs,4},
 >                     {shell,eval_loop,2}]} **
 > 
 > =ERROR REPORT==== 24-May-2002::22:30:40 ===
 > Error in process <0.22.0> with exit value:
 > {badarg,[{ets,lookup,[vbDecl,varchar]},{erl_eval,expr,3},{erl_eval,exprs,4},
 > {shell,eval_loop,2}]}
 > 
 > But in the shell I start it in:
 > 
 > 1> vbDecl:init().
 > true
 > 2> ets:lookup(vbDecl, varchar).
 > [{varchar,"As String"}]
 > 
 > The above was in XEmacs. In the regular (werl) shell:
 > 
 > Erlang (BEAM) emulator version 5.1.1 [threads:0]
 > 
 > Eshell V5.1.1  (abort with ^G)
 > 1> ets:lookup(vbDecl, varchar).
 > 
 > =ERROR REPORT==== 24-May-2002::22:33:49 ===
 > Error in process <0.25.0> with exit value:
 > {badarg,[{ets,lookup,[vbDecl,varchar]
 > },{erl_eval,expr,3},{erl_eval,exprs,4},{shell,eval_loop,2}]}
 > ** exited: {badarg,[{ets,lookup,[vbDecl,varchar]},
 >                     {erl_eval,expr,3},
 >                     {erl_eval,exprs,4},
 >                     {shell,eval_loop,2}]} **
 > 
 > Am I missing something?
 > 
 > Alex



More information about the erlang-questions mailing list