ms_transform.erl doesn't handle packages

Ulf Wiger (TN/EAB) <>
Mon Jul 24 16:39:30 CEST 2006


The same goes for QLC. Here's a patch for qlc_pt.erl

*** /vobs/otp/otp_delivery/solaris8_sparc/lib/stdlib-1.14/src/qlc_pt.erl
Tue May 23 16:03:41 2006
--- qlc_pt.erl  Mon Jul 24 16:28:29 2006
***************
*** 35,40 ****
--- 35,43 ----
  %% Also in qlc.erl.
  -define(QLC_Q(L1, L2, L3, L4, LC, Os), 
          {call,L1,{remote,L2,{atom,L3,?APIMOD},{atom,L4,?Q}},[LC |
Os]}).
+ -define(QLC_QQ(L1, L2, L3, L4, L5, L6, LC, Os), 
+         {call,L1,{remote,L2,{record_field,L3,{atom,L4,''},
+                            {atom,L5,?APIMOD}},{atom,L6,?Q}},[LC |
Os]}).
  -define(IMP_Q(L1, L2, LC, Os), {call,L,{atom,L2,?Q},[LC | Os]}).
  
  %% Also in qlc.erl.
***************
*** 1208,1213 ****
--- 1211,1223 ----
      NL = make_lcid(L1, No),
      {T, A} = F(NL, LC, A2),
      {?QLC_Q(L1, L2, L3, L4, T, Os), A, No + 1};
+ qlcmf(?QLC_QQ(L1, L2, L3, L4, L5, L6, LC0, Os0),
+       F, Imp, A0, No0) when length(Os0) < 2 ->
+     {Os, A1, No1} = qlcmf(Os0, F, Imp, A0, No0),
+     {LC, A2, No} = qlcmf(LC0, F, Imp, A1, No1), % nested...
+     NL = make_lcid(L1, No),
+     {T, A} = F(NL, LC, A2),
+     {?QLC_QQ(L1, L2, L3, L4, L5, L6, T, Os), A, No + 1};
  qlcmf(?IMP_Q(L1, L2, LC0, Os0), F, Imp=true, A0, No0) when length(Os0)
< 2 ->
      {Os, A1, No1} = qlcmf(Os0, F, Imp, A0, No0),
      {LC, A2, No} = qlcmf(LC0, F, Imp, A1, No1), % nested...

BR,
Ulf W 

> -----Original Message-----
> From:  
> [mailto:] On Behalf Of Ulf Wiger (TN/EAB)
> Sent: den 24 juli 2006 13:52
> To: 
> Subject: ms_transform.erl doesn't handle packages
> 
> 
> I'm sure this isn't something lots of people have run into, 
> but when using packages, a call to ets:fun2ms(Fun) must be 
> written as .ets:fun2ms(Fun). The parse_transform code needs 
> to recognize this form and transform it.
> 
> (I know that the package support is undocumented and
> unsupported...)
> 
> A diff that fixes the problem is given below.
> 
> BR,
> Ulf W 
> 
> 
> *** OTP_R11B/lib/stdlib-1.14/src/ms_transform.erl Tue May 23 16:03:38
> 2006
> --- ms_transform.erl    Mon Jul 24 13:42:47 2006
> ***************
> *** 297,302 ****
> --- 297,306 ----
>  
> copy({call,Line,{remote,_Line2,{atom,_Line3,ets},{atom,_Line4,
> fun2ms}},
>         As0}) ->
>       transform_call(ets,Line,As0);
> + copy({call,Line,{remote,_Line2,{record_field,_Line3,
> +                               {atom,_Line4,''},{atom,_Line5,ets}},
> +                {atom,_Line6,fun2ms}}, As0}) ->
> +     transform_call(ets,Line,As0);
>  
> copy({call,Line,{remote,_Line2,{atom,_Line3,dbg},{atom,_Line4,
> fun2ms}},
>         As0}) ->
>       transform_call(dbg,Line,As0);
> 



More information about the erlang-bugs mailing list