Path: utzoo!utgpu!watmath!att!dptg!rutgers!tut.cis.ohio-state.edu!gem.mps.ohio-state.edu!ginosko!uunet!iscuva!jimc
From: jimc@iscuva.ISCS.COM (Jim Cathey)
Newsgroups: comp.sys.mac.programmer
Subject: Re: CommToolbox & LSC
Message-ID: <2595@iscuva.ISCS.COM>
Date: 15 Aug 89 15:32:43 GMT
References: <10011@bsu-cs.bsu.edu> <2419@husc6.harvard.edu> <197@dbase.UUCP>
Organization: ISC Systems Corporation, Spokane WA
Lines: 25

In article <197@dbase.UUCP> awd@dbase.UUCP (Alastair Dallas) writes:
>...  In case
>you're not aware, 'const' brings very little to party.  The compiler is
>supposed to check to make sure you do what you said you'd do and not let
>you write to a const object.  (C Chauvinist Pig voice:) If you want that
>kind of hand-holding, boy, better code in Pascal.

However, in MMU protected environments the compiler can place const objects
into the TEXT space where it actually is write protected (no big deal there),
but in most of these environments (Unix-oids) the TEXT space can also be
shared among multiple invocations.  This is the big win for the const
modifier in my mind (especially for strings and constant tables).

In the Mac environment, the const objects could be placed into the CODE
resources so they didn't take up any of the 32K globals data space.  LSC
probably puts the strings elsewhere anyway, but _I_ couldn't tell you that.

+----------------+
! II      CCCCCC !  Jim Cathey
! II  SSSSCC     !  ISC-Bunker Ramo
! II      CC     !  TAF-C8;  Spokane, WA  99220
! IISSSS  CC     !  UUCP: uunet!iscuva!jimc (jimc@iscuva.iscs.com)
! II      CCCCCC !  (509) 927-5757
+----------------+
			"With excitement like this, who is needing enemas?"