comp.lang.ada
 help / color / mirror / Atom feed
From: "Yannick Duchêne (Hibou57)" <yannick_duchene@yahoo.fr>
Subject: Re: Overloading attributes
Date: Sun, 27 Nov 2011 08:38:32 +0100
Date: 2011-11-27T08:38:32+01:00	[thread overview]
Message-ID: <op.v5lguig4ule2fv@douda-yannick> (raw)
In-Reply-To: 3f86a446-77f5-44a1-be27-ecb8ce8ba9dd@b32g2000yqn.googlegroups.com

Le Sun, 27 Nov 2011 00:24:08 +0100, Shark8 <onewingedshark@gmail.com> a  
écrit:
> 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 days  
ago, about not blindly applying any schema to anything. A case by case  
investigation shows 'Read and 'Write are useful to persistent storage and  
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 able  
to say “for X'Image” use, because the runtime, nor the standard library,  
will never use it, and as only the user will access it, the user can as  
much define an “function Image (X : …) return String_Or_Whatever_Type;”.  
Similarly, the runtime will make use of Storage (via “new T”), so the  
’Storage attribute can be redefined by the user.

It's all a matter of “is this just toy or it this formally required ?”. 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 an  
entity to some file, you should go with a custom procedure or function.

-- 
“Syntactic sugar causes cancer of the semi-colons.” [1]
“Structured Programming supports the law of the excluded muddle.” [1]
[1]: [Epigrams on Programming — Alan J. — P. Yale University]



  reply	other threads:[~2011-11-27  7:38 UTC|newest]

Thread overview: 29+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2011-11-26 23:13 Overloading attributes Matt Borchers
2011-11-26 23:24 ` Shark8
2011-11-27  7:38   ` Yannick Duchêne (Hibou57) [this message]
2011-11-27  3:36 ` anon
2011-11-27  7:04   ` J-P. Rosen
2011-11-27 20:00     ` anon
2011-11-27 20:34       ` Yannick Duchêne (Hibou57)
2011-11-27 20:50         ` Yannick Duchêne (Hibou57)
2011-11-27 23:10       ` J-P. Rosen
2011-11-28  9:11         ` anon
2011-11-28 10:53           ` Peter C. Chapin
2011-11-29 11:58             ` anon
2011-11-29 12:50               ` Mark Lorenzen
2011-11-30 11:05                 ` anon
2011-11-29 16:16               ` AdaMagica
2011-11-29 17:43                 ` Jeffrey Carter
2011-11-29 23:26                 ` J-P. Rosen
2011-11-30 11:06                   ` anon
2011-11-30 15:52                     ` J-P. Rosen
2011-11-30 17:27                       ` Yannick Duchêne (Hibou57)
2011-11-30 20:45                       ` Pascal Obry
2011-12-01 11:01                       ` Simon Wright
2011-12-02 18:55                       ` anon
2011-12-02 19:34                         ` Ludovic Brenta
2011-12-02 20:02                           ` Yannick Duchêne (Hibou57)
2011-12-03  1:41                           ` Randy Brukardt
2011-11-28 12:06           ` Ludovic Brenta
2011-11-27  5:11 ` Yannick Duchêne (Hibou57)
2011-11-27 12:57 ` Dmitry A. Kazakov
replies disabled

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox