Path: utzoo!utgpu!water!watmath!clyde!att!osu-cis!tut.cis.ohio-state.edu!mailrus!cornell!batcomputer!itsgw!steinmetz!uunet!pdn!alan
From: alan@pdn.UUCP (Alan Lovejoy)
Newsgroups: comp.lang.modula2
Subject: Re: more about ORD and VAL
Message-ID: <3585@pdn.UUCP>
Date: 28 Jun 88 04:48:57 GMT
References: 
Reply-To: alan@pdn.UUCP (0000-Alan Lovejoy)
Organization: Paradyne Corporation, Largo, Florida
Lines: 30

In article  Info-Modula2 Distribution List  writes:
/On behalf of the BSI's Modula-2 Working Group, Don Ward and I have
/recently been considering the formal definition of Modula-2's
/standard procedures.  We propose that:
/
/(a)   ORD delivers a CARDINAL
/
/(b)   when n is of some whole-number-type, ORD(n) has the same
/>      numerical value as n, no matter what the type of n is provided
/>      that the numerical value of n belongs to the type CARDINAL
/
/(c)   when n is of some whole-number-type, ORD(n) leads to an
/>      exception if the numerical value of n is not a value of the
/>      type CARDINAL


Why not define ORD(aValueOfIntType) to be CARDINAL(aValueOfIntType)?
That is, a meaning-preserving coercion into type CARDINAL?  That way,
you could just get rid of ORD altogether!  Didn't the BSI/ISO committee
propose doing just that a while ago?  I seem to remember reading some
such proposal in Modus Quarterly.  

For ORD(-1) (that is, CARDINAL(-1)) that would mean an exception, since
there is no CARDINAL value that corresponds to -1 (by definition).

-- 
Alan Lovejoy; alan@pdn; 813-530-8241; Paradyne Corporation: Largo, Florida.
Disclaimer: Do not confuse my views with the official views of Paradyne
            Corporation (regardless of how confusing those views may be).
Motto: Never put off to run-time what you can do at compile-time!