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,FREEMAIL_FROM autolearn=ham autolearn_force=no version=3.4.4 X-Google-Thread: 103376,9544fb5ce0a6df8b X-Google-NewGroupId: yes X-Google-Attributes: gida07f3367d7,domainid0,public,usenet X-Google-Language: ENGLISH,UTF8 Received: by 10.68.59.229 with SMTP id c5mr19130180pbr.6.1322379514369; Sat, 26 Nov 2011 23:38:34 -0800 (PST) Path: lh20ni23105pbb.0!nntp.google.com!news2.google.com!goblin1!goblin.stu.neva.ru!news.tornevall.net!aioe.org!.POSTED!not-for-mail From: =?utf-8?Q?Yannick_Duch=C3=AAne_=28Hibou57?= =?utf-8?Q?=29?= Newsgroups: comp.lang.ada Subject: Re: Overloading attributes Date: Sun, 27 Nov 2011 08:38:32 +0100 Organization: Ada @ Home Message-ID: References: <8ed87fee-166a-4be9-ae6c-4d0fbeb4788c@s6g2000vbc.googlegroups.com> <3f86a446-77f5-44a1-be27-ecb8ce8ba9dd@b32g2000yqn.googlegroups.com> NNTP-Posting-Host: 3JPKcIlxw1eaZ+KTMfEJKw.user.speranza.aioe.org Mime-Version: 1.0 X-Complaints-To: abuse@aioe.org User-Agent: Opera Mail/11.60 (Linux) X-Notice: Filtered by postfilter v. 0.8.2 Xref: news2.google.com comp.lang.ada:14674 Content-Type: text/plain; charset=utf-8; format=flowed; delsp=yes Content-Transfer-Encoding: Quoted-Printable Date: 2011-11-27T08:38:32+01:00 List-Id: Le Sun, 27 Nov 2011 00:24:08 +0100, Shark8 a = = =C3=A9crit: > You can write an function to replace 'Image, it's a rather a good > question you bring up because it can also be stated: > "why are 'Read & 'Write required to have an attribute definition > clause, > but 'Image is not (in fact it is forbidden)?" Personal opinion: something similar to what I replied to Dmitry some day= s = ago, about not blindly applying any schema to anything. A case by case = investigation shows 'Read and 'Write are useful to persistent storage an= d = can be used internally by the Ada runtime or standard library. Image is = = not, and is all in user space only. So there is no formal need to be abl= e = to say =E2=80=9Cfor X'Image=E2=80=9D use, because the runtime, nor the s= tandard library, = will never use it, and as only the user will access it, the user can as = = much define an =E2=80=9Cfunction Image (X : =E2=80=A6) return String_Or_= Whatever_Type;=E2=80=9D. = Similarly, the runtime will make use of Storage (via =E2=80=9Cnew T=E2=80= =9D), so the = =E2=80=99Storage attribute can be redefined by the user. It's all a matter of =E2=80=9Cis this just toy or it this formally requi= red ?=E2=80=9D. A = user re-definable Image attribute is not needed for the language, so it'= s = up to the user to deal with it at user level. P.S. I feel the sole use of 'Image I know, is for quick debugging output= = of something. Otherwise, if you need to write a text representation of a= n = entity to some file, you should go with a custom procedure or function. -- = =E2=80=9CSyntactic sugar causes cancer of the semi-colons.=E2=80=9D [1] =E2=80=9CStructured Programming supports the law of the excluded muddle.= =E2=80=9D [1] [1]: [Epigrams on Programming =E2=80=94 Alan J. =E2=80=94 P. Yale Univer= sity]