[m-dev.] diff: pass typeclass-info args to C code

Tyson Dowd trd at cs.mu.OZ.AU
Fri Aug 21 11:52:36 AEST 1998


On 21-Aug-1998, David Glen JEFFERY <dgj at cs.mu.OZ.AU> wrote:
> On 20-Aug-1998, Tyson Dowd <trd at cs.mu.OZ.AU> wrote:
> > The change is fine, although as I pointed out to you in person, the
> > naming convention allows collisions in generated names.  However, as
> > you pointed out to me, the current system allows such things too, and
> > doesn't work properly anyway, so it's not a big problem, but should
> > be fixed by someone at some stage in the future.
> 
> Actually, now that I think about it, the existing system doesn't have this
> problem at all. (For those who are wondering, the problem is that the name
> produced for a typeclass-info is:
> 	TypeclassInfo_for_<classname>_<var1>_<var2>...
> 
> So... constraints like:
> 	class1(T1, T2) and class1_T1(T2)
> 
> would produce the same name. Perhaps a more liberal use of double underscore
> will fix this? Ideas?

TypeclassInfo_for_<classname>__<var1>_<var2>

class1(T1, T2) TypeclassInfo_for_class1__T1_T2
class1_T1(T2)  TypeclassInfo_for_class1_T1__T2
class1__T1(T2) TypeclassInfo_for_class1__T1__T2

(not that __ in a class name is particularly legal -- it's a module
qualifier).

-- 
Those who would give up essential liberty to purchase a little temporary
safety deserve neither liberty nor safety.     - Benjamin Franklin

Tyson Dowd   <tyson at tyse.net>   http://tyse.net



More information about the developers mailing list