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,FREEMAIL_FROM autolearn=ham autolearn_force=no version=3.4.4 X-Google-Language: ENGLISH,ASCII Path: g2news2.google.com!postnews.google.com!j32g2000yqh.googlegroups.com!not-for-mail From: sjw Newsgroups: comp.lang.eiffel,comp.lang.ada,comp.lang.modula3,comp.programming Subject: Re: Alternatives to C: ObjectPascal, Eiffel, Ada or Modula-3? Date: Wed, 22 Jul 2009 12:29:36 -0700 (PDT) Organization: http://groups.google.com Message-ID: <24b1e02c-ef00-4adf-be11-e65277fc095c@j32g2000yqh.googlegroups.com> References: NNTP-Posting-Host: 82.20.239.89 Mime-Version: 1.0 Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: quoted-printable X-Trace: posting.google.com 1248290976 14376 127.0.0.1 (22 Jul 2009 19:29:36 GMT) X-Complaints-To: groups-abuse@google.com NNTP-Posting-Date: Wed, 22 Jul 2009 19:29:36 +0000 (UTC) Complaints-To: groups-abuse@google.com Injection-Info: j32g2000yqh.googlegroups.com; posting-host=82.20.239.89; posting-account=_RXWmAoAAADQS3ojtLFDmTNJCT0N2R4U User-Agent: G2/1.0 X-HTTP-UserAgent: Mozilla/5.0 (Macintosh; U; Intel Mac OS X 10_5_7; en-us) AppleWebKit/530.19.2 (KHTML, like Gecko) Version/4.0.2 Safari/530.19,gzip(gfe),gzip(gfe) Xref: g2news2.google.com comp.lang.eiffel:394 comp.lang.ada:7278 comp.lang.modula3:89 comp.programming:11978 Date: 2009-07-22T12:29:36-07:00 List-Id: On Jul 20, 1:15=A0pm, Nicholas Paul Collin Gloucester wrote: > =A0 =A0type Horizontal_Coordinate is new Float; > =A0 =A0type Vertical_Coordinate is new Float; > =A0 =A0procedure Point(X : Horizontal_Coordinate; Y : Vertical_Coordinate= ) is > =A0 =A0begin > =A0 =A0 =A0 null; --Whatever. > =A0 =A0end; > > =A0 =A0type Magnitude is new Float; > =A0 =A0type Radians is new Float range -3.14*2.0 .. 3.14*2.0; > =A0 =A0procedure Point(R : Magnitude; Theta : Radians) is > =A0 =A0begin > =A0 =A0 =A0 null; --Whatever. > =A0 =A0end; And what will happen to this distinction with Point (2.0, 2.0);? You could use named parameter association, but *much* better to use proper types -- type Cartesian_Coordinate is record X : Metres; Y : Metres; end record; which makes it easy to (for instance) create appropriate functions "+", "-", "*", "/". I don't think I'd ever, even in an example, write 3.14 for Ada.Numerics.Pi. We have a partner company who redefined pi to be 3.14159, causing a lot of expense to both sides when we sent a value greater than this (but less than Ada.Numerics.Pi) and they rejected it ..