Erlang/OTP Forums

Author Message

<  Erlang bugs mailing list  ~  ms_transform.erl doesn't handle packages

uwiger
Posted: Mon Jul 24, 2006 12:03 pm Reply with quote
User Joined: 03 Jul 2006 Posts: 604 Location: Sweden
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);
Post recived from mailinglist
View user's profile Send private message Visit poster's website
uwiger
Posted: Mon Jul 24, 2006 2:49 pm Reply with quote
User Joined: 03 Jul 2006 Posts: 604 Location: Sweden
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: owner-erlang-bugs@erlang.org
> [mailto:owner-erlang-bugs@erlang.org] On Behalf Of Ulf Wiger (TN/EAB)
> Sent: den 24 juli 2006 13:52
> To: erlang-bugs@erlang.org
> 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);
>
Post recived from mailinglist
View user's profile Send private message Visit poster's website
Setuca
Posted: Wed Aug 16, 2006 10:22 pm Reply with quote
Guest
Where you get it???

Display posts from previous:  

All times are GMT
Page 1 of 1
This forum is locked: you cannot post, reply to, or edit topics.

Jump to:  

You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum
You cannot attach files in this forum
You cannot download files in this forum