From bobduff@dsd.camb.inmet.com Tue Sep 6 07:41:15 1994 Return-Path: Received: from inmet.camb.inmet.com by dsd.camb.inmet.com (4.1/SMI-4.1) id AA16406; Tue, 6 Sep 94 07:41:15 EDT Received: from dsd.camb.inmet.com by inmet.camb.inmet.com (4.1/SMI-4.1) id AA15869; Tue, 6 Sep 94 07:41:14 EDT Received: by dsd.camb.inmet.com (4.1/SMI-4.1) id AA16401; Tue, 6 Sep 94 07:41:00 EDT Date: Tue, 6 Sep 94 07:41:00 EDT From: bobduff@dsd.camb.inmet.com (Bob Duff) Message-Id: <9409061141.AA16401@dsd.camb.inmet.com> To: bertier@alsys.fr Cc: ada9x-mrt@inmet.com Subject: Re: universal_integer/root_integer runtime arithmetic !topic universal_integer/root_integer runtime arithmetic !reference RM9X-3.5.4;5.0 !reference 94-4676.a Antoine Bertier !reference 94-4681.a Bob Duff !from Bob Duff <> !discussion Antoine wrote: >> For instance, if you have: >> >> type Largest_Unsigned is mod 2 * System.Max_Int + 2; >> >> type Largest_Integer is range System.Min_Int .. System.Max_Int; >> >> what happens on >> >> abs(Largest_Unsigned'Pos(Largest_Unsigned'Last)) >> >> Largest_Unsigned'Pos(Largest_Unsigned'Last) - 1 >> >> Largest_Integer'Pos(Largest_Integer'First) + >> Largest_Unsigned'Pos(Largest_Unsigned'Last) >> >> Largest_Unsigned'Pos(Largest_Unsigned'Last) - >> Largest_Integer'Pos(Largest_Integer'First) >> >> when shall or should or can Constraint_Error be raised ? And I wrote: >The above are all static, so C_E is not raised. What if they weren't static (which is possible, but unusual)? A nonstatic expression of type universal_integer or root_integer *can* raise C_E if it is outside the range System.Min_Int..System.Max_Int. If it doesn't raise C_E, then the right answer is calculated. In general, a nonstatic expression of type T can raise C_E if it's outside the base range of T. Note also that a static expression in a nonstatic context is illegal if it raises an exception, or is outside the base range of the expected type. - Bob From ledgerj@ajpo.sei.cmu.edu Tue Sep 6 18:17:57 1994 Return-Path: Received: from inmet.camb.inmet.com by dsd.camb.inmet.com (4.1/SMI-4.1) id AA17281; Tue, 6 Sep 94 18:17:57 EDT Received: from ajpo.sei.cmu.edu by inmet.camb.inmet.com (4.1/SMI-4.1) id AA08074; Tue, 6 Sep 94 18:17:52 EDT Received: from localhost.sei.cmu.edu by ajpo.sei.cmu.edu (4.1/2.5) id AA08307; Tue, 6 Sep 94 18:19:57 EDT Message-Id: <9409062219.AA08307@ajpo.sei.cmu.edu> To: ada9x-mrt@inmet.com Cc: ledgerj@AJPO.SEI.CMU.EDU Subject: Possible miswording in 3.10.2(27);5.0 (P'Access) Date: Tue, 06 Sep 94 18:19:56 EDT From: ledgerj@ajpo.sei.cmu.edu !topic Miswording in rule? ('Access for subprograms) !reference RM9X-3.10.2(27);5.0 !from Jim Ledger 94-09-06 <> !discussion RM 3.10.2(27)/6;5.0 says, for P'Access: If the subprogram denoted by P is declared within a generic unit, S shall be declared within the generic unit. ^^^^ Should the indicated occurrence of "unit" actually be "body?" This appears to be what was intended, given the wording of AARM 3.10.2(27a);5.0, and would be consistent with RM 4.6(20)/3;5.0. Jim Ledger ACVC Team