Re: Unlimited polymorphic pointers



Rich Townsend <rhdt@xxxxxxxxxxxxxxxxxxx> wrote:

Richard Maine wrote:
Rich Townsend <rhdt@xxxxxxxxxxxxxxxxxxx> wrote:
[about making generic lists]

But, now that F2003 is upon us, what about unlimited polymorphic
pointers?

Either that or an extensible type should work fine. This is one of the
classic examples of the kind of thing that type extension (one of the
main new object-oriented features) works well for.


By "either that", you mean intrinsic types, right?

No. I mean either unlimitted polymorphic pointers or extensible types.
Make a list type (that has no data component at all). Then extend that
to add data components of whatever type you want. The are lots of
examples of that around. It's almost the first example in any text of
how to use type extension.

Oh, and does one require a select type statement to convert the UPP to a
pointer of the correct type?

Yes,if I recall correctly, though I obviously haven't done a lot of that
kind of thing.

How exactly does this work? Are you asking about the syntax or the
underlying mechanisms? I don't recall enough of the details of the
underlying mechanisms to be a good person to explain them.

--
Richard Maine | Good judgement comes from experience;
email: last name at domain . net | experience comes from bad judgement.
domain: summertriangle | -- Mark Twain
.