[mercury-users] inst declarations

Michael Day mikeday at bigpond.net.au
Mon Jun 24 11:13:12 AEST 2002


There is no requirement for inst declarations to refer to functors in the 
current scope, so this:

:- inst foo ---> x ; y ; z.

will always compile, regardless of whether there is some type with
functors x, y and z defined or not. This is very confusing.

I thought at first that I could combine insts as follows:

:- inst first ---> a ; b ; c.
:- inst second ---> first ; x ; y ; z.

equivalent to writing:

:- inst second ---> a ; b ; c ; x ; y ; z.

and the compiler did not complain, even though there was no 'first'
functor in scope at the time. Very misleading.

Michael

--------------------------------------------------------------------------
mercury-users mailing list
post:  mercury-users at cs.mu.oz.au
administrative address: owner-mercury-users at cs.mu.oz.au
unsubscribe: Address: mercury-users-request at cs.mu.oz.au Message: unsubscribe
subscribe:   Address: mercury-users-request at cs.mu.oz.au Message: subscribe
--------------------------------------------------------------------------



More information about the users mailing list