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.8 required=5.0 tests=BAYES_00,INVALID_DATE, MSGID_SHORT autolearn=no autolearn_force=no version=3.4.4 Relay-Version: version B 2.10 5/3/83; site utzoo.UUCP Path: utzoo!utgpu!water!watnot!watmath!clyde!rutgers!ll-xn!cullvax!drw From: drw@cullvax.UUCP Newsgroups: comp.lang.ada Subject: single valued variables Message-ID: <1042@cullvax.UUCP> Date: Tue, 7-Apr-87 00:26:19 EST Article-I.D.: cullvax.1042 Posted: Tue Apr 7 00:26:19 1987 Date-Received: Thu, 9-Apr-87 00:49:00 EST Organization: Cullinet Software, Inc., Westwood, MA List-Id: "SVDSD::PETCHER@ti-eg.CSNET" writes: > I am not an Ada expert, so correct me if I'm wrong, but... > When one declares a variable range to be (true..true) is that not in itself a > contradiction? A variable that can have only one value is, by definition, not > a variable, but a constant. In that context, it seems a compiler should > create a constant, issue a diagnostic for any subsequent code that attempts to > change the constant, and generate no executeable code for same. I realize the > most likely place for a single-valued variable to occur would be in > instantiation of a generic, but if a generic so instantiated does not treat > single-valued variables as constants then the program is basically in error. I'm not well-versed in Ada, but methinks that such a variable is inherently different from a constant in that one can/should be able to assign to it--although there is only one value that can be assigned, so it doesn't do very much! Anything else leads to serious nonuniformity. Dale -- Dale Worley Cullinet Software UUCP: ...!seismo!harvard!mit-eddie!cullvax!drw ARPA: cullvax!drw@eddie.mit.edu Un*x (a generic name for a class of OS's) != Unix (AT&T's brand of such)