Re: [BLACKBOX] Polymorphism

From: Douglas G. Danforth <"Douglas>
Date: Thu, 20 Nov 2008 21:03:50 -0800

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

Aubrey,

How about having a list of ABSTRACT objects with the ABSTRACT class
having an
ABSTRACT method Do? Then each different extension of the class can
implement its
Do method anyway it wants. Hence the list can be heterogeneous.

-Doug


Aubrey.McIntosh{([at]})nowhere.xy
> In writing my List module, I have a method DoEach that walks the list,
> and applies method Do to each element.
>
> (this: List) Do (VAR params: ANYREC), NEW, EMPTY;
> (root: List) DoEach (VAR params: ANYREC), NEW;
>
> In moving some existing software to the new library module, it turns
> out that I wish to apply a few different procedures to the list. In
> trying to avoid procedure variables, I find I am drawing a blank.
> Making several lateral extensions to the base record may be an
> approach, particularly if there is a pointer to a record with that
> particular implementation as one of the fields in params. I will
> alternate between envisioning some structure to do this and Goggling
> for the next while. A brief search of "Component Pascal Polymorphism"
> seems more or less on target and enough reading to fill a night.
>
> I thought I saw some message about this under the general heading of
> polymorphism on this list some years ago. If anyone remembers this,
> or can point to a file either in the distribution or online I'd focus
> my thoughts there fairly early on.
>
>
>


----
To unsubscribe, send a message with body "SIGNOFF BLACKBOX" to LISTSERV{([at]})nowhere.xy----boundary-LibPST-iamunique-1158184286_-_-
Content-type: application/rtf
Content-transfer-encoding: base64
Content-Disposition: attachment; filename="rtf-body.rtf"
e1xydGYxXGFuc2lcYW5zaWNwZzEyNTJcZnJvbXRleHQgXGRlZmYwe1xmb250dGJsDQp7XGYwXGZz
d2lzcyBBcmlhbDt9DQp7XGYxXGZtb2Rlcm4gQ291cmllciBOZXc7fQ0Ke1xmMlxmbmlsXGZjaGFy
c2V0MiBTeW1ib2w7fQ0Ke1xmM1xmbW9kZXJuXGZjaGFyc2V0MCBDb3VyaWVyIE5ldzt9fQ0Ke1xj
b2xvcnRibFxyZWQwXGdyZWVuMFxibHVlMDtccmVkMFxncmVlbjBcYmx1ZTI1NTt9DQpcdWMxXHBh
cmRccGxhaW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ZSBmYWlybHkgZWFybHkgb24uXHBh
cg0KPlxwYXINCj5ccGFyDQo+ICAgXHBhcg0KXHBhcg0KXHBhcg0KLS0tLVxwYXINClRvIHVuc3Vi
c2NyaWJlLCBzZW5kIGEgbWVzc2FnZSB3aXRoIGJvZHkgIlNJR05PRkYgQkxBQ0tCT1giIHRvIExJ
U1RTRVJWQExJU1RTLk9CRVJPTi5DSH19AAA1AAA=
----boundary-LibPST-iamunique-1158184286_-_---
Received on Fri Nov 21 2008 - 06:03:50 UTC

This archive was generated by hypermail 2.3.0 : Thu Sep 26 2013 - 06:30:51 UTC