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.9 required=5.0 tests=BAYES_00,FORGED_GMAIL_RCVD, FREEMAIL_FROM autolearn=no autolearn_force=no version=3.4.4 X-Google-Thread: a07f3367d7,c689b55786a9f2bd X-Google-Attributes: gida07f3367d7,public,usenet X-Google-NewGroupId: yes X-Google-Language: ENGLISH,ASCII-7-bit Path: g2news2.google.com!news4.google.com!feeder1.cambriumusenet.nl!feed.tweaknews.nl!193.201.147.87.MISMATCH!news.astraweb.com!border2.a.newsrouter.astraweb.com!transit4.hitnews.eu!feeder.news-service.com!85.214.198.2.MISMATCH!eternal-september.org!.POSTED!not-for-mail From: Warren Newsgroups: comp.lang.ada Subject: Re: for S'Image use Func?? Date: Thu, 6 May 2010 20:05:55 +0000 (UTC) Organization: A noiseless patient Spider Message-ID: References: <10yarz51f24i9$.k5ouloeombf2$.dlg@40tude.net> Injection-Date: Thu, 6 May 2010 20:05:55 +0000 (UTC) Injection-Info: mx02.eternal-september.org; posting-host="9f8M0iN5t54V+4DF/iqO8g"; logging-data="17304"; mail-complaints-to="abuse@eternal-september.org"; posting-account="U2FsdGVkX19HqGab/DfZGzKHAN4NdB4Q5wGOxhWmg4U=" User-Agent: Xnews/5.04.25 X-Face: &6@]C2>ZS=NM|HE-^zWuryN#Z/2_.s9E|G&~DRi|sav9{E}XQJb*\_>=a5"q]\%A;5}LKP][1mA{gZ,Q!j Cancel-Lock: sha1:ceSDmf2UkPaVWWaGmdbW2Eukyx4= Xref: g2news2.google.com comp.lang.ada:11338 Date: 2010-05-06T20:05:55+00:00 List-Id: Dmitry A. Kazakov expounded in news:10yarz51f24i9$.k5ouloeombf2$.dlg@ 40tude.net: > On Thu, 6 May 2010 17:10:20 +0000 (UTC), Warren wrote: > >> 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; >> >> If so, then the question is what the signature of >> the S'Image function looks like-- is it: >> >> function LNumber_To_String(LNO : LNumber_Type) return String; > > I am not sure what do you mean, but the following is legal Ada: > > generic > type T is private; > with function Image (X : T) return String; > package P is > ... > end P; > > type LNumber_Type is range 0..99_999; > > package PI is new P (LNumber_Type, LNumber_Type'Image); > > So attribute is a "plain" function with a clumsy name. I would never have though along those lines, but agree this isn't the "Right Thing"(T). Thanks