comp.lang.ada
 help / color / mirror / Atom feed
From: "Marin David Condic" <dont.bother.mcondic.auntie.spam@[acm.org>
Subject: Re: Ada Idioms Progress Preview
Date: Tue, 14 Aug 2001 11:33:41 -0400
Date: 2001-08-14T15:33:42+00:00	[thread overview]
Message-ID: <9lbgcm$c42$1@nh.pace.co.uk> (raw)
In-Reply-To: Cdbe7.947$2u.26361@www.newsranger.com

Yeah, I've seen that trick before and it is really handy. Maybe a tad beyond
what you want to teach a raw beginner at first, but certainly not that
complex that it can't be used. Using it as a parameter to
To_Unbounded_String can pretty much eliminate any problems with arbitrary
limits or worrying about string sizes.

The real string handling trick should be to illustrate one or more idioms
for dealing with strings across a range of applications. Sort of saying "The
Ada Way(tm)" for handling strings is to read them this way, manipulate them
this way, then write them this way. An idiom should be given for the fixed
strings and for things like Unbounded. Id est, if you always read in a
string and immediately converted to Unbounded and wrote all string
parameters, etc, as Unbounded and used To_String when heading for output,
that is one idiom for apps where speed is not an issue. Another idiom would
be to read them as fixed strings, but dynamically allocate them, then write
all parameters to expect "String_Ptr.all" and use the attributes. Obviously,
an Ada app gains something by always treating strings in *some* consistent
manner. Many are possible. What ought to be the "preferred" way?

MDC
--
Marin David Condic
Senior Software Engineer
Pace Micro Technology Americas    www.pacemicro.com
Enabling the digital revolution
e-Mail:    marin.condic@pacemicro.com
Web:      http://www.mcondic.com/


"Ted Dennison" <dennison@telepath.com> wrote in message
news:Cdbe7.947$2u.26361@www.newsranger.com...
>
> Martin Carlisle had a good solution for this, which is posted at AdaPower
at
> http://www.adapower.com/adacode.html. It uses recursion, but I don't think
the
> stack impact is much more than 2n where n is the string size.
>






  reply	other threads:[~2001-08-14 15:33 UTC|newest]

Thread overview: 41+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2001-08-03  4:16 Ada Idioms Progress Preview James Rogers
2001-08-03 19:45 ` Robert Dewar
2001-08-03 22:02   ` James Rogers
2001-08-06 22:33   ` Stanley R. Allen
2001-08-07  2:45     ` tmoran
2001-08-07 12:15       ` Larry Kilgallen
2001-08-07 13:26         ` Philip Anderson
2001-08-08  2:23         ` Robert Dewar
2001-08-08  5:58           ` Ehud Lamm
2001-08-08  2:19       ` Robert Dewar
2001-08-08 15:13         ` Ted Dennison
2001-08-08 18:03           ` tmoran
2001-08-09 20:36           ` Florian Weimer
2001-08-10 21:02         ` Jay Nabonne
2001-08-10 21:51           ` Larry Kilgallen
2001-08-13 14:19             ` Ted Dennison
2001-08-13 14:05           ` Ted Dennison
2001-08-13 14:19             ` Marin David Condic
2001-08-13 15:47             ` Ole-Hjalmar Kristensen
2001-08-13 16:22               ` Marin David Condic
2001-08-13 18:48               ` Larry Kilgallen
2001-08-14  7:05                 ` Ole-Hjalmar Kristensen
2001-08-13 20:20               ` James Rogers
2001-08-14  1:09                 ` Warren W. Gay VE3WWG
2001-08-14  6:15                   ` James Rogers
2001-08-14 14:03                     ` Warren W. Gay VE3WWG
2001-08-21  5:54                   ` C strings, was " David Thompson
2001-08-16 18:42                 ` Jay Nabonne
2001-08-17  1:25                   ` Robert Dewar
2001-08-13 21:47               ` Ted Dennison
2001-08-14  7:37                 ` Ole-Hjalmar Kristensen
2001-08-14 14:59                   ` Ted Dennison
2001-08-14 13:22                 ` Marin David Condic
2001-08-14 15:12                   ` Ted Dennison
2001-08-14 15:33                     ` Marin David Condic [this message]
2001-08-14  8:49               ` Lutz Donnerhacke
2001-08-14  9:38                 ` Ole-Hjalmar Kristensen
2001-08-14  9:54                   ` Lutz Donnerhacke
2001-08-14 14:51                     ` James Rogers
2001-08-14 16:44                   ` Darren New
2001-08-14  1:39             ` Slicing ( Ada Idioms Progress Preview ) Warren W. Gay VE3WWG
replies disabled

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