[m-dev.] purity of `:- pragma foreign_proc'

Tyson Dowd trd at cs.mu.OZ.AU
Wed Oct 31 16:36:10 AEDT 2001


On 31-Oct-2001, Simon Taylor <stayl at cs.mu.OZ.AU> wrote:
> 
> Before the `:- pragma foreign_proc' syntax becomes widely
> used, we should decide what the default purity for foreign
> procedures should be. If we are going to make people change
> their `:- pragma c_code' declarations to `:- pragma foreign_proc',
> we should make any purity annotation changes happen at the same time.
> 
> At the moment, predicates defined using `:- pragma foreign_proc'
> are `pure' by default, but predicates defined using mode-specific
> clauses are `impure' by default, even though `:- pragma foreign_proc'
> can implement a strict superset of the `impure' behaviour that can be
> implemented using mode-specific clauses.

I started making this change some time ago -- foreign_proc will be
impure by default.

It's best done as a three step change -- first you have to accept
pure/semipure/impure as an attribute on the foreign_proc, then you have
to mark almost everything in the library as pure, then you have to make
the default impure.  But I got distracted at some point and never
completed the diff.  

I will work on it today and try to get stage 1 done.

-- 
       Tyson Dowd           # 
                            #  Surreal humour isn't everyone's cup of fur.
     trd at cs.mu.oz.au        # 
http://www.cs.mu.oz.au/~trd #
--------------------------------------------------------------------------
mercury-developers mailing list
Post messages to:       mercury-developers at cs.mu.oz.au
Administrative Queries: owner-mercury-developers at cs.mu.oz.au
Subscriptions:          mercury-developers-request at cs.mu.oz.au
--------------------------------------------------------------------------



More information about the developers mailing list