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: dennison@telepath.com Subject: Re: Naming of Tagged Types and Associated Packages Date: 1998/07/27 Message-ID: <6pi3n6$i1k$1@nnrp1.dejanews.com>#1/1 X-Deja-AN: 375309045 References: <6pfs36$8rh@lotho.delphi.com> Organization: Deja News - The Leader in Internet Discussion X-Article-Creation-Date: Mon Jul 27 14:43:49 1998 GMT Newsgroups: comp.lang.ada X-Http-User-Agent: Mozilla/4.0 (compatible; MSIE 4.0; Windows NT; Gateway2000) Date: 1998-07-27T00:00:00+00:00 List-Id: In article <6pfs36$8rh@lotho.delphi.com>, tmoran@bix.com wrote: > >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 I had need of dynamic dispatching in Ada 83 once. I had to write a big honking case statement that looked like this: case Command.First_Byte is when Command_1 => Command_1_Pkg.Do_It(Unchecked_Convert_To_Command_1_Type(Command)); . . . when Command_120 => Command_120_Pkg.Do_It(Unchecked_Convert_To_Command_120_Type(Command)); end case; I spent *weeks* writing that thing. But a tagged type would have made this 20 page routine a 1-liner! T.E.D. -----== Posted via Deja News, The Leader in Internet Discussion ==----- http://www.dejanews.com/rg_mkgrp.xp Create Your Own Free Member Forum