Path: utzoo!attcan!uunet!pdn!alan From: alan@pdn.UUCP (Alan Lovejoy) Newsgroups: comp.lang.modula2 Subject: Re: Forwarded mail for Nathan Bohlman Message-ID: <3493@pdn.UUCP> Date: 16 Jun 88 16:50:41 GMT References: <3179@cognos.UUCP> Reply-To: alan@pdn.UUCP (0000-Alan Lovejoy) Organization: Paradyne Corporation, Largo, Florida Lines: 33 In article <3179@cognos.UUCP> keithc@cognos.UUCP (Keith Campbell) writes: >In article Nathan Bohlmann writes: >>type-casting can be accomplished as follows: >> If Type1 is of type CARDINAL then to get an value of integer >> type all you need to do is say INTEGER(Type1). That's all >> there is to it. >>There are several other extensions which escape me at the moment... > >I believe that the feature to which you refer, is NOT an extension, >but rather has always been in the definition of modula2. Has some >standardization effort removed it? In Wirth's Modula-2, "INTEGER(65535)" has the value -1 (on a two's complement machine with 16-bit INTEGERs). In BSI/ISO Modula-2, it is an overflow error. In the first case, the type transfer is not meaning preserving, but bit-pattern preserving. In the second case, the opposite is true. The above quote does not explain which option is implemented by the compiler in question. I think the BSI approach is superior. BSI also has defined a mechanism for bit-pattern preserving (non-meaning preserving) type transfers. It is a pseudo-function that must be imported from SYSTEM and whose name currently escapes me. So BSI's langauge has the same (in fact, more) functionality but with different syntax. -- 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!