🚀 go-pugleaf

RetroBBS NetNews Server

Inspired by RockSolid Light RIP Retro Guy

Article View: comp.lang.modula2
Article #3240

Re: Modula2 for C programmers?

#3240
From: Bengt-Inge Dalenback
Date: Fri, 02 Feb 1996 15:42
37 lines
2140 bytes
In article <DM4L7A.Esw@cix.compulink.co.uk> David Collier,
dcollier@cix.compulink.co.uk writes:
>re JPI
>
>They think that LONGCARD( 3.0 ) is 3. This is sensible, but not, perhaps, 
>in the spirit of purity.

Ok, I never even thought of doing that since also I had used more
standard M2 compilers before. This is how it must be then regarding 
"A := Type(B)" in pseudo M2 (sort of):

IF SIZE(A) = SIZE(B) THEN
   IF (A and B both are ordinal types or SETs) THEN
   	  bitpattern is reinterpreted (* PIM *)
   ELSE
      A := VAL(Type,B) (* useful but nonstandard *)
   END
ELSIF SIZE(A) > SIZE(B) THEN
   some bytes in A become undefined (* nonstandard and VERY dangerous *)
ELSE
   some bytes are lost  (* nonstandard, may be useful but still dangerous
                           - especially when porting code *)
END;

It is clearly safest to avoid using this extension (contamination?) and to
stick with the PIM case as I suggested and use VAL for the rest.


Regards,

.......................................................................
Bengt-Inge Dalenback
at:                                     and:
   Department of Applied Acoustics         CATT
   Chalmers University of Technology       (Software for room acoustic 
   Gothenburg, SWEDEN                      prediction and auralization)
   e-mail: bid@ta.chalmers.se              e-mail: catt@netg.se
Technical Details
Message-ID: <4etbcu$qrd@nyheter.chalmers.se>
Path: arc1-ca.pugleaf.net!g0-mac7.ta.chalmers.se!bid
References: <4eh2d6$18d@seagoon.newcastle.edu.au> <DM3L4G.M6J@cix.compulink.co.uk> <4et08r$nt1@nyheter.chalmers.se> <DM4L7A.Esw@cix.compulink.co.uk>

Show Full Headers
Complete Article Headers
Path: arc1-ca.pugleaf.net!g0-mac7.ta.chalmers.se!bid
From: Bengt-Inge Dalenback <bid@ta.chalmers.se>
Newsgroups: comp.lang.modula2
Subject: Re: Modula2 for C programmers?
Date: 2 Feb 1996 15:42:22 GMT
Organization: CATT & Dep. of Applied Acoustics, Chalmers
Distribution: world
Message-ID: <4etbcu$qrd@nyheter.chalmers.se>
References: <4eh2d6$18d@seagoon.newcastle.edu.au> <DM3L4G.M6J@cix.compulink.co.uk> <4et08r$nt1@nyheter.chalmers.se> <DM4L7A.Esw@cix.compulink.co.uk>
NNTP-Posting-Host: g0-mac7.ta.chalmers.se
Mime-Version: 1.0
Content-Type: text/plain; charset=ISO-8859-1
Content-Transfer-Encoding: 8bit
X-Newsreader: Nuntius 2.0.1_68K
X-XXMessage-ID: <AD37EFD2BA02B84A@g0-mac7.ta.chalmers.se>
X-XXDate: Fri, 2 Feb 1996 15:44:02 GMT