🚀 go-pugleaf

RetroBBS NetNews Server

Inspired by RockSolid Light RIP Retro Guy

Article View: comp.lang.modula2
Article #4303

Re: more about ORD and VAL

#4303
From: Robert Nagler
Date: Thu, 30 Jun 1988 08:11
20 lines
1501 bytes
    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!

Pardon me, but what does the term "meaning-preserving coercion" denote?
As far as I understand type coercions in other languages, I believe the
current semantics are "meaning-preserving", that is, they preserve the
meaning of the memory and that is all.  You cannot get rid of ORD, because
it returns the "ordinal" value in terms of a type CARDINAL.  The type
conversion CARDINAL merely subverts the type checking mechanism.  I know
that I am a bad boy, but sometimes I need to do things like:
        bitset := BITSET( CARDINAL( bitset ) DIV 100H );
This is quite a useful operation in certain types of system programming.

Rob

PS. I've been wondering what would happen if all this talk about
    designing Modula-2-rev-Q were translated into energy which could
    be used to develop a portable public domain language environment.
Technical Details
Message-ID: <8806300811.AA00246@klaus.olsen.uucp>
Path: arc1-ca.pugleaf.net!utzoo!attcan!uunet!husc6!bloom-beacon!think!ames!pasteur!ucbvax!unizh.UUCP!nagler%olsen

Show Full Headers
Complete Article Headers
Path: arc1-ca.pugleaf.net!utzoo!attcan!uunet!husc6!bloom-beacon!think!ames!pasteur!ucbvax!unizh.UUCP!nagler%olsen
From: nagler%olsen@unizh.UUCP (Robert Nagler)
Newsgroups: comp.lang.modula2
Subject: Re: more about ORD and VAL
Message-ID: <8806300811.AA00246@klaus.olsen.uucp>
Date: 30 Jun 88 08:11:32 GMT
Sender: daemon@ucbvax.BERKELEY.EDU
Reply-To: Info-Modula2 Distribution List <INFO-M2%UCF1VM.bitnet@jade.berkeley.edu>
Organization: The Internet
Lines: 20