From mboxrd@z Thu Jan 1 00:00:00 1970 X-Spam-Checker-Version: SpamAssassin 3.4.4 (2020-01-24) on polar.synack.me X-Spam-Level: X-Spam-Status: No, score=-1.9 required=5.0 tests=BAYES_00 autolearn=ham autolearn_force=no version=3.4.4 X-Google-Language: ENGLISH,ASCII-7-bit X-Google-Thread: 103376,25aa3c7e1b59f7b5 X-Google-Attributes: gid103376,public X-Google-ArrivalTime: 2002-01-18 16:35:48 PST Path: archiver1.google.com!news1.google.com!newsfeed.stanford.edu!news-spur1.maxwell.syr.edu!news.maxwell.syr.edu!newsfeed.cwix.com!sjc-peer.news.verio.net!news.verio.net!iad-read.news.verio.net.POSTED!bpr.best.vwh.net!bpr Newsgroups: comp.lang.ada From: Brian Rogoff Subject: Re: A case where Ada defaults to unsafe? In-Reply-To: Message-ID: References: <3C34BF2C.6030500@mail.com> <3C34D252.4070307@mail.com> MIME-Version: 1.0 Content-Type: TEXT/PLAIN; charset=US-ASCII Date: Sat, 19 Jan 2002 00:35:40 +0000 NNTP-Posting-Host: 192.220.65.223 X-Complaints-To: abuse@verio.net X-Trace: iad-read.news.verio.net 1011400479 192.220.65.223 (Sat, 19 Jan 2002 00:34:39 GMT) NNTP-Posting-Date: Sat, 19 Jan 2002 00:34:39 GMT Organization: Verio Xref: archiver1.google.com comp.lang.ada:19089 Date: 2002-01-19T00:35:40+00:00 List-Id: On Thu, 10 Jan 2002, Robert A Duff wrote: > Brian Rogoff writes: > > On Fri, 4 Jan 2002, Robert A Duff wrote: > > > If you're looking for cases where Ada makes the default less safe, I can > > > think of a few. Here's one: "X: T := ...;" is a variable, whereas > > > "X: constant T := ...;" is a constant. IMHO, it should be the other way > > > around ("X: var T := ...;" for a variable), since constants are safer > > > than variables. > > > > I know I'm digressing a bit, but I'd prefer that ":=" not be used for > > declaring the value of a constant, since I think of that as being > > different from assignment. > > It seems to me that initializing an object is conceptually different > from an assignment statement, and therefore deserves a different > notation. But I would use the same notation for initializing both > constants and variables. I'm not sure I like "=", because we already > use that for equality tests. How about ":=" for init, and ":==" for > assignment statements? (Imagine you're designing a language from > scratch, here.) I assume that you are assuming that assignment will be less frequent than object initialization, and so assignment gets the longer token? I'm not sure I like this proposal. Do we really want to think of constant initialization as being like assignment? It seems that we're really just declaring its value, and that =, or "is" as someone else suggested, is better. -- Brian