Compatibility

Tyson Richard DOWD trd at students.cs.mu.oz.au
Thu Feb 27 10:32:07 AEDT 1997


[moved into mercury-developers]

> I'd also like to suggest a couple of changes to be compatible with Prolog. 
> I'm not arguing for gratuitous compatibility; where Prolog did it wrong,
> Mercury should do it right.  But I would argue against gratuitous
> incompatibility.  I know of two small changes that improve compatibility
> with no loss to Mercury.
> 
> Firstly, I think arg/3 should be:
> 
> 	:- pred arg(int::in, univ::in, univ::out).

You mean 
		arg(int::in, T::in, univ::out).
otherwise you need to convert types to univ before using arg.

> 
> Or, as Prologgers would say
> 
> % arg(+ArgNum, +Term, -Arg).
>

I have no objections to this (and I'm happy to make the change).

> The second suggestion is to rename io:write/3 as io:display/3.  The reason
> is that io:write doesn't seem to pay attention to operators or support
> list notation.  This is the behavior of display/1 in standard Prolog,

This is also a good idea.

> whereas write/1 does use list notation and support operators.  It would
> also be nice to have a real io:write/3 that handles these, but I don't
> know if that's possible.

Probably writing a type_to_term predicate (not hard) and using 
term_io:write_term would do this properly. But we would need a
little more information first - some of what we need is being worked
on already.

-- 
       Tyson Dowd           # Eddie:  What's this!?
                            # Richie: Elm tea. The gypsies *swear* by it.
     trd at cs.mu.oz.au        # Eddie:  I bet they do--I bet they say, 
http://www.cs.mu.oz.au/~trd #          'What the bloody hell is this?'



More information about the developers mailing list