comp.lang.ada
 help / color / mirror / Atom feed
From: "Randy Brukardt" <randy@rrsoftware.com>
Subject: Re: String_Holder ?
Date: Mon, 19 Dec 2011 17:53:52 -0600
Date: 2011-12-19T17:53:52-06:00	[thread overview]
Message-ID: <jcoiqi$m6u$1@munin.nbi.dk> (raw)
In-Reply-To: slrnjerndj.1lme.lithiumcat@sigil.instinctive.eu

"Natasha Kerensikova" <lithiumcat@gmail.com> wrote in message 
news:slrnjerndj.1lme.lithiumcat@sigil.instinctive.eu...
...
> Assuming it does make sense, am I right in thinking it's better to have
> such a type, even if it's a thin wrapper around Unbounded_String,
> instead of using directly Unbounded_String?

What exactly is the advantage of your Holder type over Unbounded_String 
(other than shorter operation names :-)?

   function Hold (S : String) return String_Holder; seems to be the same as 
function To_Unbounded_String. A renames would do the trick nicely.

   function To_String (Holder : String_Holder) return String; seems to be 
the same as function To_String, don't even need to rename that.

   procedure Query (Holder : String_Holder;
                 Process : not null access procedure (S : String));
       would be trivial to write in terms of To_String, and would be more 
expensive than using To_String directly.

So I don't understand the point -- and you clearly need a reason to write a 
new package here rather than using the built-in one.

                                                    Randy. 





  parent reply	other threads:[~2011-12-19 23:53 UTC|newest]

Thread overview: 13+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2011-12-18 12:34 String_Holder ? Natasha Kerensikova
2011-12-18 16:48 ` Brad Moore
2011-12-18 20:55 ` Jeffrey Carter
2011-12-18 23:08   ` Natasha Kerensikova
2011-12-19 12:14     ` Niklas Holsti
2011-12-19 11:12 ` Martin
2011-12-19 23:53 ` Randy Brukardt [this message]
2011-12-22  9:08   ` Natasha Kerensikova
2011-12-22 10:08     ` Niklas Holsti
2011-12-22 12:23       ` Simon Wright
2011-12-23  1:26       ` Randy Brukardt
2011-12-23  6:18         ` Jeffrey Carter
2011-12-22 11:40     ` AdaMagica
replies disabled

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