Ets Question
Alex Peake
apeake@REDACTED
Sat May 25 23:55:21 CEST 2002
Great! Thank you Thomas.
Is there a way to do this in XEmacs (which is a *much* more friendly way to
develop)?
Alex
> -----Original Message-----
> From: tle@REDACTED [mailto:tle@REDACTED]On Behalf Of
> Thomas Lange
> Sent: Saturday, May 25, 2002 9:28 AM
> To: Alex Peake
> Cc: erlang-questions@REDACTED
> Subject: Re: Ets Question
>
>
> Your problem is that you are running two erlang
> nodes ( different processes in OS ).
> They can never exchange data since you have no erlang
> distribution running.
>
> Every time you run werl, you launch a new node.
>
> In order to have 2 shells in the same node, do like
> Matthias did in his example ( ctrl-G ) to launch
> a second shell.
>
> /Thomas
>
>
> Alex Peake wrote:
> >
> > Thanks for the suggestion, but no, that is not the problem:
> >
> > ets:new(vbDecl,[set,public,named_table,{keypos,1}])
> > ets:insert(vbDecl,{varchar, "As String"}),
> >
> > Alex
> >
> > > -----Original Message-----
> > > From: owner-erlang-questions@REDACTED
> > > [mailto:owner-erlang-questions@REDACTED]On Behalf Of Matthias Lang
> > > Sent: Saturday, May 25, 2002 3:42 AM
> > > To: Alex Peake
> > > Cc: Hakan Mattsson; erlang-questions@REDACTED
> > > Subject: RE: Ets Question
> > >
> > >
> > > 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