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=-0.3 required=5.0 tests=BAYES_00, REPLYTO_WITHOUT_TO_CC autolearn=no autolearn_force=no version=3.4.4 X-Google-Thread: 103376,e4042699db4db63b X-Google-Attributes: gid103376,domainid0,public,usenet X-Google-Language: ENGLISH,ASCII Path: g2news1.google.com!news3.google.com!proxad.net!feeder1-2.proxad.net!newsfeed.straub-nv.de!news-1.dfn.de!news.uni-weimar.de!not-for-mail From: stefan-lucks@see-the.signature Newsgroups: comp.lang.ada Subject: Re: Newbie question Date: Thu, 12 Mar 2009 18:14:08 +0100 Organization: Bauhaus-Universitaet Weimar Message-ID: References: <49b90e2d$0$2847$ba620e4c@news.skynet.be> <0ff2f139-06cf-4fa5-8c0d-f97c43a33186@s20g2000yqh.googlegroups.com> <49b9193a$0$2854$ba620e4c@news.skynet.be> Reply-To: stefan-lucks@see-the.signature NNTP-Posting-Host: medsec1.medien.uni-weimar.de Mime-Version: 1.0 Content-Type: MULTIPART/MIXED; BOUNDARY="8323584-1252853929-1236878048=:24666" X-Trace: tigger.scc.uni-weimar.de 1236877735 6665 141.54.178.228 (12 Mar 2009 17:08:55 GMT) X-Complaints-To: news@tigger.scc.uni-weimar.de NNTP-Posting-Date: Thu, 12 Mar 2009 17:08:55 +0000 (UTC) X-X-Sender: lucks@medsec1.medien.uni-weimar.de In-Reply-To: Xref: g2news1.google.com comp.lang.ada:4081 Date: 2009-03-12T18:14:08+01:00 List-Id: This message is in MIME format. The first part should be readable text, while the remaining parts are likely unreadable without MIME-aware tools. --8323584-1252853929-1236878048=:24666 Content-Type: TEXT/PLAIN; charset=ISO-8859-1 Content-Transfer-Encoding: 8BIT > > type Piece_T(Color: Color_T) is > > � record > > � � case Color is > > � � � when White => > > � � � � White_Piece: Piece_Type_T; > > � � � when Black => > > � � � � Black_Piece: Piece_Type_T; > > � � � when None => > > � � � � null; > > � � end case; > > � end record; > > The problem with this is that you'd then need two code paths for > Black_Piece and White_Piece, every time. Right. Actually, I anticipated that you would *want* two code paths for the black and for the white pieces. Else, your approach the approach below is better. > To overcome this, here is solution 2a1: > type Square_T (Color : Color_T := None) is record > case Color is > when None => null; > when Black | White => Piece_Type : Piece_Type_T; > end case; > end record; -- ------ Stefan Lucks -- Bauhaus-University Weimar -- Germany ------ Stefan dot Lucks at uni minus weimar dot de ------ I love the taste of Cryptanalysis in the morning! ------ --8323584-1252853929-1236878048=:24666--