Article View: comp.lang.modula2
Article #4298Re: more about ORD and VAL
From: Alan Lovejoy
Date: Tue, 28 Jun 1988 04:48
Date: Tue, 28 Jun 1988 04:48
30 lines
1922 bytes
1922 bytes
In article <INFO-M2%88062707565110@UCF1VM> Info-Modula2 Distribution List <INFO-M2%UCF1VM.bitnet@jade.berkeley.edu> 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!
Technical Details
Message-ID:
<3585@pdn.UUCP>Path:
arc1-ca.pugleaf.net!utzoo!utgpu!water!watmath!clyde!att!osu-cis!tut.cis.ohio-state.edu!mailrus!cornell!batcomputer!itsgw!steinmetz!uunet!pdn!alanReferences:
<INFO-M2%88062707565110@UCF1VM>Show Full Headers
Complete Article Headers
Path: arc1-ca.pugleaf.net!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: <INFO-M2%88062707565110@UCF1VM> Reply-To: alan@pdn.UUCP (0000-Alan Lovejoy) Organization: Paradyne Corporation, Largo, Florida Lines: 30