From mboxrd@z Thu Jan 1 00:00:00 1970 X-Spam-Checker-Version: SpamAssassin 3.4.4 (2020-01-24) on polar.synack.me X-Spam-Level: X-Spam-Status: No, score=-1.3 required=5.0 tests=BAYES_00,INVALID_MSGID autolearn=no autolearn_force=no version=3.4.4 X-Google-Language: ENGLISH,ASCII-7-bit X-Google-Thread: 103376,f6d3086ecdb136e,start X-Google-Attributes: gid103376,public From: Anthony Jenkins Subject: Runtime object type determination/ runtime generic instantiation Date: 1997/11/06 Message-ID: <34626166.D12266B@mindspring.com>#1/1 X-Deja-AN: 287529631 X-Server-Date: 7 Nov 1997 00:32:51 GMT Organization: MindSpring Enterprises Newsgroups: comp.lang.ada Date: 1997-11-07T00:32:51+00:00 List-Id: I'm having to instantiate a generic package which can use any private type (equality/assignment methods defined) for a type specified in a file. e.g. the string "character" would be read from a file and I'd have to use my package instantiated for the type 'character'. If runtime generic instantiation were possible I could avoid instantiating the package for every single non-limited type there is, and if runtime object type determination were possible I was thinking I could determine how to handle the type in the package body at runtime (since strings I believe are non-limited and differ substantially from scalar non-limited types in their handling). The package I have to create is one for (un)directed graphs, where the vertices can represent numbers, characters or strings (I'm thinking more generically than these 3 types so I can possibly use it later) where the node value type is given in a file. Am I looking at this wrong? I'm seeing a huge (well, 3-clause) CASE statement (after instantiating each of 3 different graph packages) that calls whatever operations are available from the package using that type. Anyway, thanks in advance for any pointers. Anthony Jenkins http://www.auburn.edu/~jenkian abjenkins @ mindspring , com (Death to spammers) ------------- "God is as real as I am," the old man replied. My faith was restored, for I knew Santa would never lie.