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-Thread: a07f3367d7,5af5c381381ac5a7 X-Google-Attributes: gida07f3367d7,public,usenet X-Google-NewGroupId: yes X-Google-Language: ENGLISH,ASCII-7-bit Path: g2news2.google.com!news4.google.com!feeder3.cambriumusenet.nl!feeder1.cambriumusenet.nl!feed.tweaknews.nl!193.201.147.84.MISMATCH!xlned.com!feeder1.xlned.com!news.netcologne.de!newsfeed-fusi2.netcologne.de!newsfeed.straub-nv.de!newsfeed.utanet.at!newsfeed01.chello.at!newsfeed.arcor.de!newsspool2.arcor-online.net!news.arcor.de.POSTED!not-for-mail Date: Fri, 28 May 2010 11:48:04 +0200 From: Georg Bauhaus User-Agent: Mozilla/5.0 (Macintosh; U; Intel Mac OS X 10.5; en-US; rv:1.9.1.9) Gecko/20100317 Thunderbird/3.0.4 MIME-Version: 1.0 Newsgroups: comp.lang.ada Subject: Re: Ada requires too much typing! References: In-Reply-To: Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 7bit Message-ID: <4bff9155$0$6973$9b4e6d93@newsspool4.arcor-online.net> Organization: Arcor NNTP-Posting-Date: 28 May 2010 11:48:05 CEST NNTP-Posting-Host: e2ebe5b6.newsspool4.arcor-online.net X-Trace: DXC=BEF4XWT1F;J@Y=h<_c3PkH4IUKJLh>_cHTX3jMPLa;B_Kdi3F X-Complaints-To: usenet-abuse@arcor.de Xref: g2news2.google.com comp.lang.ada:12115 Date: 2010-05-28T11:48:05+02:00 List-Id: On 28.05.10 07:25, Luis Espinal wrote: > With the addition of generics in Java, the situation has gotten worse. We need > to use generics to make typing stronger (and to avoid run-time casting errors). > And yet, the syntax is terrible. Try to create, say, create a function that > takes as argument, say, a Map parametrized with subclasses of a given > parametrized class as keys, and container parametrized to a different type as > values. It's an abomination. In Scala, it is much simpler and efficient, ergo > more economical. Just for a better understanding, does the following example exhibit some of the generic syntax "abomination"? import java.util.HashMap; import java.util.TreeSet; public class News { class Things extends TreeSet {} class Counts extends HashMap {} int howmany(final Counts in_here) { int sum = 0; for (Things t : in_here.values()) { sum += t.size(); } return sum; } } Has Andrew Appel's Critique of ML influenced the syntax? I would hope so; Appel explains in some detail the mistakes that were carved in stone when defining ML; a quick scan of FunDef and Expr in the Scala syntax makes me assume---perhaps wrongly---that once again I need not mark the end of things!!! (Which typically entails horrible error messages such as when the next definition is parsed as the second argument to the foregoing definition, in which the programmer had forget the second argument *and* omitted the optional end marker.)