Don't like ads? PRO users don't see any ads ;-)
Guest

Untitled

By: a guest on Jun 22nd, 2012  |  syntax: None  |  size: 1.15 KB  |  hits: 13  |  expires: Never
download  |  raw  |  embed  |  report abuse  |  print
Text below is selected. Please press Ctrl+C to copy to your clipboard. (⌘+C on Mac)
  1. Erlang: qlc:info throws an error while qlc:eval does not - why?
  2. root@test # erl
  3. Erlang R14B02 (erts-5.8.3) [source] [64-bit] [smp:4:4] [rq:4] [async-threads:0] [kernel-poll:false]
  4.  
  5. Eshell V5.8.3  (abort with ^G)
  6. 1> Tmp = ets:new(test, [bag]), Ref = make_ref(),
  7. 1> qlc:eval(qlc:q([Ref1 || Ref1 <- ets:table(Tmp), Ref =:= Ref1])).
  8. []
  9. 2> qlc:info(qlc:q([Ref1 || Ref1 <- ets:table(Tmp), Ref =:= Ref1])).
  10. "ets:table(16400,n          [{traverse,n            {select,n             [{'$1',n               [{'=:=',{const,#Ref<0.0.0.29>},'$1'}],n               ['$1']}]}}])"
  11. 3> halt().
  12.        
  13. root@test # erl
  14. Erlang R14B02 (erts-5.8.3) [source] [64-bit] [smp:4:4] [rq:4] [async-threads:0] [kernel-poll:false]
  15.  
  16. Eshell V5.8.3  (abort with ^G)
  17. 1> Tmp = ets:new(test, [bag]), Ref = make_ref(),
  18. 1> qlc:eval(qlc:q([Ref1 || {Ref1} <- ets:table(Tmp), Ref =:= Ref1])).
  19. []
  20. 2> qlc:info(qlc:q([Ref1 || {Ref1} <- ets:table(Tmp), Ref =:= Ref1])).
  21. ** exception error: no match of right hand side value {error,{1,erl_parse,["syntax error before: ",["Ref"]]}}
  22.      in function  qlc:abstract/3
  23.      in call from qlc:abstract/3
  24.      in call from qlc:abstract/4
  25.      in call from qlc:info/2
  26. 3> halt().