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,5bf8956c0cb122ed,start X-Google-Attributes: gid103376,public From: tmoran@bix.com Subject: How best to: Date: 1996/03/22 Message-ID: <4issd2$47p@news2.delphi.com>#1/1 X-Deja-AN: 143663025 organization: Delphi Internet Services Corporation newsgroups: comp.lang.ada Date: 1996-03-22T00:00:00+00:00 List-Id: In a 'cardboard thin' Ada 83 - MS Windows binding, there are a set of window style constants which can be ORed before being passed to the API. To reduce errors through a modicum of type checking, I'm declaring type Window_Styles is private; type Button_Control_Styles is private; type Static_Control_Styles is private; type Listbox_Styles is private; ... function "+"(left:Window_Styles ; right:Window_Styles ) return Window_Styles ; function "+"(left:Button_Control_Styles; right:Button_Control_Styles) return Button_Control_Styles; function "+"(left:Static_Control_Styles; right:Static_Control_Styles) return Static_Control_Styles; function "+"(left:Listbox_Styles ; right:Listbox_Styles ) return Listbox_Styles ; etc. to allow mixing general Windows_Styles with specific ones, but not allow, eg, Button_Control_Styles to be "+" with Listbox_Styles. When all is said and done, I wind up with nearly 500 lines. Is there a simpler way? 2) The package includes a set of functions of the form function ">="(left:Listbox_Styles; right:Window_Styles) return boolean; to allow checking if a combined style contains a particular style (eg, if this_style >= WS_BORDER then ...). Is the use of ">=" for "includes" likely to be confusing or cause problems?