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,3bf50ede73cff892 X-Google-Attributes: gid103376,public From: mheaney@ni.net (Matthew Heaney) Subject: Re: Operators Questions Date: 1996/10/30 Message-ID: #1/1 X-Deja-AN: 193327634 references: <3275D478.5952@eurocontrol.fr> content-type: text/plain; charset=ISO-8859-1 organization: Estormza Software mime-version: 1.0 newsgroups: comp.lang.ada Date: 1996-10-30T00:00:00+00:00 List-Id: In article <3275D478.5952@eurocontrol.fr>, Richard Irvine wrote: Put this on my wish list for the next revision of the language: the ability to overload the membership operator "in". That way I can say generic type T is private; package Sets is type Set is private; function "in" (Left : T, Right : Set) return Boolean; ... end; package Integer_Sets is new Sets (Integer); subtype Integer_Set is Integer_Sets.Set; use Integer_Sets; The_Set : Integer_Set; begin ... if 4 in The_Set then ... I think that that's much hipper than if Is_Member_Of (The_Set, Item => 4) then ... But of course your mileage may vary. Language designers: any reason overloading of "in" is too difficult for inclusion in the language? Why can't you do this already? This exclusion of the ability to overload "in" seems rather odd and unexpected. -------------------------------------------------------------------- Matthew Heaney Software Development Consultant mheaney@ni.net (818) 985-1271