Simon Marlow <[EMAIL PROTECTED]> wrote,
> > `touch' sounds very good to me. In fact, you might remember
> > that we had a discussion about basically the same issue a
> > while ago. (At the time when I lobbied for the inclusion of
> > `foreignObjToAddr'.)
>
> Yes I do vaguely remember. At the time I hadn't noticed that you could
> implement "touch" safely and efficiently as a null primop, though.
>
> > In fact, having `touch', we could get rid of the condition
> > impossed by the last bulleted item on the page
> >
> > http://haskell.cs.yale.edu/ghc/docs/latest/set/sec-primitive.html
> >
> > This condition basically requires the implicit introduction
> > of a `touch' by the compiler and so is redundant if we have
> > an explicit `touch'.
>
> Yes. I'm still slightly concerned that in this case the behaviour where the
> ForeignObj stays live across the call is normally what you want; requiring
> that an explicit touch be used is too fragile.
Hehe - just forbid passing ForeignObjs as parameters to
external functions. This would force everybody to use
foreignPtrToAddr, which again would make the need for touch
more obvious.
I guess, this proposal will draw some screams from various
sources and we have to life with the cruft *sigh*
At least, the compiler can implement the cruft via touch...
Cheers,
Manuel