From: "Marin David Condic, 561.796.8997, M/S 731-96" <condicma@PWFL.COM>
Subject: Text_IO for other standard types
Date: 1998/01/09
Date: 1998-01-09T00:00:00+00:00 [thread overview]
Message-ID: <98010912585349@psavax.pwfl.com> (raw)
So we have a standard type Integer and a corresponding package
Ada.Integer_Text_IO. We have a standard type Float and a
corresponding package Ada.Float_Text_IO. We have a standard type
Boolean but no corresponding package Ada.Boolean_Text_IO? Or for
that matter, the standard type Duration and no
Ada.Duration_Text_IO.
Oh sure, I can make my own declarations for these things and its
pretty trivial. But it seems like it would be good to have all
this stuff in one place - under the parent package Ada. (I don't
believe it is legal for the end user to extend the package Ada.
GNAT chokes on attempts to do so...) Would it be a bad idea to
require a Ada.xxx_Text_IO package for any predefined elementary
type xxx? I think it would make life easier and would simplify
things for a student just starting out learning the language.
And a related matter: Would it be difficult to implement an
attribute 'Image for composite types? (At least arrays and records
- pretty hard to figure out what this would mean for tasks and
protected types.) The idea being if you want to implement some
debug code or error handling code in which you want to output a
message like: "Found a faulty input record: xxxxx" getting an
ascii image for quick&dirty error checking would be pretty handy.
Handy without dramatically altering the language or imposing undue
burden on the compiler.
And while we're at it, would there be some food value in requiring
a few extra predefined types? I'm thinking of predefined Modular
types similar to predefined Integer types and possibly some
convenient Decimal Fixed Point types (most commonly used for
money, I suppose).
My reasoning for having these and their corresponding predefined
I/O instantiations is that it would make the language easier to
teach. Generics and even to some extent type declarations
themselves can be inaccessible to the beginning programmer or a
programmer familiar only with more primitive languages. Having
predefined types for modular numbers would enable one to teach or
discuss modular math & build simple programs to illustrate this
without having to delve into the heavier concepts of type
definition or generic instantiation.
It doesn't sound to me like this would be a difficult extension to
Ada and the only potential problem I would anticipate would be the
possibility of collisions with existing name usage. Any thoughts
on this subject? Good idea? Bad idea? Hmmmm?
MDC
Marin David Condic, Senior Computer Engineer Voice: 561.796.8997
Pratt & Whitney GESP, M/S 731-95, P.O.B. 109600 Fax: 561.796.4669
West Palm Beach, FL, 33410-9600 Internet: CONDICMA@PWFL.COM
=============================================================================
"I filled out an application that said, 'In Case Of Emergency
Notify'. I wrote 'Doctor'... What's my mother going to do?"
-- Steven Wright
=============================================================================
next reply other threads:[~1998-01-09 0:00 UTC|newest]
Thread overview: 30+ messages / expand[flat|nested] mbox.gz Atom feed top
1998-01-09 0:00 Marin David Condic, 561.796.8997, M/S 731-96 [this message]
1998-01-10 0:00 ` Text_IO for other standard types Nick Roberts
1998-01-10 0:00 ` Tarjei T. Jensen
1998-01-10 0:00 ` Robert Dewar
1998-01-11 0:00 ` Tarjei T. Jensen
1998-01-11 0:00 ` Robert Dewar
1998-01-11 0:00 ` Robert Dewar
1998-01-12 0:00 ` Tarjei T. Jensen
1998-01-11 0:00 ` Jean-Pierre Rosen
1998-01-14 0:00 ` Dale Stanbrough
1998-01-14 0:00 ` Robert Dewar
1998-01-14 0:00 ` Tarjei T. Jensen
1998-01-14 0:00 ` Robert Dewar
1998-01-15 0:00 ` Speeding up Text_IO Nick Roberts
1998-01-16 0:00 ` Robert Dewar
-- strict thread matches above, loose matches on Subject: below --
1998-01-12 0:00 Text_IO for other standard types Marin David Condic, 561.796.8997, M/S 731-96
1998-01-15 0:00 Marin David Condic, 561.796.8997, M/S 731-96
1998-01-15 0:00 ` Robert Dewar
1998-01-16 0:00 ` Nick Roberts
1998-01-16 0:00 ` Robert Dewar
1998-01-17 0:00 ` Geert Bosch
1998-01-17 0:00 ` Robert Dewar
1998-01-15 0:00 ` Robert Dewar
1998-01-15 0:00 ` Nick Roberts
1998-01-17 0:00 ` Jean-Pierre Rosen
1998-01-17 0:00 ` Robert Dewar
1998-01-18 0:00 ` Michael F Brenner
1998-01-19 0:00 Marin David Condic, 561.796.8997, M/S 731-96
1998-01-20 0:00 Marin David Condic, 561.796.8997, M/S 731-96
1998-01-21 0:00 ` Jean-Pierre Rosen
replies disabled
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox