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!wn14feed!worldnet.att.net!attbi_s53.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: NNTP-Posting-Host: 24.6.132.82 X-Complaints-To: abuse@comcast.net X-Trace: attbi_s53 1086064823 24.6.132.82 (Tue, 01 Jun 2004 04:40:23 GMT) NNTP-Posting-Date: Tue, 01 Jun 2004 04:40:23 GMT Organization: Comcast Online Date: Tue, 01 Jun 2004 04:40:23 GMT Xref: controlnews3.google.com comp.lang.ada:983 Date: 2004-06-01T04:40:23+00:00 List-Id: >> type Vars is (x,y); >> 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 >Are you asking me to show you symbolic polynomical manipulation code in C? You miss the point. If Vars was an enumeration type in C, an expression like "X**4 + 2.0*x**3*y**1"... would result in some floating point value. Without types, it wouldn't even begin to invoke the necessary operator overloading function calls. >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? I assumed by "C" you really meant something newer, like "C++". In "C" "the only operations that you can perform on a structure are take its address with &, and access one of its members." (The C Programming Language, Kernighan and Ritchie). In any case, I'd be curious to see how you would write the above in C++.