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: 103376,243dc2fb696a49cd X-Google-Attributes: gid103376,public X-Google-Language: ENGLISH,ASCII Path: g2news1.google.com!news2.google.com!proxad.net!feeder2-1.proxad.net!news3-e.free.fr!not-for-mail X-Attribution: Jaco Newsgroups: comp.lang.ada Subject: Re: Ada Popularity: Comparison of Ada/Charles with C++ STL (and Perl) References: <338040f8.0409230912.70e3375b@posting.google.com> From: Eric Jacoboni Organization: Rogntutdju & Associates Date: Thu, 23 Sep 2004 23:30:53 +0200 Message-ID: User-Agent: Gnus/5.110003 (No Gnus v0.3) Emacs/21.3.50 (darwin) Cancel-Lock: sha1:uxGw4BJHeJ5m0upLjR/tnH6lXfs= MIME-Version: 1.0 Content-Type: text/plain; charset=iso-8859-1 Content-Transfer-Encoding: 8bit NNTP-Posting-Date: 23 Sep 2004 23:30:54 MEST NNTP-Posting-Host: 81.56.238.119 X-Trace: 1095975054 news3-e.free.fr 17756 81.56.238.119:33747 X-Complaints-To: abuse@proxad.net Xref: g2news1.google.com comp.lang.ada:4049 Date: 2004-09-23T23:30:54+02:00 List-Id: Eric Jacoboni writes: > What about Ruby ? Much more readable than perl/python, imho. Its > inventor claims to be inspired by Ada and Eiffel syntaxes. (i've not > find the equivalent of the perl <> construct, hence the opening of > files given at the command line). Ok, i've finally found the equivalent of while (<>) construct in Ruby, so the initialisation of the hash is now more concise. By using 'for' instead of iterators, the code is more Ada-ish : for a_file in ARGF do for a_line in a_file do for a_word in a_line.split(/[^A-Za-z]+/) do count[a_word.downcase] += 1 end # for a_word end # for a_line end # for a_file -- �ric Jacoboni, n� il y a 1399418449 secondes