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-Thread: 103376,e55245590c829bef X-Google-NewGroupId: yes X-Google-Attributes: gida07f3367d7,domainid0,public,usenet X-Google-Language: ENGLISH,UTF8 Path: g2news2.google.com!news3.google.com!proxad.net!feeder1-2.proxad.net!newsfeed.straub-nv.de!eternal-september.org!feeder.eternal-september.org!.POSTED!not-for-mail From: Simon Wright Newsgroups: comp.lang.ada Subject: Re: Beginners question: Compound types, how-to? Date: Wed, 03 Nov 2010 21:27:26 +0000 Organization: A noiseless patient Spider Message-ID: References: <86wroy58ff.fsf@gareth.avalon.lan> <86pqup5xfy.fsf@gareth.avalon.lan> <86y69d3rec.fsf@gareth.avalon.lan> <4cd19583$0$6977$9b4e6d93@newsspool4.arcor-online.net> Mime-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit Injection-Info: mx03.eternal-september.org; posting-host="dFCm8HWntFqmDIilBLqEJQ"; logging-data="19838"; mail-complaints-to="abuse@eternal-september.org"; posting-account="U2FsdGVkX1/Rh6NgZ31k/WdPT+pA3+eMpfolUbRgy2g=" User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/23.2 (darwin) Cancel-Lock: sha1:1SOBxkW7XFynTnFb2EPsA1IS51E= sha1:2Q14tc/4CwWixyjoq87LExF6rGw= Xref: g2news2.google.com comp.lang.ada:16157 Date: 2010-11-03T21:27:26+00:00 List-Id: "Yannick Duchêne (Hibou57)" writes: > Sometime it is possible to get ride of _Type, but sometime it is not > always, and this is not predictable, and your design should cover the > “always” otherwise it will hold a bug. If you decide it for the user, > this is not good : premature decision. You cannot assert the user will > never define very generic instance of that type (and there are common, > see later [*]). I'm sorry, but I will _not_ write what I consider badly-crafted code simply so that someone who I don't know might find it easy to create an even nastier mess. I had a tongue-in-cheek rule of thumb about local variables: the name should be no longer than log2(scope in lines). So I would have no problem writing declare B : Buffer; begin -- one or two lines of code end; Of course even I would probably draw the line at calling the read buffer R and the write buffer W! entirely depends on the context.