【问题标题】:ets:i/1 tty's second option meaningets:i/1 tty 的第二个选项含义
【发布时间】:2012-03-07 13:00:44
【问题描述】:

我现在正在研究gproc项目的内部ets结构。使用“ets:i/1”命令时,tty 给了我 3 个选项。 (p)Digits 是什么意思?

(emacs@yus-iMac.local)35> ets:i(gproc).
<1   > {{<0.77.0>,l}}
<2   > {{<0.77.0>,{c,l,c1}},[{initial,3}]}
<3   > {{<0.77.0>,{n,l,{dummy,1}}},[]}
<4   > {{<0.77.0>,{p,l,prop}},[]}
<5   > {{{c,l,c1},<0.77.0>},<0.77.0>,3}
<6   > {{{n,l,{dummy,1}},n},<0.77.0>,undefined}
<7   > {{{p,l,prop},<0.77.0>},<0.77.0>,undefined}
EOT  (q)uit (p)Digits (k)ill /Regexp -->p
Bad digits
EOT  (q)uit (p)Digits (k)ill /Regexp -->1
EOT  (q)uit (p)Digits (k)ill /Regexp --><1>
EOT  (q)uit (p)Digits (k)ill /Regexp -->k
ok
(emacs@yus-iMac.local)36> ets:i(gproc).

=ERROR REPORT==== 7-Mar-2012::07:20:00 ===
** Generic server gproc terminating 
** Last message in was {'DOWN',#Ref<0.0.0.178>,process,<0.77.0>,normal}
** When Server state == {state}
** Reason for termination == 
** {badarg,[{ets,member,[gproc,{<0.77.0>,l}],[]},
            {gproc,process_is_down,1,[{file,"src/gproc.erl"},{line,1777}]},
            {gproc,handle_info,2,[{file,"src/gproc.erl"},{line,1689}]},
            {gen_server,handle_msg,5,[{file,"gen_server.erl"},{line,597}]},
            {proc_lib,init_p_do_apply,3,[{file,"proc_lib.erl"},{line,227}]}]}
** exception error: bad argument
     in function  ets:first/1
        called as ets:first(gproc)
     in call from ets:i/3 (ets.erl, line 1203)
(emacs@yus-iMac.local)37> 

【问题讨论】:

    标签: erlang


    【解决方案1】:

    pNNN 将打印记录号 NNN。

    例如:

    (emacs@yus-iMac.local)35> ets:i(gproc).
    <1   > {{<0.77.0>,l}}
    <2   > {{<0.77.0>,{c,l,c1}},[{initial,3}]}
    <3   > {{<0.77.0>,{n,l,{dummy,1}}},[]}
    <4   > {{<0.77.0>,{p,l,prop}},[]}
    <5   > {{{c,l,c1},<0.77.0>},<0.77.0>,3}
    <6   > {{{n,l,{dummy,1}},n},<0.77.0>,undefined}
    <7   > {{{p,l,prop},<0.77.0>},<0.77.0>,undefined}
    EOT  (q)uit (p)Digits (k)ill /Regexp -->p3
    {{<0.77.0>,{n,l,{dummy,1}}},[]}
    

    【讨论】:

      猜你喜欢
      • 1970-01-01
      • 1970-01-01
      • 2019-03-31
      • 2016-11-07
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 2014-09-02
      相关资源
      最近更新 更多