[m-rev.] for review: structured MLDS var names

Zoltan Somogyi zoltan.somogyi at runbox.com
Mon Apr 24 14:45:21 AEST 2017



On Sun, 23 Apr 2017 22:31:02 +1000 (AEST), Julien Fischer <jfischer at opturion.com> wrote:
> >     This design has a couple of minor problems. The first is that there is
> >     no place in the compiler where all the variable names are visible at once,
> >     and without such a place, we cannot be sure that two names constructed
> >     for different purposes don't accidentally end up with the same name.
> >     The probability of such a clash used to be astronomically small
> 
> See bug #92 <https://bugs.mercurylang.org/view.php?id=92>.

I have tried to reproduce that problem with my installed compiler
(which does not have this diff), but failed.

I know it was a very long time ago, but do you remember anything about
the context of the duplication? In other words, what did the generated
code use the nested occurrence of HeadVar__1_1 for?

> > +    ;       mcv_mr_value
> > +    ;       mcv_data_tag
> > +    ;       mcv_enum_const(string)
> > +    ;       mcv_sectag_const(string)
> > +            % These MLDS variables represent member variables in the classes
> > +            % we generate with --high-level-data for discriminated union types
> > +            % (both enum and non-enum). I (zs) don't know exactly what
> > +            % they are user for.
> 
> s/user/used/

Fixed.

> The diff looks fine otherwise.

Thanks for the review.

Zoltan.




More information about the reviews mailing list