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,83d7c4caadb45100 X-Google-Attributes: gid103376,public From: dewar@cs.nyu.edu (Robert Dewar) Subject: Re: DECAda/VMS - calling GETJPI Date: 1996/06/05 Message-ID: #1/1 X-Deja-AN: 158644840 references: <31B2AF74.668E@dial.eunet.ch> <4p1v56$214@linus.mitre.org> organization: Courant Institute of Mathematical Sciences newsgroups: comp.lang.ada Date: 1996-06-05T00:00:00+00:00 List-Id: The basic idea here is that type conversion converts the type, but not the value, of course floating-point to int already violates this somewhat as Bob points out, but not quite as dramatically. Consider the following example: type x is mod 10; subtype y is x range 0 .. 5; vy : y; vy := y (-4) -- raises constraint error vy := y (-6) -- ok, gives result of 4 At the meeting we accumulated a series of odd examples of this kind, and decided that it is just a bit too weird to have type conversion generating what amounts to a significant arithmetic computation. P.S. in my comments in the example above, I am assuming for the moment the old semantics. In current Ada 95, BOTH assigments to vy raise constraint error, since -1 is not in the range 0 .. 5. Actually to be strict, the constraint error is raised by the conversion because -1 is not in the set of values for modular type x (0 .. 10).