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.9 required=5.0 tests=BAYES_00 autolearn=ham autolearn_force=no version=3.4.4 X-Google-Language: ENGLISH,ASCII-7-bit X-Google-Thread: 103376,ab66185f2bca0483 X-Google-Attributes: gid103376,public X-Google-ArrivalTime: 2002-11-15 13:27:11 PST Newsgroups: comp.lang.ada Path: archiver1.google.com!news1.google.com!newsfeed.stanford.edu!canoe.uoregon.edu!logbridge.uoregon.edu!nntp4.savvis.net!uunet!dfw.uu.net!ash.uu.net!world!news From: Robert A Duff Subject: Re: Extension of non-limited type needs limited component User-Agent: Gnus/5.09 (Gnus v5.9.0) Emacs/21.2 Sender: news@world.std.com (Mr Usenet Himself) Message-ID: Date: Fri, 15 Nov 2002 21:26:15 GMT Content-Type: text/plain; charset=us-ascii References: NNTP-Posting-Host: shell01.theworld.com Mime-Version: 1.0 Organization: The World Public Access UNIX, Brookline, MA Xref: archiver1.google.com comp.lang.ada:30959 Date: 2002-11-15T21:26:15+00:00 List-Id: "Jean-Pierre Rosen" writes: > The benefit, and drawback, of tagged types is that they allow dynamic > typing, therefore requiring (isn't it surprising) dynamic checking. More > flexibility, less security. If you want full compile-time checking, don't > use tagged types. Well, it's not quite that bad. Dmitry Kazakov posted the example of a procedure with 2 controlling operands. Yes, that requires a tag check. Downward conversions require a tag check. But normal dispatching on a single controlling operand (which is by far the most common case) requires no run-time check. So, for most of your code, you can freely use tagged and class-wide types, and *still* get full compile-time checking. That's the advantage of Ada (and C++ and Java) over Smalltalk (and CLOS and ...). In other words, "...don't use tagged types" is too strong. > At least in Ada, you have a choice! Yes. - Bob