[m-rev.] support `mmake install' in extras directory

Tyson Dowd trd at cs.mu.OZ.AU
Thu Mar 7 13:47:23 AEDT 2002


On 06-Mar-2002, Fergus Henderson <fjh at cs.mu.OZ.AU> wrote:
> extras/curs/curs.m:
> 	Add `promise_pure' declarations for all pure procedures.
> 	XXX Should this be needed?  These predicates all take
> 	io__state arguments.

I'm not sure what you mean here.

The fact that a particular predicate takes IO state arguments
doesn't necessarily mean it is pure.

There may be another predicate in the same module (or a different
module) that does not take IO states, which does something impure
and modifies the declarative semantics of the first:

e.g. consider:
:- pragma foreign_proc("C", rows_cols(Rows::out, Cols::out, IO0::di,
		IO::uo),

:- pragma foreign_proc("C", move(Row::in, Col::in),

rows_cols doesn't seem very pure in this case.  It should be unaffected
by the invocation of move (they don't share the IO state, do they),
but it's not.

It's pretty hard for the compiler to be sure that *all* the
foreign_procs have IO states, and this is a non-local analysis anyway
and we shouldn't decide on semnatic issues like purity based on
non-local analysis.


Tyson.
--------------------------------------------------------------------------
mercury-reviews mailing list
post:  mercury-reviews at cs.mu.oz.au
administrative address: owner-mercury-reviews at cs.mu.oz.au
unsubscribe: Address: mercury-reviews-request at cs.mu.oz.au Message: unsubscribe
subscribe:   Address: mercury-reviews-request at cs.mu.oz.au Message: subscribe
--------------------------------------------------------------------------



More information about the reviews mailing list