[m-rev.] for review: bulk unify and compare

Peter Wang novalazy at gmail.com
Tue Oct 2 13:59:23 AEST 2018


On Tue, 02 Oct 2018 13:33:16 +1000 (AEST), "Zoltan Somogyi" <zoltan.somogyi at runbox.com> wrote:
> 
> 
> On Tue, 2 Oct 2018 11:35:19 +1000, Peter Wang <novalazy at gmail.com> wrote:
> > > -    % generate_linear_compare_cases: for a type such as
> > > +    % generate_linear_compare_cases does a part of the job assigned to
> > > +    % generate_compare_proc_body_du_linear. Specifically, for a type such as
> > 
> > s/generate_linear_compare_cases/generate_compare_du_linear_cases
> > (earlier in the file as well)
> 
> Done.
> 
> > >      %
> > >      %   :- type foo
> > >      %       --->    f
> > >      %       ;       g(a)
> > >      %       ;       h(b, foo).
> > >      %
> > > -    % we want to generate code
> > > +    % we generate
> > >      %
> > >      %   (
> > >      %       X = f,      % UnifyX_Goal
> > > -    %       Y = X,      % UnifyY_Goal
> > >      %       R = (=)     % CompareArgs_Goal
> > >      %   ;
> > >      %       X = g(X1),
> > > @@ -1242,21 +1513,19 @@ generate_compare_proc_body_du_linear(SpecDefnInfo, Ctors, Res, X, Y, Goal,
> > >      %       )
> > >      %   )
> > >      %
> > > -    % Note that in the clauses for constants, we unify Y with X, not with
> > > -    % the constant. This is to allow dupelim to eliminate all but one of
> > > -    % the code fragments implementing such switch arms.
> > > -    %
> > >  :- pred generate_compare_du_linear_cases(spec_pred_defn_info::in,
> > 
> > This did confuse me until I found the context for it in the comment
> > about generate_compare_proc_body_du_linear. Not sure if anything needs
> > to be done.
> 
> What is the "this" that confused you?
> 

Not unifying Y with X.

Peter


More information about the reviews mailing list