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 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!news2.google.com!npeer03.iad.highwinds-media.com!news.highwinds-media.com!feed-me.highwinds-media.com!nntp.club.cc.cmu.edu!feeder.erje.net!newsfeed.freenet.ag!news.netcologne.de!ramfeed1.netcologne.de!newsfeed.arcor.de!newsspool3.arcor-online.net!news.arcor.de.POSTED!not-for-mail From: "Dmitry A. Kazakov" Subject: Re: for S'Image use Func?? Newsgroups: comp.lang.ada User-Agent: 40tude_Dialog/2.0.15.1 MIME-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit Reply-To: mailbox@dmitry-kazakov.de Organization: cbb software GmbH References: Date: Thu, 6 May 2010 19:23:18 +0200 Message-ID: <10yarz51f24i9$.k5ouloeombf2$.dlg@40tude.net> NNTP-Posting-Date: 06 May 2010 19:23:13 CEST NNTP-Posting-Host: be1f9249.newsspool3.arcor-online.net X-Trace: DXC=lK1M7?j 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. -- Regards, Dmitry A. Kazakov http://www.dmitry-kazakov.de