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,63a41ccea0fc803a X-Google-Attributes: gid103376,public From: tmoran@bix.com Subject: Re: Naming of Tagged Types and Associated Packages Date: 1998/07/26 Message-ID: <6pfs36$8rh@lotho.delphi.com>#1/1 X-Deja-AN: 375084698 Organization: Delphi Internet Services Newsgroups: comp.lang.ada Date: 1998-07-26T00:00:00+00:00 List-Id: >The addition of tagged types in Ada 95 is good, but it doesn't change >implementation techniques that much from Ada 83, because you should >already be using type-based abstractions where that makes sense. There are some things Ada 95 lets you do that were *extremely* inconvenient, in Ada 83. Controlled types, which let a task execute code after an "or terminate" select alternative, and "access T'Class" which lets you link heterogenous data simply, come to mind. For a slightly more complex example, a system I'm working on has a library-level task and task safety (and the OS, in this case) requires that certain things only be done by that task. Occasionaly, we've needed to add a new operation. At first we added a new 'entry' and recompiled the world. Then we realized that there can be one entry that takes a classwide parameter and calls a standard "Do_Whatever" procedure, passing that parameter. Now a new operation merely requires a new descendant of the (abstract) root type with appropriate information in the new extension part, and an overriding "Do_Whatever" that will be run from the correct task. No spec changes to the task and thus no recompilation. Tagged types are a new tool. There's no requirement to limit their use to what the designers, or OO philosophy, intended.