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=-0.3 required=5.0 tests=BAYES_00, REPLYTO_WITHOUT_TO_CC autolearn=no autolearn_force=no version=3.4.4 Path: eternal-september.org!reader01.eternal-september.org!reader02.eternal-september.org!news.eternal-september.org!news.eternal-september.org!.POSTED!not-for-mail From: "G.B." Newsgroups: comp.lang.ada Subject: Re: Experimenting with the OOP features in Ada Date: Tue, 3 Jan 2017 18:07:28 +0100 Organization: A noiseless patient Spider Message-ID: References: <29380aa7-0c3b-4908-94c6-aa91f3996b42@googlegroups.com> Reply-To: nonlegitur@notmyhomepage.de Mime-Version: 1.0 Content-Type: text/plain; charset=utf-8; format=flowed Content-Transfer-Encoding: 7bit Injection-Date: Tue, 3 Jan 2017 17:05:58 -0000 (UTC) Injection-Info: mx02.eternal-september.org; posting-host="e250950a4e170671c5f93b577b11b610"; logging-data="5145"; mail-complaints-to="abuse@eternal-september.org"; posting-account="U2FsdGVkX1+StMtqn9W/WMaXMnYJyIfCLaiLltvrwgc=" User-Agent: Mozilla/5.0 (Macintosh; Intel Mac OS X 10.12; rv:45.0) Gecko/20100101 Thunderbird/45.5.1 In-Reply-To: Cancel-Lock: sha1:CPJwBg011b+wscuxIww86ZLC9vI= Xref: news.eternal-september.org comp.lang.ada:33024 Date: 2017-01-03T18:07:28+01:00 List-Id: On 03/01/2017 15:31, Dmitry A. Kazakov wrote: > On 2017-01-03 14:57, Laurent wrote: >> Item.Name.Set (Name=>"Something") looks better than >> >> Item.Name := My_Strings.Handle.Create (Value => Name); > > Some people like using unary "+" for this. E.g. > > function "+" (Value : String) return My_Safe_String > renames My_Strings.Handle.Create; > > Then you can do: > > Item.Name := +"Something"; Using an operator seems always a good idea when the language does not otherwise support a ubiquitous notion such as a handle. Otherwise, both the domain data types and data handling types are indistinguishable, language-wise, and the reader is left in daze: is this program text about handles or is it about data?