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!border1.nntp.dca.giganews.com!nntp.giganews.com!newsread.com!newsstand.newsread.com!POSTED.monger.newsread.com!not-for-mail Newsgroups: comp.lang.ada Subject: Re: Typing in Ada From: "Peter C. Chapin" References: <_KOuc.24339$IB.6225@attbi_s04> Organization: Kelsey Mountain Software Message-ID: User-Agent: Xnews/5.04.25 Date: Tue, 01 Jun 2004 01:09:41 GMT NNTP-Posting-Host: 216.114.178.230 X-Complaints-To: Abuse Role , We Care X-Trace: monger.newsread.com 1086052181 216.114.178.230 (Mon, 31 May 2004 21:09:41 EDT) NNTP-Posting-Date: Mon, 31 May 2004 21:09:41 EDT Xref: controlnews3.google.com comp.lang.ada:970 Date: 2004-06-01T01:09:41+00:00 List-Id: tmoran@acm.org wrote in news:_KOuc.24339$IB.6225@attbi_s04: > 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)); Are you asking me to show you symbolic polynomical manipulation code in C? I don't understand how that bears on the question of how strongly typed C is. In any case your example uses features like generic instantiation and operator overloading that could be more directly mapped to C++. Would you say that C++ is more strongly typed than C? Peter