- Hiding abstract methods

From: Douglas G. Danforth <"Douglas>
Date: Tue, 12 Jun 2007 17:52:28 -0700

----boundary-LibPST-iamunique-1459247259_-_-
Content-type: text/plain

Folks,

I have a conceptual problem on which I would like your advice.

I have an ABSTRACT type A and two concrete types C1 and
C2 which are extensions of A.

    TYPE
       A* = POINTER TO ABSTRACT RECORD END;
       C1* = POINTER TO RECORD(A) END;
       C2* = POINTER TO RECORD(A) END;

I would like to export A (as shown with the '*'') but within the
module M where A is defined I *do not want* to export its
methods. I want them to be completely hidden so that the user
of M only needs to create the instance Ci (and fill its fields (not shown))
and pass Ci to the module M in which the specific methods appropriate to Ci
are specified (but also not exported). Within M, procedures take 'a'
(an instance of A which is either C1 or C2) and operates on it without
knowledge of its concrete form. The methods of A are simply called
and the concrete forms of those methods as C1 or C2 are actually
run.

Unfortunately, it seems that this scheme of things is not possible in
BlackBox.
I am forced to export the methods of A and also the methods of C1 and
the methods of C2, greatly cluttering the interface to M when none of that
information will be used by the person operating with M. Only the existence
of A and the extensions C1 and C2 are needed.

Is there a clean way to hide all of these methods?

-Doug Danforth

--- BlackBox
--- send subject HELP or UNSUBSCRIBE to blackbox{([at]})nowhere.xy

----boundary-LibPST-iamunique-1459247259_-_-
Content-type: application/rtf
Content-transfer-encoding: base64
Content-Disposition: attachment; filename="rtf-body.rtf"

e1xydGYxXGFuc2lcYW5zaWNwZzEyNTJcZnJvbXRleHQgXGRlZmYwe1xmb250dGJsDQp7XGYwXGZz
d2lzcyBBcmlhbDt9DQp7XGYxXGZtb2Rlcm4gQ291cmllciBOZXc7fQ0Ke1xmMlxmbmlsXGZjaGFy
c2V0MiBTeW1ib2w7fQ0Ke1xmM1xmbW9kZXJuXGZjaGFyc2V0MCBDb3VyaWVyIE5ldzt9fQ0Ke1xj
b2xvcnRibFxyZWQwXGdyZWVuMFxibHVlMDtccmVkMFxncmVlbjBcYmx1ZTI1NTt9DQpcdWMxXHBh
cmRccGxhaW5cZGVmdGFiMzYwIFxmMFxmczIwIE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----boundary-LibPST-iamunique-1459247259_-_---
Received on Wed Jun 13 2007 - 02:52:28 UTC

This archive was generated by hypermail 2.3.0 : Thu Sep 26 2013 - 06:31:32 UTC