[m-rev.] [reuse] diff: no aliases between primitive types

Nancy Mazur Nancy.Mazur at cs.kuleuven.ac.be
Fri Mar 30 18:10:16 AEST 2001


> On 30-Mar-2001, Peter Ross <peter.ross at miscrit.be> wrote:
> > I have been thinking about this, I think that for the MLDS backend we
> > are safe.  However for the LLDS backend, we aren't.
> 
> Even for the MLDS back-end, where float arguments are passed unboxed,
> there might be problems because floats in structures are boxed:
> 
> 	:- type foo ---> f(float, float).
> 	:- pred nasty(foo::di, foo::uo) is det.
> 	:- pragma c_code(nasty(X::di, Y::uo), "...").
> 
> where the "..." is some code relying on the representation of `foo',
> which destructively updates the memory used for `X'...

Isn't that dangerous anyway? Defining a type declaratively, and
then `relying' on the representation it will have internally? 
Seems yuk to me. Does this happen often? 

Nancy

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