작품 Erlang : qlc : info는 qlc : eval이 오류를 발생시키는 이유는 무엇입니까? - 왜?
[email protected] # erl
Erlang R14B02 (erts-5.8.3) [source] [64-bit] [smp:4:4] [rq:4] [async-threads:0] [kernel-poll:false]
Eshell V5.8.3 (abort with ^G)
1> Tmp = ets:new(test, [bag]), Ref = make_ref(),
1> qlc:eval(qlc:q([Ref1 || Ref1 <- ets:table(Tmp), Ref =:= Ref1])).
[]
2> qlc:info(qlc:q([Ref1 || Ref1 <- ets:table(Tmp), Ref =:= Ref1])).
"ets:table(16400,\n [{traverse,\n {select,\n [{'$1',\n [{'=:=',{const,#Ref<0.0.0.29>},'$1'}],\n ['$1']}]}}])"
3> halt().
는
[email protected] # erl
Erlang R14B02 (erts-5.8.3) [source] [64-bit] [smp:4:4] [rq:4] [async-threads:0] [kernel-poll:false]
Eshell V5.8.3 (abort with ^G)
1> Tmp = ets:new(test, [bag]), Ref = make_ref(),
1> qlc:eval(qlc:q([Ref1 || {Ref1} <- ets:table(Tmp), Ref =:= Ref1])).
[]
2> qlc:info(qlc:q([Ref1 || {Ref1} <- ets:table(Tmp), Ref =:= Ref1])).
** exception error: no match of right hand side value {error,{1,erl_parse,["syntax error before: ",["Ref"]]}}
in function qlc:abstract/3
in call from qlc:abstract/3
in call from qlc:abstract/4
in call from qlc:info/2
3> halt().
나는 이유를 이해할 수 없다 작동하지 않습니다. 이 오류로 인해 설명 할 수없는 훨씬 복잡한 쿼리에서이 오류를 발견했습니다.
흥미로운 것은 qlc : info/1이 두 번 호출되면 성공한다는 것입니다. –
PoC를 게시 할 수 있습니까? 나는 당신이 무슨 뜻인지 이해하지 못했습니다. – trytrytry
이것은 오래된 질문이며, 여전히 답을 찾지 못했거나 닫힌 것이 놀랍습니다. 제 질문은 왜 그냥 참조 대신 {참조} 테이블에 참조를 저장합니까? – pedromanoel