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=-0.3 required=5.0 tests=BAYES_00, REPLYTO_WITHOUT_TO_CC autolearn=no autolearn_force=no version=3.4.4 X-Google-Language: ENGLISH,ASCII-7-bit X-Google-Thread: 103376,f6b6181765c24743 X-Google-Attributes: gid103376,public X-Google-ArrivalTime: 2001-02-05 17:22:54 PST Path: supernews.google.com!sn-xit-02!sn-xit-01!supernews.com!newsfeed.stanford.edu!arclight.uoregon.edu!newsfeed.ksu.edu!nntp.ksu.edu!news.okstate.edu!dvdeug From: dvdeug@x8b4e53cd.dhcp.okstate.edu (David Starner) Newsgroups: comp.lang.ada Subject: Re: Generics - Difference between ADA and Modula--3 Date: 6 Feb 2001 00:03:55 GMT Organization: Oklahoma State University Message-ID: <95nf1b$9282@news.cis.okstate.edu> References: <3a7646fb$1@rsl2.rslnet.net> <956ols$qtv$1@news.cis.ohio-state.edu> <95eumd$8i41@news.cis.okstate.edu> <95nc12$62m$1@usenet.rational.com> Reply-To: dstarner98@aasaa.ofe.org NNTP-Posting-Host: x8b4e5089.dhcp.okstate.edu User-Agent: slrn/0.9.6.3 (Linux) Xref: supernews.google.com comp.lang.ada:4957 Date: 2001-02-06T00:03:55+00:00 List-Id: On Mon, 5 Feb 2001 15:12:20 -0800, Mark Lundquist wrote: >> Ada designers made perfectly type-safe generics. Modula-3 designers looked >> at Ada generics and C++ templates and decided the Ada generics were too >much >> of a PITA and went with a C++-style design that catches mistakes at >link-time >> rather than compile-time. > >Oh yeah... link-time errors, no pain there... :-) Quote from language reference introduction (which explains the why and how of many Modula-3 features): | In the same spirit of simplicity, there is no separate typechecking | associated with generics. Implementations are expected to expand the | generic and typecheck the result. The alternative would be to invent | a polymorphic type system flexible enough to express the constraints | on the parameter interfaces that are necessary in order for the generic | body to compile. This has been achieved for ML and CLU, but it has not | yet been achieved satisfactorily in the Algol family of languages, | where the type systems are less uniform. (The rules associated with | Ada generics are too complicated for our taste.) (Note that this document was written prior to Ada 95.) The Introduction (http://www.research.compaq.com/SRC/m3defn/html/intro.html) is an interesting look at the design of a "Algol family" (i.e. Ada, Oberon, the Modula's, Java) and some of the choices that could be made. -- David Starner - dstarner98@aasaa.ofe.org Pointless website: http://dvdeug.dhis.org "I don't care if Bill personally has my name and reads my email and laughs at me. In fact, I'd be rather honored." - Joseph_Greg