comp.lang.ada
 help / color / mirror / Atom feed
From: Warren <ve3wwg@gmail.com>
Subject: Re: for S'Image use Func??
Date: Mon, 10 May 2010 18:50:02 +0000 (UTC)
Date: 2010-05-10T18:50:02+00:00	[thread overview]
Message-ID: <Xns9D7496E77C7B0WarrensBlatherings@188.40.43.245> (raw)
In-Reply-To: 1qcb6z4i20dyb.1dz2hd4c0vx69.dlg@40tude.net

Dmitry A. Kazakov expounded in
news:1qcb6z4i20dyb.1dz2hd4c0vx69.dlg@40tude.net: 

> On Mon, 10 May 2010 16:52:18 +0000 (UTC), Warren wrote:
> 
>> Dmitry A. Kazakov expounded in
>> news:zvtps4jzmo1z$.mzhapf4p7b4a.dlg@40tude.net: 
>> 
>>> On Mon, 10 May 2010 15:48:19 +0000 (UTC), Warren wrote:
>>> 
>>>> Another thing that bugs me is that the Ada.Text_IO
>>>> will not return a LF character (like getchar() in C).
>>> 
>>> Why should it? It is a text I/O not a stream I/O.
>> 
>> But if I recall correctly, I also cannot get an
>> empty string as input. An empty string is still
>> valid input.
> 
> Hmm, try this:

Ok, good- that at least works. 

But you have no way to know when you've read 
a empty line in a lexer routine that is reading 
character by character. 

What you end up having to do is to
test for line number changes instead-- yuk.
Then if you need that null line, you have to
back fill it with extra code. More guk.

But your point about "stream i/o" is a good
one. Perhaps it is just my bad for using the
wrong tool.

>>> C's I/O is a disaster, 
>> 
>> You have only listed an opinion when you don't 
>> list specifics.
> 
> Did you used it? 

For at least a few decades. ;-)

> Character input returns integer

In C, that is a feature. The macro EOF is
defined as (int)(-1), which is something that
is never read into a char (unless perhaps
you use a silly signed char type).

> , file is a number,

Ever heard of stdin (0), stdout (1) or stderr (2)?
Of course you have.  From the shell, you can also
do:

  ./myprog 7<my_input 8>aux_output

and from within a C program, you would intuitively
do I/O with units 7 and 8 (in addition to the "standard"
0, 1 and 2 units). Not many people think past the
"standard units", but they are usable when required.

They're not Ada type safe obviously (as int), but
is otherwise "in C terms" just fine.

> sometimes a pointer, 

If you do buffered I/O, you use an "object". Ada 
supports objects too - but you know that already.

> do you use  fseek or lseek? 

That is easy-- if you look at the parameters. Oh and
there is another giveaway -- most of those FILE * 
routines start with the letter "f".  Not a perfect
convention, but effective all the same.

> Is errno thread safe

It wasn't when threads first came on the scene, but 
is definitely so now. That is precisely why you must:

  #include <errno.h>

instead of the old fashioned:

  extern int errno;

So there was a technology change. That doesn't render the
C I/O system as a "disaster". If you want to say that you
"don't like it", then I can accept that.  That's different ;-)

As a design foundation for all those Unix, Linux and *BSD 
platforms, I don't think you can call it a disaster. In fact 
even MS o/s's (and IBM's O/S2) have implimented their own 
versions of this posix paradyme.

>> C of course did
>> the same thing, except that they made formatting a string
>> easier.
> 
> Easier? It is untyped! 

No, no, no "said the fish as he lit to the Cat in the Hat".

You exaggerate. It is not strongly typed like Ada, but
by George, there are "types" in C.  You can think of C
differentiating on the basis of "base" types. 

I once programmed in "B" a very long time ago. Everything 
was a "word" or a float type (2 types). That just is about 
as close to "untyped" as you can get AFAIK.

> There is no thing worse than that. We
> constantly fight with catching:
> 
>    printf ("%s", X);
> 
> X is an object of the type having implicit conversion to const * for
> output purpose.

Modern versions of gcc does catch most of these abuses.
But I agree that lacks the strengths that Ada does have.

But you've taken my point to the rediculous instead of 
discussing my point about formatting data. I just cited
one common and concrete formatting instance that gets 
used in C frequently, that you cannot do in Ada "out 
of the box".

>>> I wonder why people paying so much attention to
>>> admittedly broken and misplaced formatting of Ada.Text_IO in the
>>> times of GUIs. It won't work anyway. It is not a text anymore.
>> 
>> Do you enter a picture when login to your favourite GUI
>> system? A wave file for your password?  We still depend 
>> a lot on Text. Look at any database- it's not all about
>> blobs.
> 
> No, it is, for instance, about columned output of fixed point numbers
> in proportional font aligned along the decimal point...

