[erlang-questions] qlc parse error (?)

Hans Bolinder hans.bolinder@REDACTED
Mon May 7 08:48:54 CEST 2007


[Paul Mineiro:]
> The following
> 
> -----------
>   Q  = qlc:q ([ C ||
>                 C <- mnesia:table (campaign),
>                 C#campaign.id =:= Id,
>                 C#campaign.status =:= online,
>                 A <- mnesia:table (account),
>                 A#account.id =:= C#campaign.account_id,
>                 A#account.status =:= C#campaign.status ]),
> -----------
> 
> results in
> 
> -----------
> Erlang (BEAM) emulator version 5.5.4 [source] [async-threads:0] [hipe] [kernel-poll:false]
> 
> Eshell V5.5.4  (abort with ^G)
> 
> 1> { ok, offerdb_2 } = c (offerdb_2), offerdb_2:test ().
> ./offerdb_2.erl:none: error in parse transform 'qlc': {{badarg,{var,0,'Id'}},
>                                  [{erl_parse,normalise,1},
>                                   {qlc_pt,'-qcon/1-lc$^1/1-1-',1},
>                                   {qlc_pt,'-qcon/1-lc$^0/1-0-',1},
>                                   {qlc_pt,qcon,1},
>                                   {qlc_pt,qdata,2},
>                                   {qlc_pt,qdata,2},
>                                   {qlc_pt,qdata,2},
>                                   {qlc_pt,qdata,2}]}

Thanks!

The attached patch will be part of R11B-5.

Best regards,

Hans Bolinder, Erlang/OTP team


*** qlc_pt.erl	Mon Apr  2 15:43:21 2007
--- /usr/local/otp/releases/otp_beam_solaris8_r11b_patched/lib/stdlib-1.14.4/src/qlc_pt.erl	Tue Mar 27 21:11:38 2007
***************
*** 1705,1711 ****
      {nil,L}.
  
  qcon(Cs) ->
!     list2cons([{tuple,0,[{integer,0,C},list2cons(Vs)]} || {C,Vs} <- Cs]).
  
  %% The original code (in Source) is used for filters and the template
  %% since the translated code can have QLC expressions and we don't
--- 1705,1711 ----
      {nil,L}.
  
  qcon(Cs) ->
!     abstr([{C,[erl_parse:normalise(V) || V <- Vs]} || {C,Vs} <- Cs], 0).
  
  %% The original code (in Source) is used for filters and the template
  %% since the translated code can have QLC expressions and we don't



More information about the erlang-questions mailing list