<HTML><FONT FACE=arial,helvetica><FONT SIZE=4 FAMILY="SERIF" FACE="Times New Roman" LANG="0">Thanks to both Ferguson and Mark for answering my questions!!! Quite helpful
<BR>in getting me past the rut I was stuck in.
<BR>
<BR>>>When compiling multi-module programs, it can be difficult
<BR>>>to manually figure out which interface files need to be generated, so we
<BR>>>recommend you use mmake to do it automatically. E.g.:
<BR>>> mmake main_module.depend
<BR>>> mmake main_module
<BR>
<BR>Don't you just hate users that ignore the documentation. I had been using
<BR>mmake a while back but when I ran into trouble I started using MMC (not that
<BR>it helped). For some reason, I never went back to the recommended method.
<BR>Works without a hitch using mmake.
<BR>
<BR>>>It sounds like you want abstract typeclass instances. In the interface
<BR>>>section, mention the type and instance but don't give any definition,
<BR>>>like so:
<BR>>> :- type circleRecord.
<BR>>> :- instance shapeClass(circleRecord).
<BR>>> :- instance circleClass(circleRecord).
<BR>
<BR>Ok. Makes sense. Works as I expect it to now. Just overlooked the manner
<BR>of declaring abstract types and it's relation with what I was trying to
<BR>accomplish.
<BR>
<BR>>>I think it is because you have not given a mode for method draw/3 in the
<BR>>>typeclass declaration in shape.m. You should try adding the line
<BR>>> mode draw(in, di, uo) is det,
<BR>
<BR>That was the part I was trying to figure out. I couldn't figure out how to
<BR>get the mode declared, and didn't think to put both the predicate and mode
<BR>within the typeclass definition. Works like a charm when you declare the
<BR>mode. I end up with typeclasses that look like:
<BR>
<BR>:- typeclass shapeClass(This) where [
<BR> func getX(This) = int,
<BR> mode getX(in) = out is det,
<BR>
<BR> ..... cut .....
<BR>
<BR> pred draw(This, io__state, io__state),
<BR> mode draw(in, di, uo) is det
<BR>].
<BR>
<BR>+++++++++
<BR>
<BR>Ok. I'm good to go with the problems I had. One additional question I have
<BR>concerns the write accessors. In my example, the read accessors work fine in
<BR>the form of:
<BR>
<BR> getX_Circle(This) = This^x.
<BR>
<BR>I gather also that there is a write form of the accessor using the ':=' for
<BR>the assignment but I can't figure out how to use it. Currently I'm writing
<BR>it as:
<BR>
<BR> setX_Circle(circleRecord(_,Y,Radius), X) = circleRecord(X, Y, Radius).
<BR>
<BR>which spins off a new record based on the values in the input record.
<BR>Anyhow, is there a way to use the set accessor to make this shorter, if not
<BR>more efficient?
<BR>
<BR>Thanks.
<BR>
<BR>
<BR></FONT></HTML>