comp.lang.ada
 help / color / mirror / Atom feed
From: dewar@merv.cs.nyu.edu (Robert Dewar)
Subject: Re: Float -> String conversion?
Date: 1997/05/24
Date: 1997-05-24T00:00:00+00:00	[thread overview]
Message-ID: <dewar.864473326@merv> (raw)
In-Reply-To: gauthier-1605971054200001@193.50.185.13


Dale said

>>  There are two ways that i know of that you can convert from a float
>>  to a string.
>>
>>          Float'image  - which is in x.xxxxExx format
>>          Ada.Float_Text_IO.Put
>>
>>  ...but Text_IO is a rather large beast, and many people say
>>  that 'no one ever really uses text_io for _real_ work'.
>>
>>  If this is the case, then how could one portably convert a float
>>  to a string?

Michel replies

 I agree with the idea that Ada.text_IO is harmful :
  - device-dependent,
  - didactically obsolete,
  - mixing of disk keeping and user interface.
  - using disk files implies opening 'standard' files.

 To work around the problem, I systematically add to all value
 (number-like) types a package for string<-> value conversion
 (the specification mimics predefined attributes and Text_IO
 subprograms) :

Robert notes

  I don't understand what Michel means in his criticisms, Text_IO is
  not device dependent at the abstract level, and there is nothing
  about disk files.

  And more importantly neither of these has the slightest bit of
  relevance to the Put to a string which is what Dale was talking
  about, which has nothing to do with devices or disks.

  Dale, it is perfectly reasonable to use Text_IO for this purpose,
  use Put to a string, formatting things however you like.

  As for "didactically obsolete", I can't even guess what that might
  mean. And as for "mixing of disk keeping and user interface", I
  do not see that Text_IO has anything to do with either, but maybe
  that is just a language problem (disk keeping really doesn't mean
  anything in English!) Perhaps the "didactically" is also a language
  problem. Didactically means to do with teaching, and the purpose
  of Text_IO has nothing to do with teaching, it is for outputting
  text!





      reply	other threads:[~1997-05-24  0:00 UTC|newest]

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
1997-05-14  0:00 Float -> String conversion? Dale Stanbrough
1997-05-16  0:00 ` Michel Gauthier
1997-05-24  0:00   ` Robert Dewar [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