[m-rev.] for review: avoid using some "keywords" 5

Julien Fischer jfischer at opturion.com
Mon May 16 11:28:50 AEST 2016



On Mon, 16 May 2016, Zoltan Somogyi wrote:

> On Mon, 16 May 2016 10:26:30 +1000 (AEST), Julien Fischer <jfischer at opturion.com> wrote:

>>> +:- type unify_mode
>>> +    --->    unify_modes_lhs_rhs(mer_mode, mer_mode).
>>> +
>>> +:- type uni_insts
>>> +    --->    uni_insts_lhs_rhs(mer_inst, mer_inst).
>>> +            % Respectively, the insts of the left and right hand sides
>>> +            % of the unification.
>>>  :- type uni_mode
>>> -    --->    pair(mer_inst) -> pair(mer_inst).
>>> -            % Each uni_mode maps a pair of insts to a pair of new insts
>>> -            % Each pair represents the insts of the LHS and the RHS
>>> -            % respectively.
>>> +    --->    from_to_uni_insts(uni_insts, uni_insts).
>>> +            % The initial insts of the two sides of the unification,
>>> +            % and their final insts.
>>
>> I would prefer not to abbreviate "unify" or "unification" to "uni" as in a
>> system that also deals with "unique" or "uniqueness" all over the place, it's
>> confusing.
>
> I take your point.
>
>> I suggest the following for the above:
>>
>>      :- type unify_modes
>>          --->    unify_modes_lhs_rhs(mer_mode, mer_mode).
>>
>>      :- type unify_insts
>>          --->    unify_insts_lhs_rhs(mer_inst, mer_inst).
>>
>>      :- type unify_mode
>>          --->    from_to_unify_insts(unify_insts, unify_insts).
>
> However, this would be even MORE confusing, because it conflates
> two even more closely related concepts that are nevertheless still
> distinct: the modes of the argument unifications, and of the whole
> unification.
>
> Since "uni" is too easily confused with both "unify" and "unique",
> how about replacing "uni_mode" with "arg_mode" or "sub_mode",
> with a similar substitution applied to "uni_insts", "uni_insts_lhs_rhs"
> and "from_to_uni_mode"?
>
> "arg_mode" sounds more appropriate, but that type name is already
> taken. We could rename the old arg_mode type to e.g. arg_top_mode

arg_unify_mode?  (I don't like arg_mode as it no longer mentions unify.)

I think renaming the existing arg_mode ==> arg_top_mode would be
desirable independent of this.

> or arg_kind.

"arg_kind" is a bad name since the compiler also deals with kinds (of
the type system variety).

Julien.


More information about the reviews mailing list