[m-dev.] diff: fixes for demangling

Tyson Richard DOWD trd at cs.mu.oz.au
Thu Jul 24 17:03:34 AEST 1997


Fergus Henderson wrote:
> Tyson Richard DOWD, you wrote:
> > 
> > > +	( remove_prefix("__Unify__") ->
> > > +		{ Category = unify }
> > > +	; remove_prefix("__Compare__") ->
> > > +		{ Category = compare },
> > > +		{ ModeNum = 0 } % sanity check
> > > +	; remove_prefix("__Index__") ->
> > > +		{ Category = index },
> > > +		{ ModeNum = 0 } % sanity check
> > > +	;	
> > > +		{ Category = ordinary }
> > > +	),
> > 
> > I don't know whether "sanity check" is the right comment. If it's a
> > sanity check, they should use require. Instead, it rejects them as a
> > pred symbol, and doesn't demangle them.
> 
> It shouldn't use require, because the input could be any old random junk,
> and calling error/1 merely because the user gave us the wrong input is
> undesirable behaviour.

As long as it isn't a pred that just happens to look like a special pred
- but I don't think we can generate them very easily so it isn't a
problem.

-- 
       Tyson Dowd           # 4.4: People keep saying the behavior is undefined,
                            # but I just tried it on an ANSI-conforming compiler
     trd at cs.mu.oz.au        # and got the results I expected.
http://www.cs.mu.oz.au/~trd # A: They were wrong. Flame them mercilessly. C-IAQ



More information about the developers mailing list