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 autolearn=ham autolearn_force=no version=3.4.4 X-Google-Thread: 103376,81e608b9d333eaff X-Google-Attributes: gid103376,public X-Google-Language: ENGLISH,ASCII-7-bit Path: g2news2.google.com!news4.google.com!border1.nntp.dca.giganews.com!nntp.giganews.com!wns13feed!worldnet.att.net!attbi_s72.POSTED!53ab2750!not-for-mail From: "Jeffrey R. Carter" Organization: jrcarter at acm dot org User-Agent: Thunderbird 1.5.0.9 (Windows/20061207) MIME-Version: 1.0 Newsgroups: comp.lang.ada Subject: Re: Generics and selection based on type References: In-Reply-To: Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: 7bit Message-ID: NNTP-Posting-Host: 12.201.97.213 X-Complaints-To: abuse@mchsi.com X-Trace: attbi_s72 1168638629 12.201.97.213 (Fri, 12 Jan 2007 21:50:29 GMT) NNTP-Posting-Date: Fri, 12 Jan 2007 21:50:29 GMT Date: Fri, 12 Jan 2007 21:50:30 GMT Xref: g2news2.google.com comp.lang.ada:8126 Date: 2007-01-12T21:50:30+00:00 List-Id: Maciej Sobczak wrote: > > I would like to write a generic function that returns the string > representation of its parameter, which can be a number or a string. > > Is it possible? No. You need different generic formal parameters for signed integer, modular integer, fixed-point, and floating-point types. See PragmARC.Images for an example: http://pragmada.home.mchsi.com/ -- Jeff Carter "Sir Robin the-not-quite-so-brave-as-Sir-Lancelot, who had nearly fought the Dragon of Angnor, who nearly stood up to the vicious Chicken of Bristol, and who had personally wet himself at the Battle of Badon Hill." Monty Python & the Holy Grail 68