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-Thread: a07f3367d7,e55245590c829bef X-Google-Attributes: gida07f3367d7,public,usenet X-Google-NewGroupId: yes X-Google-Language: ENGLISH,ASCII Path: g2news2.google.com!news1.google.com!news.glorb.com!news.mv.net!nntp.TheWorld.com!not-for-mail From: Robert A Duff Newsgroups: comp.lang.ada Subject: Re: _Type vs no _Type Date: Sat, 06 Nov 2010 09:24:37 -0400 Organization: The World Public Access UNIX, Brookline, MA Message-ID: References: <86wroy58ff.fsf@gareth.avalon.lan> <86pqup5xfy.fsf@gareth.avalon.lan> <86y69d3rec.fsf@gareth.avalon.lan> <82lj5c5ecm.fsf@stephe-leake.org> <82zktq4n9b.fsf_-_@stephe-leake.org> <7cc5dde2-8052-408c-b77f-8bf081d53cde@r14g2000yqa.googlegroups.com> NNTP-Posting-Host: shell01.theworld.com Mime-Version: 1.0 Content-Type: text/plain; charset=iso-8859-1 Content-Transfer-Encoding: 8bit X-Trace: pcls6.std.com 1289049877 11806 192.74.137.71 (6 Nov 2010 13:24:37 GMT) X-Complaints-To: abuse@TheWorld.com NNTP-Posting-Date: Sat, 6 Nov 2010 13:24:37 +0000 (UTC) User-Agent: Gnus/5.1008 (Gnus v5.10.8) Emacs/21.3 (irix) Cancel-Lock: sha1:y8KV6HwljLLTg4VTx4+5U81LnfE= Xref: g2news2.google.com comp.lang.ada:16299 Date: 2010-11-06T09:24:37-04:00 List-Id: Shark8 writes: > On Nov 5, 4:52�pm, Robert A Duff wrote: >> Named notation never, ever, ever makes sense for operators. >> And if the body of "+" is short, single-letter >> names are crystal clear. > > Well, except in the case where you need to specify an operator that > might not be immediately visible. IMHO, you should never, ever, ever be in that situation. The whole point of operator symbols is that you don't want a nice long meaningful name, you want a short symbol, and all readers of the code must memorize what it means. (For "+" they probably memorized it in grade school, except the part about overflow.) Writing Foo."+"(Left => ..., Right => ...) or Foo."+"(..., ...) completely defeats the purpose. You should instead say "use" or "use type". Or if you really want the package name, then you shouldn't have made it an operator symbol in the first place. If I were in charge, operators would always be directly visible. It's really silly that ":=" is always visible, but "=" is not. This idea was proposed for Ada 9X, but it was rejected because it is (slightly) incompatible. That's when "use type" was invented as a workaround. - Bob