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-Language: ENGLISH,ASCII-7-bit X-Google-Thread: 103376,1901f265c928a511 X-Google-Attributes: gid103376,public Path: controlnews3.google.com!news1.google.com!news.glorb.com!cyclone1.gnilink.net!gnilink.net!wn14feed!worldnet.att.net!attbi_s04.POSTED!53ab2750!not-for-mail From: tmoran@acm.org Newsgroups: comp.lang.ada Subject: Re: Typing in Ada References: X-Newsreader: Tom's custom newsreader Message-ID: <_KOuc.24339$IB.6225@attbi_s04> NNTP-Posting-Host: 24.6.132.82 X-Complaints-To: abuse@comcast.net X-Trace: attbi_s04 1086044218 24.6.132.82 (Mon, 31 May 2004 22:56:58 GMT) NNTP-Posting-Date: Mon, 31 May 2004 22:56:58 GMT Organization: Comcast Online Date: Mon, 31 May 2004 22:56:58 GMT Xref: controlnews3.google.com comp.lang.ada:963 Date: 2004-05-31T22:56:58+00:00 List-Id: >In any event to create a new type in C you need to introduce a structure. In >fact, different structures do have different types: How would you do in C the equivalent of type Vars is (x,y); function Image(Var : Vars) return String is ... package Polys is new Multinom(Vars, Image); use Polys; A : Polys.Multinomials := X**4 + 2.0*x**3*y**1 + 3.0*x**2*y**2 + 4.0*x**1*y**3 + 5.0*y**4; B : Polys.Multinomials := x**2 - 2.0*x**1*y**1 + y**2; ... Put_Line("Product is " & Image(A*B));