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,8276b2994037cd71 X-Google-Attributes: gid103376,public From: Robert A Duff Subject: Re: disjoint ranges ? Date: 2000/10/17 Message-ID: #1/1 X-Deja-AN: 682453934 Sender: bobduff@world.std.com (Robert A Duff) References: <39E612C9.9BF98CD3@laas.fr> <8s59nu$ej4$1@news.huji.ac.il> <39E658A4.525AE881@acm.org> <39E6E890.3B13E7A9@laas.fr> <8s8iuk$q66$1@nnrp1.deja.com> <39EBB984.F2F8905F@ix.netcom.com> Organization: The World Public Access UNIX, Brookline, MA Newsgroups: comp.lang.ada Date: 2000-10-17T00:00:00+00:00 List-Id: Lao Xiao Hai writes: > So, making a feature more powerful might be something such as being > able to overload the "in" membership test. It might be in the abstract, but in the context of Ada, probably not. >... For some reason, this > operator is not really a first class operator in Ada. I have often > wondered about the rationale for that decision. What is the type of the right-hand side of "in" here: if X in Integer range 1..10 ... ? Ada has no way of describing that type. In order to make "in" a normal operator, we would need to invent a way to pass types as parameters, and talk about the type of a type (and subtypes). This is not entirely unreasonable in the abstract, but it would be an enormous change to Ada. Consider: type T is range 1..100; function "in"(X: T; Y: type-of-T?) return Boolean; Or maybe it should be T'in? Anyway, it raises all kinds of questions. What *is* the range of T (given that "in" changes it)? - Bob