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

Peter Ross pro at missioncriticalit.com
Fri Nov 21 06:13:24 AEDT 2003


On Fri, Nov 21, 2003 at 04:49:30AM +1100, Fergus Henderson wrote:
> 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.
>  | 

    ( X = 0 ->
        ...
    ;
        ...
    )

I get a compiler error on the line "X = 0" when I define int as foreign
type.  I thought it was due to the line above but I think I have misread
it.
-- 
Peter Ross		
Software Engineer                                (Work)   +32 2 757 10 15
Mission Critical                                 (Mobile) +32 485 482 559
--------------------------------------------------------------------------
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