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: Why doesn't Ada allow user-defined attributes? Date: Sun, 23 Jul 2017 08:41:40 +0200 Organization: A noiseless patient Spider Message-ID: References: Reply-To: nonlegitur@notmyhomepage.de Mime-Version: 1.0 Content-Type: text/plain; charset=utf-8; format=flowed Content-Transfer-Encoding: 7bit Injection-Date: Sun, 23 Jul 2017 06:37:41 -0000 (UTC) Injection-Info: mx02.eternal-september.org; posting-host="9c86386f19d31e1cc1a759c11f70c85d"; logging-data="31158"; mail-complaints-to="abuse@eternal-september.org"; posting-account="U2FsdGVkX1/JAsjWn5Fh6s1AKtBaB4SVy5SXOEyjBqo=" User-Agent: Mozilla/5.0 (Macintosh; Intel Mac OS X 10.12; rv:45.0) Gecko/20100101 Thunderbird/45.8.0 In-Reply-To: Cancel-Lock: sha1:Q8UdetyaEoYTtzf+908NxfWKxjo= Xref: news.eternal-september.org comp.lang.ada:47496 Date: 2017-07-23T08:41:40+02:00 List-Id: On 22.07.17 22:12, Dmitry A. Kazakov wrote: > On 2017-07-22 18:33, G.B. wrote: >> On 21.07.17 21:39, Dmitry A. Kazakov wrote: >>> On 2017-07-21 19:11, Georg Bauhaus wrote: >>>> Dmitry A. Kazakov wrote: >>>>> On 21/07/2017 06:46, Georg Bauhaus wrote: >>>>> >>>>>> Do you really need 'Length? >>>>> >>>>> Sure, when for example the result depends on the number of elements. >>>> >>>> Count is computed easily, albeit inefficiently, or even efficiently >>>> whenever a collection type caches its number of elements. >>>> So, is 'Length, if not a static property, more than a prim op? >>>> >>>>> 'Length is a general property of any container (set). >>>>> >>>>>> It seems an implementation detail whenever the language doesn't have forall >>>>>> or exists. >>>>> >>>>> Enumeration requires some additional assumptions, stronger than length. >>>> >>>> What real thing can be counted yet not one by one? >>> >>> Unordered set cannot be enumerated, >> >> https://en.wikipedia.org/wiki/Enumeration > > The sixth word there. A set's listing is different from the set---it's a name. But a count of a set's listing also happens to return the set's number of elements. An order established by counting is not a property of the set it self, but may involve listing it somehow. A specific ordering is not needed for counting. >>> Lots of external things cannot be, e.g. a file you have no permission to read. >> >> A file needs to have been _counted_ byte by byte, >> or allocated using a known _count_ of bytes, etc. >> in order to have this length. > > No. File length is an attribute of a file. You don't need to read file or to allocate it. Someone or something must have established the count by, well, counting. Otherwise no file can meaningfully have that attribute (length) in the first place!