From mboxrd@z Thu Jan 1 00:00:00 1970 Message-ID: <775b8d190512071318x1e52a4f2r3e358aadf0a83e32@mail.gmail.com> Date: Thu, 8 Dec 2005 08:18:03 +1100 From: Bruce Ellis To: Fans of the OS Plan 9 from Bell Labs <9fans@cse.psu.edu> Subject: Re: [9fans] const In-Reply-To: <571511e7dddc323d94a6da81f35ba899@terzarima.net> MIME-Version: 1.0 Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: quoted-printable Content-Disposition: inline References: <7871fcf50512071130m475c7240i3c65da1b4c900c15@mail.gmail.com> <571511e7dddc323d94a6da81f35ba899@terzarima.net> Topicbox-Message-UUID: be0cd69e-ead0-11e9-9d60-3106f5b1d025 ken had total disregard for const and that is good enough for me. i rememeber :rofix and other such hacks, but that was when memory was an issue. brucee On 12/8/05, Charles Forsyth wrote: > > So it does the optimization possible with const. Not the "interface" > > part, though. If you don't like type decorations, I guess this way's > > better. > > it's not so much type decorations, as those that are not terribly useful = or to some extent misleading. > (mind you, java programs look like christmas trees--holiday trees to thos= e of you in the US-- > with all their type and status decorations.) > > if you followed the earlier links you'll see one of the classic examples > of it being fairly odd as an interface constraint: > > char* strchr(const char* x, int y) > > but the resulting pointer points into the const string and ok, it doesn't= write to it itself, but it > hands you back a pointer into the same string so you can do it yourself! > that's wierd, especially since it must effectively have cast x to plain c= har* internally > so it's not much of a constraint either way. > > i find it's really a device for forcing the adding and removing of const > until a compiler shuts up. this is unusual, because most type clash dia= gnostics do mean something; > perhaps not all that much, but something. perhaps i'm lucky, but i have= found bugs through > type clashes (often when checking extern linkages) but i can't remember a= single thing detected by const. > it's one of those things where ``now it's there we might as well try to u= se it'' but i'm afraid i'm unconvinced. > >