comp.lang.ada
 help / color / mirror / Atom feed
From: Craig Carey <research@ijs.co.nz>
Subject: Re: Terminating a task
Date: Wed, 16 Jul 2003 05:49:04 +1200
Date: 2003-07-16T05:49:04+12:00	[thread overview]
Message-ID: <5ra8hvkkabsvevc2r0abu4mp71dfochelr@4ax.com> (raw)
In-Reply-To: 1ec946d1.0307141545.2175a770@posting.google.com


On 14 Jul 2003 16:45:32 -0700, mheaney@on2.com (Matthew Heaney) wrote:
>> PS. The new "Computer Language Shootout" website now has Ada. 
>> 
>>    http://dada.perl.it/shootout/index.html
>> 
>> My "wc" word count program got eliminated probably since the tester
>> could not link in Win32 "_setmode" and "_read". (Ada 95 packages do not
>> allow accurate reading from the standard input). 

I correct that: Mr A. Calpini can link (gnatmake runs easily).

>Your word count program got eliminated because it is junk.

I have not got a statement of the reasoning and I have requested that.
I guess that the contest person would reply.

...
>I have no idea what you mean about not being able to accurately read
>from standard input.

Ada 95 can't read data accurately from the console: (a) Text_IO has an
undefined behaviour on what bounds lines. The Stream_IO package does not
let the standard input be specified. GNAT extensions were not used (i.e.
fread() in Interfaces.C_Streams).

   AARM A.12.1 The Package Streams.Stream_IO"
   http://www.adaic.org/standards/95aarm/html/AA-A-12-1.html


>Here is a simplified version of the program, which closely follows the
>gcc example:
>

My code is better:  http://dada.perl.it/shootout/gnat_allsrc.html

>with Ada.Text_IO;            use Ada.Text_IO; [...]
>procedure WC is
...
>   while not End_Of_File loop
>      Get_Line (Line, Last);


A program called "word counter" need not receive data containing text.

The 'wc' specs agree:
   http://www.bagley.org/~doug/shootout/bench/wordfreq/

Ada.Text_IO was not portable over to ObjectAda 7.2.2: End_Error on a
missing NL at the end of the file. Using Ada.Text_IO's Read_Line is not
safe in presumably all samples programs if GNAT might not be used.

Correctness testing could appear later. Poplog LISP was losing entries:
   http://dada.perl.it/shootout/poplisp.html

The New Shootout: http://dada.perl.it/shootout/
 Old site has e-mail addr.





Craig Carey
GNAT's C++ Cpp_Virtual pragma:

http://www.ijs.co.nz/code/ada_95_gnat_bindings_to_cpp_example_program.txt




  reply	other threads:[~2003-07-15 17:49 UTC|newest]

Thread overview: 10+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2003-07-12 14:03 Terminating a task kat-Zygfryd
2003-07-12 14:37 ` kat-Zygfryd
2003-07-14  9:34   ` Craig Carey
2003-07-14 23:45     ` Matthew Heaney
2003-07-15 17:49       ` Craig Carey [this message]
2003-07-15 18:30         ` David C. Hoos
2003-07-16  5:26         ` Matthew Heaney
2003-07-15 22:37       ` Robert I. Eachus
2003-07-16  5:00         ` Matthew Heaney
2003-07-16 18:19           ` Robert I. Eachus
replies disabled

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox