=?utf-8?Q?Yannick_Duch=C3=AAne_=28Hibou57?= =?utf-8?Q?=29?= expounded in news:op.vcaqajn0ule2fv@garhos: > Le Thu, 06 May 2010 19:10:20 +0200, Warren a > écrit: > >> I have tried to google for this and have not yet found >> a suitable answer, so I'll troll, er, poll for an >> answer here.. >> >> Is there the ability to substitute your own S'Image >> function? For example, a basic interpreter might >> define: >> >> type LNumber_Type is range 0..99_999; >> >> Can I declare.. >> >> for LNumber_Type'Image use LNumber_To_String; > However, it later says: > > [ARM 2005 13.3 (5/1)] > An attribute_designator is allowed in an attribute_definition_clause > only if this International Standard explicitly allows it ... > Finally, it should be checked if Image is explicitely allowed as an > attribute designator for an operational clause (I may check later to > give you a more formal answer to this one question). As others have suggested, probably not, or at best on an implementation basis only. At best, this suggests that this approach is unportable. >> Finally, there is actually a third question- more along >> the lines of "Should this language feature be used >> in this manner?", or is it preferable to just code your >> own along the lines of (which is what I presently use): >> >> function To_String(LNO : LNumber_Type) return String; > I would say, it is more handy to define a function, because a function > would be able to hold the exact formatting parameter your application > requires, it would be able to hold the exact optional defaults for > those parameters and it would better integrates with the overall > general design of an Ada application, that, “withing” package and > using renames clause. Using attribute, you are require to always use > thye type name as a prefix for such things as ’Image. True, but in my case I just needed the leading zeros, sans any sign: 900 to be displayed as "00900" (vs " 900"). > All of this providing I've understood what you were requesting for. Yep, you got it. Warren