comp.lang.ada
 help / color / mirror / Atom feed
From: tmoran@acm.org
Subject: Re: 'Write attribute vs Write procedure.
Date: Wed, 21 May 2003 16:24:43 GMT
Date: 2003-05-21T16:24:43+00:00	[thread overview]
Message-ID: <fLNya.61770$rt6.23929@sccrnsc02> (raw)
In-Reply-To: 7vk7ck7iwc.fsf@vlinux.voxelvision.no

>>   Personally, I think using the default 'write is only reasonable
>> in the very simplest cases.  If something is big, or complicated,
>> I'd write my own 'write for it.
>
>Yes, but that removes much of the attraction of using a stream in the
>first place. It should only be necessary to do your own write if you
>wanted another representation of it in the external format.  A prime
>example of rendering a very nice feature of the language pretty much
>unusable because of a poor implementation.

  I disagree.  It is convenient when you use it that you needn't
distinguish between a 'write that will write in a canonical, vs a special
external format.  In the OP's case, it was probably simpler to get the
program up and running with the standard 'write, rather than having to
make his own, and then worry about doing something special as a matter of
performance tuning.

You also still have use at a higher level, eg
  type Sound_Bytes is record
    Time  : Ada.Calendar.Time;
    Audio : Wave;
    Title : String(1 .. 10);
  end record;
If you have a special Wave'write, you can say
  Sound_Bytes'write
and it will do the standard thing for Time and Name but call your
special routine for Audio, so you probably don't need to make your
own Sound_Bytes'write.  At it's own abstraction level, Sound_Bytes is
neither big nor complicated, so you probably don't need a special 'write.



  parent reply	other threads:[~2003-05-21 16:24 UTC|newest]

Thread overview: 26+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2003-05-21  0:07 'Write attribute vs Write procedure Jano
2003-05-21  0:42 ` tmoran
2003-05-21  7:48   ` Ole-Hjalmar Kristensen
2003-05-21  9:23   ` Ole-Hjalmar Kristensen
2003-05-21 16:22     ` tmoran
2003-05-22  7:51       ` Ole-Hjalmar Kristensen
2003-05-21 16:24     ` tmoran [this message]
2003-05-21 21:17     ` Simon Wright
2003-05-22  8:02       ` Ole-Hjalmar Kristensen
2003-05-22 13:49       ` Marc A. Criley
2003-05-22 20:07         ` Simon Wright
2003-05-23  6:09   ` Craig Carey
2003-05-23 19:55     ` Simon Wright
2003-05-23 20:48       ` AI-248 and counting the elements in an external file Larry Kilgallen
2003-05-23 21:12         ` Stephen Leake
2003-05-23 21:45           ` Randy Brukardt
2003-05-24  1:45             ` Larry Kilgallen
2003-05-24 22:00               ` Robert I. Eachus
2003-05-25  3:54                 ` Larry Kilgallen
2003-05-27 20:19                   ` Randy Brukardt
2003-05-27 20:57                     ` Larry Kilgallen
2003-05-28 18:26                       ` Randy Brukardt
2003-05-24  1:42           ` Larry Kilgallen
2003-05-28 21:17             ` Brian Gaffney
2003-05-28 22:06               ` Larry Kilgallen
2003-05-24 14:11 ` 'Write attribute vs Write procedure Craig Carey
replies disabled

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