[M3devel] Subclassing Wr.T

Randy Coleburn rcoleburn at scires.com
Wed Nov 11 01:40:47 CET 2009


Note that partial revelation is going on here, so you have to import the WrClass.i3 interface in your new formatted writer implementation to see the details.
 
You can't do multiple inheritance, so if you want to make a new type of writer that does the formatting you described earlier, you can do that, but then all other writer objects that want to build upon this new formatted writer will have to either be a subclass of the new formatted writer, or they will have to direct their output to the new formatted writer.  You can't cause existing writers that know nothing of your formatted writer to be a subclass of your formatted writer.  
 
In general, the way the writers are set up, you pass the writer as a parameter to all output functions.  So, you would have the following:  MyFormattedWriter.T is a subtype of Wr.T.  Then, it would be possible to pass an instantiation of your new formatted writer object to any procedure that expects a Wr.T.
 
There are a number of examples of this in the code base.
 
Does this explanation help?
 
Regards,
Randy Coleburn

>>> <hendrik at topoi.pooq.com> 11/10/2009 5:05 PM >>>
On Tue, Nov 10, 2009 at 01:32:54PM -0500, hendrik at topoi.pooq.com wrote:
> Am I missing something obvious, or am I going about this in completely 
> the wrong way.
> 

By the way, the comment in WrClass.i3 says:

: - Formatted writers, in which the client can mark the start and end 
: of logical objects and specify desirable places to break the objects 
: into lines.   Formatted writers are basic tools for building pretty 
: printers.  
: 
: It is beyond the scope of this paper to describe these classes in 
: detail. Instead we will describe the interfaces that allow you to 
: define new classes.

Do these Formatted writers, which were beyond the scope of the paper, 
actually exist?  And were they built using the described interfaces?

-- hendrik

CONFIDENTIALITY NOTICE:  This email and any attachments are intended solely for the use of the named recipient(s). This e-mail may contain confidential and/or proprietary information of Scientific Research Corporation.  If you are not a named recipient, you are prohibited from making any use of the information in the email and attachments.  If you believe you have received this email in error, please notify the sender immediately and permanently delete the email, any attachments, and all copies thereof from any drives or storage media and destroy any printouts of the email or attachments.

EXPORT COMPLIANCE NOTICE:  This email and any attachments may contain technical data subject to U.S export restrictions under the International Traffic in Arms Regulations (ITAR) or the Export Administration Regulations (EAR).  Export or transfer of this technical data and/or related information to any foreign person(s) or entity(ies), either within the U.S. or outside of the U.S., may require export authorization by the appropriate U.S. Government agency prior to export or transfer.  In addition, technical data may not be exported or transferred to certain countries or specified designated nationals identified by U.S. embargo controls without prior export authorization.  By accepting this email and any attachments, all recipients confirm that they understand and will comply with all applicable ITAR, EAR and embargo compliance requirements.

-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://m3lists.elegosoft.com/pipermail/m3devel/attachments/20091110/c85b0a48/attachment-0002.html>


More information about the M3devel mailing list