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.2 required=5.0 tests=BAYES_00,INVALID_MSGID, PLING_QUERY autolearn=no autolearn_force=no version=3.4.4 X-Google-Language: ENGLISH,ASCII-7-bit X-Google-Thread: 103376,e0afec3ed133afd9 X-Google-Attributes: gid103376,public From: "Nick Roberts" Subject: Re: Enumerations and Arrays Unnecessary!??? Date: 1997/06/18 Message-ID: <01bc7b84$5fa9e300$LocalHost@xhv46.dial.pipex.com>#1/1 X-Deja-AN: 249199296 References: <33A16AC0.1BA4@calvin.cca.rockwell.com> Organization: UUNet UK server (post doesn't reflect views of UUNet UK) Newsgroups: comp.lang.ada Date: 1997-06-18T00:00:00+00:00 List-Id: Robert Dewar wrote in article ... > YOu mean that you don't see that Character is obviously a class, and > specific characters like 'C' '+' '+' are simply objects of that class > to which messages should be sent as required. Conceptually, this is a perfectly reasonable idea. But imagine implementing characters this way in Ada (where each character would be a tagged type). Uh oh! Better still, imagine (as we are not allowed arrays either) implementing strings as linked lists (or whatever) of these tagged types. [Of course, this is roughly how languages such as (traditional) Prolog _do_ implement strings!] Class CHARACTER would have obvious subclasses, such as LETTER and DIGIT, with their own specialised constants and methods (such as FIRST, LAST, NEXT, and VALUE). This approach is really not so silly, if it could be implemented efficiently (in a language other than Ada). I think this is an interesting question: could it be implemented efficiently? In my ignorance, how does Smalltalk implement characters? And other O. O. languages? Nick.