comp.lang.ada
 help / color / mirror / Atom feed
From: "Marin David Condic, 561.796.8997, M/S 731-96" <condicma@PWFL.COM>
Subject: Re: Text_IO for other standard types
Date: 1998/01/20
Date: 1998-01-20T00:00:00+00:00	[thread overview]
Message-ID: <98012009510954@psavax.pwfl.com> (raw)


Robert Dewar <dewar@MERV.CS.NYU.EDU> writes:
>I strongly dislike the magic cooking recipe approach. Yes, you can get
>students to accept it, but in my opinion damage is done since you
>compromise the critical principle that people should understand what
>they are doing.
>
    When the students in question are a) engineers and/or b) have
    experience with some other language (usually Fortran or Basic, in
    my venue) they typically won't sit still for "just use this and
    don't question it." Hence you look for ways of avoiding discussing
    generic instantiation until you've gotten them comfortable with
    the basics.

>Fortunately, there is a perfectly comfortable way to deal with this, which
>is to use the Image attribute, so people can write
>
>        My_Type'Image (val)
>
>Sure, you don't get nice formatting that way, but you can leave nice
>formatting for later.

    I've used this approach for the really introductory part of my
    course. You don't have to explain anything more serious than "with
    Text_IO/use Test_IO" and the associated Get_Line/Put_Line calls.
    It seems to be acceptable and you can show your garden variety
    engineer how to code up a little program to compute Y = M * X + B
    and it is only slightly more complicated than a Fortran
    equivalent. Maybe less so since you've got to deal with Fortran's
    I/O and that isn't a whole lot simpler than Get/Put with 'Image
    and 'Value. In any case the attributes are a big help in getting
    the students familiar with the basics.

>
>Note that the extension of Image to cover floating-point types is a nice
>improvement for this style of teaching.
>
    Yeah Verrily and Forsooth! I am eternally grateful for getting the
    'Image attribute on floating-point types. I'd like to see it
    available for just about any type but I have no notion as to how
    tough it would be to implement for compound types. (This would be
    useful for quick&dirty data dumps when debugging or producing
    throwaway hacks)

>This is certainly not a big deal, but I see no reason for introducing
>magic cookbook formulae when it is unnecessary.
>
    I like using the attributes to get around cookbook rituals, but I
    still have a problem when I eventually have to get to explaining
    Text_IO. The usual reaction is that Text_IO is painful. (I won't
    argue technical merit - that's just the standard issue response:
    "Why does this have to hurt so bad?") What I would *like* to do is
    be able to explain Text_IO without having to simultaneously
    explain generic instantiation. So if you had a useful set of
    predefined types and predefined instantiations of the generic I/O
    packages for all the predefined types and this was standard Ada
    (to avoid "this only works in my class because I gave you some
    code") it would be a lot easier to explain. I could approach it
    from the standpoint of: with/use the appropriate packages for the data
    types in question and you will get the following I/O procedures
    available...

    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
=============================================================================
    "A verbal contract isn't worth the paper it's written on."
        --  Samuel Goldwyn
=============================================================================




             reply	other threads:[~1998-01-20  0:00 UTC|newest]

Thread overview: 28+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
1998-01-20  0:00 Marin David Condic, 561.796.8997, M/S 731-96 [this message]
1998-01-21  0:00 ` Text_IO for other standard types Jean-Pierre Rosen
  -- strict thread matches above, loose matches on Subject: below --
1998-01-19  0:00 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 ` Nick Roberts
1998-01-15  0:00 ` Robert Dewar
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-17  0:00 ` Jean-Pierre Rosen
1998-01-17  0:00   ` Robert Dewar
1998-01-18  0:00     ` Michael F Brenner
1998-01-12  0:00 Marin David Condic, 561.796.8997, M/S 731-96
1998-01-09  0:00 Marin David Condic, 561.796.8997, M/S 731-96
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-10  0:00 ` Nick Roberts
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
replies disabled

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