And what goes into that font drawing call? Text. Yes, you
can mess with proportional fonts if you like, but it isn't 
always that way.  In fact, there are many instances where
proportional fonts are a curse. I frequently look for ways
to undo this "modern feature".

Warren



  reply	other threads:[~2010-05-10 18:50 UTC|newest]

Thread overview: 154+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2010-05-06 17:10 for S'Image use Func?? Warren
2010-05-06 17:23 ` Dmitry A. Kazakov
2010-05-06 20:05   ` Warren
2010-05-06 17:58 ` Adam Beneschan
2010-05-06 19:52   ` Warren
2010-05-07  8:12     ` stefan-lucks
2010-05-08  5:26       ` Stephen Leake
2010-05-10 15:16       ` Charmed Snark
2010-05-07  2:10   ` Randy Brukardt
2010-05-07 18:24     ` Keith Thompson
2010-05-06 18:14 ` Yannick Duchêne (Hibou57)
2010-05-06 20:04   ` Warren
2010-05-06 20:19     ` Robert A Duff
2010-05-06 20:56       ` Yannick Duchêne (Hibou57)
2010-05-06 21:11         ` Robert A Duff
2010-05-07  8:40           ` J-P. Rosen
2010-05-07 12:21             ` Robert A Duff
2010-05-07 13:37               ` Georg Bauhaus
2010-05-07 14:25                 ` Robert A Duff
2010-05-07 15:46                   ` Yannick Duchêne (Hibou57)
2010-05-07 17:38                     ` Dmitry A. Kazakov
2010-05-07 20:15                       ` Yannick Duchêne (Hibou57)
2010-05-07 20:28                         ` Jeffrey R. Carter
2010-05-07 21:16                           ` Randy Brukardt
2010-05-07 22:18                             ` Jeffrey R. Carter
2010-05-09  0:06                               ` Randy Brukardt
2010-05-09  0:31                                 ` Jeffrey R. Carter
2010-05-07 20:31                     ` Robert A Duff
2010-05-07 20:51                       ` Yannick Duchêne (Hibou57)
2010-05-07 21:07                         ` Robert A Duff
2010-05-07 21:25                       ` Randy Brukardt
2010-05-07 22:16                       ` Jeffrey R. Carter
2010-05-10 15:48                   ` Warren
2010-05-10 16:31                     ` Dmitry A. Kazakov
2010-05-10 16:52                       ` Warren
2010-05-10 17:55                         ` Dmitry A. Kazakov
2010-05-10 18:50                           ` Warren [this message]
2010-05-10 19:20                             ` Niklas Holsti
2010-05-10 20:16                               ` Warren
2010-05-10 20:38                                 ` Simon Wright
2010-05-10 20:52                                   ` Warren
2010-05-11 17:38                                     ` Jeffrey R. Carter
2010-05-11 18:19                                       ` Yannick Duchêne (Hibou57)
2010-05-11 20:36                                       ` Warren
2010-05-11  7:34                                 ` Niklas Holsti
2010-05-11  7:56                                   ` Yannick Duchêne (Hibou57)
2010-05-11 16:56                                     ` Warren
2010-05-13 18:53                                     ` Niklas Holsti
2010-05-11 16:49                                   ` Warren
2010-05-11  8:26                             ` Dmitry A. Kazakov
2010-05-11  9:49                               ` J-P. Rosen
2010-05-11 17:06                                 ` Warren
2010-05-12  5:00                                   ` J-P. Rosen
2010-05-12 14:39                                     ` Yannick Duchêne (Hibou57)
2010-05-12 16:52                                       ` Warren
2010-05-13 18:20                                     ` Niklas Holsti
2010-05-17 10:00                                       ` J-P. Rosen
2010-05-20  9:31                                         ` Niklas Holsti
2010-05-21  6:56                                           ` Niklas Holsti
2010-05-11 14:27                               ` Robert A Duff
2010-05-11 15:03                                 ` Dmitry A. Kazakov
2010-05-11 15:45                                   ` Yannick Duchêne (Hibou57)
2010-05-11 15:23                               ` Yannick Duchêne (Hibou57)
2010-05-11 16:59                                 ` Dmitry A. Kazakov
2010-05-11 17:05                               ` Warren
2010-05-11 17:54                                 ` Dmitry A. Kazakov
2010-05-11 20:50                                   ` Charmed Snark
2010-05-11 19:03                                 ` Yannick Duchêne (Hibou57)
2010-05-11 20:53                                   ` Warren
2010-05-10 20:56                           ` Maciej Sobczak
2010-05-10 20:24                             ` Georg Bauhaus
2010-05-11  7:42                               ` Maciej Sobczak
2010-05-10 21:30                             ` Ludovic Brenta
2010-05-11  8:35                               ` Dmitry A. Kazakov
2010-05-11 13:35                                 ` Maciej Sobczak
2010-05-11 14:24                                   ` Dmitry A. Kazakov
2010-05-11 20:18                                     ` Maciej Sobczak
2010-05-11 21:46                                       ` Dmitry A. Kazakov
2010-05-12 13:16                                         ` Maciej Sobczak
2010-05-12 14:33                                           ` Yannick Duchêne (Hibou57)
2010-05-12 15:58                                           ` Dmitry A. Kazakov
2010-05-12 22:14                                             ` Maciej Sobczak
2010-05-13  7:31                                               ` Dmitry A. Kazakov
2010-05-13 13:16                                                 ` Warren
2010-05-14 21:03                                                 ` Maciej Sobczak
2010-05-15  8:35                                                   ` Dmitry A. Kazakov
2010-05-15 20:50                                                     ` Maciej Sobczak
2010-05-16  7:48                                                       ` Dmitry A. Kazakov
2010-05-16 20:56                                                         ` Maciej Sobczak
2010-05-16 21:31                                                           ` Dmitry A. Kazakov
2010-05-11 15:56                                 ` Yannick Duchêne (Hibou57)
2010-05-11 17:15                                   ` Dmitry A. Kazakov
2010-05-11 18:48                                     ` Yannick Duchêne (Hibou57)
2010-05-10 22:24                             ` Yannick Duchêne (Hibou57)
2010-05-11  7:58                               ` Maciej Sobczak
2010-05-11 15:54                                 ` Yannick Duchêne (Hibou57)
2010-05-11 20:23                                   ` Maciej Sobczak
2010-05-10 22:39                             ` Yannick Duchêne (Hibou57)
2010-05-11 17:17                               ` Warren
2010-05-11 17:59                                 ` Dmitry A. Kazakov
2010-05-11 20:56                                   ` Warren
2010-05-11 22:06                                     ` Dmitry A. Kazakov
2010-05-12 13:27                                       ` Warren
2010-05-12 16:03                                         ` Dmitry A. Kazakov
2010-05-11 18:57                                 ` Yannick Duchêne (Hibou57)
2010-05-11 21:08                                   ` Warren
2010-05-11 19:56                               ` Gautier write-only
2010-05-12 13:33                                 ` Warren
2010-05-07 15:35                 ` Yannick Duchêne (Hibou57)
2010-05-07 20:33                   ` Robert A Duff
2010-05-07 21:27                     ` Randy Brukardt
2010-05-07 21:36                       ` Robert A Duff
2010-05-07 22:09                       ` Yannick Duchêne (Hibou57)
2010-05-09  0:17                         ` Randy Brukardt
2010-05-07 19:56               ` J-P. Rosen
2010-05-07 20:14                 ` Robert A Duff
2010-05-07 20:17                 ` Yannick Duchêne (Hibou57)
2010-05-07 20:41                   ` Robert A Duff
2010-05-06 21:20         ` Dmitry A. Kazakov
2010-05-10 15:26       ` Ada & gdb (was: for S'Image use Func??) Warren
2010-05-10 18:02         ` John B. Matthews
2010-05-10 19:52           ` Warren
2010-05-06 22:33     ` for S'Image use Func?? Jeffrey R. Carter
2010-05-06 23:22       ` Yannick Duchêne (Hibou57)
2010-05-07  2:17         ` Randy Brukardt
2010-05-07 12:27           ` Robert A Duff
2010-05-07 15:19             ` Yannick Duchêne (Hibou57)
2010-05-07 20:19               ` Robert A Duff
2010-05-07 21:11             ` Randy Brukardt
2010-05-10 16:05             ` Warren
2010-05-19  6:26               ` Randy Brukardt
2010-05-07 15:21           ` Yannick Duchêne (Hibou57)
2010-05-10 16:03       ` Warren
2010-05-06 18:50 ` Jeffrey R. Carter
2010-05-06 19:50   ` Warren
2010-05-06 20:22     ` Robert A Duff
2010-05-06 21:25       ` Dmitry A. Kazakov
2010-05-07  2:20         ` Randy Brukardt
2010-05-07  7:28           ` Dmitry A. Kazakov
2010-05-07 10:15         ` Stephen Leake
2010-05-07 15:07           ` Yannick Duchêne (Hibou57)
2010-05-08  5:38             ` Stephen Leake
2010-05-07 19:29           ` Simon Wright
2010-05-07 20:10             ` Robert A Duff
2010-05-07 19:44               ` Georg Bauhaus
2010-05-07 20:53                 ` Robert A Duff
2010-05-07 21:59               ` Simon Wright
2010-05-09  0:20                 ` Randy Brukardt
2010-05-07  8:53 ` Georg Bauhaus
2010-05-10 16:18   ` Warren
2010-05-10 17:54     ` Georg Bauhaus
2010-05-10 19:57       ` Warren
2010-05-10 19:09     ` Yannick Duchêne (Hibou57)
2010-05-10 20:01       ` Warren
replies disabled

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