[m-rev.] diff: mangle erlang variable names

Peter Wang wangp at students.csse.unimelb.edu.au
Fri Jun 22 15:11:58 AEST 2007


On 2007-06-22, Ian MacLarty <maclarty at csse.unimelb.edu.au> wrote:
> >  
> > +:- pred output_var_string_2(char::in, io::di, io::uo) is det.
> > +
> > +output_var_string_2(C, !IO) :-
> > +    (if char.is_alnum_or_underscore(C) then
> > +        io.write_char(C, !IO)
> > +    else
> > +        io.write_int(char.to_int(C), !IO)
> > +    ).
> > +
> 
> What if you have to two variables named V_+ and V_43.  Won't you get the
> same mangled name then (V_43)?

It's not shown in the diff, but variable names are always printed with
their unique numbers.  Although, with foreign_procs, if you try hard
enough you can get a clash.

Peter
--------------------------------------------------------------------------
mercury-reviews mailing list
Post messages to:       mercury-reviews at csse.unimelb.edu.au
Administrative Queries: owner-mercury-reviews at csse.unimelb.edu.au
Subscriptions:          mercury-reviews-request at csse.unimelb.edu.au
--------------------------------------------------------------------------



More information about the reviews mailing list