comp.lang.ada
 help / color / mirror / Atom feed
From: mfeldman@seas.gwu.edu (Michael Feldman)
Subject: Re: GNAT-Problem Set_Line(), Set_Col()
Date: 16 Nov 1994 21:50:49 -0500
Date: 1994-11-16T21:50:49-05:00	[thread overview]
Message-ID: <3aege9$bhn@felix.seas.gwu.edu> (raw)
In-Reply-To: CzC5AG.65A@alsys.com

In article <CzC5AG.65A@alsys.com>, Keith Thompson <kst@alsys.com> wrote:
>In <3aari4$jlc@felix.seas.gwu.edu> mfeldman@seas.gwu.edu (Michael Feldman) writes:
>
>Well, I'd like to think of myself as an "Ada Wise Person".  8-)}

Of course!

>On some targets, you might want type Integer to be only 16 bits (this
>was probably more true in 1983 than it is now, but it's still allowable).
>Having Text_IO blow up on text files longer than 32767 lines would have
>been A Bad Thing (though I suppose that, with careful implementation,
>it wouldn't necessarily blow up unless you try to set or query the
>current line number).

>Overuse of the predefined types is considered (by many) to be bad style
>anyway, since it weakens Ada's strong type checking.  It's too bad when
>that checking complains about something that's actually safe, but that's
>the price we pay for having the compiler detect more of our mistakes.

Well, certainly. This is the standard lecture we give each other about 
the predefined types - indeed, I've given it a number of times myself. :-)

But as Norm Cohen pointed out, it is not obvious that Line and Col
are of the _same_ type. And it's easy to see, in this context, why
some folks have complained that the index type of String is Positive.
I agree that files should be allowed have more than 32767 lines; by 
that argument, why restrict Strings to 32767 characters? I think 
that a consistent approach would have been much clearer and easier 
to justify to others. 

Oh well. In the order of things, it's a small issue, just fun to 
debate on the net. :-)

Thanks for setting it out, Keith.

Mike Feldman
------------------------------------------------------------------------
Michael B. Feldman -  chair, SIGAda Education Working Group
Professor, Dept. of Electrical Engineering and Computer Science
The George Washington University -  Washington, DC 20052 USA
202-994-5919 (voice) - 202-994-0227 (fax) - mfeldman@seas.gwu.edu (Internet)
------------------------------------------------------------------------
         Ada on the World-Wide Web: http://lglwww.epfl.ch/Ada/
------------------------------------------------------------------------
"Non illegitimi carborundum." (Don't let the bastards grind you down.)
------------------------------------------------------------------------



      reply	other threads:[~1994-11-17  2:50 UTC|newest]

Thread overview: 10+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
1994-11-01 14:28 GNAT-Problem Set_Line(), Set_Col() Andreas Krohn
1994-11-12 15:49 ` Robert Dewar
1994-11-15 13:30 ` Norman H. Cohen
1994-11-15 17:36   ` Michael Feldman
1994-11-15 19:10     ` Tucker Taft
1994-11-15 22:41       ` Michael Feldman
1994-11-16  0:04     ` Norman H. Cohen
1994-11-16 13:48       ` Robert Dewar
1994-11-16  0:56     ` Keith Thompson
1994-11-17  2:50       ` Michael Feldman [this message]
replies disabled

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