[mercury-users] abstract types.

Peter Schachte schachte at cs.mu.OZ.AU
Mon Jan 17 18:26:55 AEDT 2000


> How should I implement an abstract form of lr1item? I'd like the interface
> to be the same:
> 	:- type lr1item.	% abstract
> or
> 	:- type lr1item == int.
> 
> along with:
> 	:- func lr1item(prodNum, dot, symbol).
> 	:- mode (lr1item(in, in, in) = out) is det.
> 	:- mode (lr1item(out, out, out) = in) is det.
> 
> Or should I just make another type "encoded_lr1item" and use explicit
> conversions?

I'd hope the simple bidirectional function version would work, so I'd
suggest giving that a bash, and use explicity pack/unpack operations
as a last resort.

I'd be interested to hear how it goes.

-- 
Peter Schachte                     I love deadlines. I like the whooshing
mailto:schachte at cs.mu.OZ.AU        sound they make as they fly by.
http://www.cs.mu.oz.au/~schachte/      -- Douglas Adams 
PGP: finger schachte at 128.250.37.3  
--------------------------------------------------------------------------
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