[m-rev.] Add `:- mutable' declaration to the language.

Julien Fischer juliensf at cs.mu.OZ.AU
Thu Sep 1 16:52:42 AEST 2005


On Thu, 1 Sep 2005, Ian MacLarty wrote:

> On 1 Sep 2005, at 16:24, Ralph Becket wrote:
>
> > Ian MacLarty, Thursday,  1 September 2005:
> >>
> >> I still think these should be supplied.
> >>
> >> If the pure versions are supplied then they can be used without having
> >> any knowledge of the impurity system (which can take a while to learn
> >> to use properly, especially if you are new to Mercury).
> >> With the pure versions there is no burden on the user to promise that
> >> they are pure and therefore no need to understand the impurity system.
> >> This would make the :-mutable declarations more generally accessible.
> >
> > We don't want `mutable' declarations to be generally accessible, for
> > they are an abomination in the sight of God.  Albeit sometimes
> > necessary.
> >
>
> They are only an abomination in the sight of God because God feels left
> out of the picture because he lives in the I/O state :-)
>
> Seriously, it would be useful for a Mercury interface to a foreign API
> to be able to store and retrieve Mercury structures from the I/O state
> without using io.{get,set}_globals (since then the user of the library
> can't use io.{get,set}_globals) and without requiring the user to pass
> around additional state.  :- mutable declarations are therefore
> generally useful and we should therefore provide a pure method to
> access them so that people can use them without having to understand
> impurity.
>

We could a `pure' attribute to the :- mutable declarations.  With
this attribute set the compiler would generate a, presmuably divine,
pairof access predicates.

Julien.
--------------------------------------------------------------------------
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