Ets Question

Alex Peake <>
Sat May 25 07:36:00 CEST 2002


Thanks for the suggestion Hakan,

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


> -----Original Message-----
> From:  [mailto:]On Behalf Of
> Hakan Mattsson
> Sent: Thursday, May 23, 2002 11:20 PM
> To: Alex Peake
> Cc: 
> Subject: Re: Ets Question
>
>
> On Thu, 23 May 2002, Alex Peake wrote:
>
> Alex> I am using ets at the "top level" as I experiment and
> develop my program.
> Alex>
> Alex> Unfortunatley, every time I make an error, I lose all my
> dictionaries and
> Alex> have to re-initialize.
> Alex>
> Alex> How am I supposed to do this?
>
> The trick is to keep the process that owns your ets-tables alive.
> Misspellings and other errors may easily cause your shell process to die.
>
> When working interactively in the Erlang shell you can use two shells.
> Create the tables in one shell, start yet another shell (control-g, s, c)
> and go ahead and make all the errors that you need. ;-)
>
> /Håkan
>
> ---
> Håkan Mattsson
> Ericsson
> Computer Science Laboratory
> http://www.ericsson.com/cslab/~hakan/
>
>





More information about the erlang-questions mailing list