[m-rev.] for review: automatically generate all type_ctor_infos on non C backends

Fergus Henderson fjh at cs.mu.OZ.AU
Fri Nov 21 04:49:30 AEDT 2003


On 20-Nov-2003, Peter Ross <pro at missioncriticalit.com> wrote:
> On Thu, Nov 20, 2003 at 10:38:07PM +1100, Simon Taylor wrote:
> > Would making `ticket' a foreign type rather than an equivalence remove
> > some of the special casing?
>
> The snipped code that you deleted fixes the problem.
> 
> However the best solution in the long run would be to make everything
> builtin a foreign_type.  This would require adding a new annotation to
> the foreign_type which declared that there was only one representation
> for equal types to avoid the problems mentioned in the User Manual
> <http://tinyurl.com/vte6>.

Why?  What problem?  

Are you referring to these ones I've quoted below?
For a foreign type, those should not be a problem,
since there is no way to deconstruct a foreign type,
and trying to examine the representation of a foriegn
type using argument/3 and functor/3 _should_ raise an
exception, regardless of the determinism.

 | - If the program contains any deconstruction unification or switch on a
 |   variable of type T that could fail, other than unifications with mode
 |   `(in, in)', then it is a compile-time error.
 | 
 | - If the program contains any deconstruction unification or switch on
 |   a variable of type T that cannot fail, then that operation has determinism
 |   `cc_multi'.
 | 
 | - Any attempts to examine the representation of a variable of type T using
 |   facilities of the standard library (e.g. `argument'/3 and `functor/3'
 |   in `std_util') that do not have determinism `cc_multi' or `cc_nondet'
 |   will result in a run-time error.

-- 
Fergus Henderson <fjh at cs.mu.oz.au>  |  "I have always known that the pursuit
The University of Melbourne         |  of excellence is a lethal habit"
WWW: <http://www.cs.mu.oz.au/~fjh>  |     -- the last words of T. S. Garp.
--------------------------------------------------------------------------
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