[m-dev.] For review: Add implementation of reference types (global heap)
Peter Schachte
pets at students.cs.mu.OZ.AU
Tue Jun 9 14:59:18 AEST 1998
On Tue, 9 Jun 1998, Fergus Henderson wrote:
> On 09-Jun-1998, Warwick Harvey <wharvey at cs.monash.edu.au> wrote:
> > > In other parts of the Mercury library/extras, the convention has
> > > been to use `foo.m' for the non-trailed version and `tr_foo.m'
> > > for the trailed version.
> > But they're not quite the same thing are they?
>
> Now that you point it out, no, they are not quite the same.
>
> The implementations are pretty similar (trailed and non-trailed versions),
> but the interfaces are different.
Actually, the interfaces are pretty much identical. It's only the behavior
that's different.
> I still think there's a fairly strong analogy between
> nb_reference/reference and store/tr_store.
I don't see it. In the store case the semantics of the operations are the
same, it's just that one version implements the semantics for more cases
(modes) than the other. Both references and nb_references implement all of
their semantics, but their (operational) semantics are totally different.
Another way to look at it is that *in principle* store and tr_store could
(and I would argue, should) be the same type or type class, with the Mercury
compiler choosing the right implementation based on usage. But it would
never make sense to merge reference and nb_reference into a single type or
type class.
> > > Our standard naming convention for type names in C is to use
> > > "MixedCaseIdentifiers".
Pity. I find MixedCaseIdentifiers only marginally easier to read than
runtogetheridentifiers, and much less readable than
underscore_divided_identifiers.
-Peter Schachte | Yesterday upon the stair I met a man who
mailto:pets at cs.mu.OZ.AU | wasn't there. He wasn't there again today
http://www.cs.mu.oz.au/~pets/ | -- I think he's from the CIA.
PGP: finger pets at 128.250.37.3 |
More information about the developers
mailing list