comp.lang.ada
 help / color / mirror / Atom feed
From: Brian Rogoff <bpr@shell5.ba.best.com>
Subject: Re: Ada95 tutorials with sample code.
Date: Sat, 10 Mar 2001 16:30:11 GMT
Date: 2001-03-10T16:30:11+00:00	[thread overview]
Message-ID: <Pine.BSF.4.21.0103100816280.6132-100000@shell5.ba.best.com> (raw)
In-Reply-To: <x7v3dco23gt.fsf@smaug.pushface.org>

On 8 Mar 2001, Simon Wright wrote:
> Robert A Duff <bobduff@world.std.com> writes:
> 
> > Ted Dennison<dennison@telepath.com> writes:
> > 
> > > The common example used is Ada.Strings.Unbounded.To_Unbounded_String. Even I
> > > have to admit this looks stupid. However, I'd claim that the stupidity is
> > > entirely a result of stupid naming on the designers part. They quite easily
> > > could have named the routine Ada.Strings.Unbounded.To, ...
> > 
> > Is this supposed to be an example of a name that works well both with
> > and without use clauses?  Yikes.
> 
> This is an example of a name that was intended to work with 'use'. I
> think that most of the Ada hierarchy is like that ..
> 
> > >...rather than repeating the
> > > names of two parent packages in the subprogram's identifier.
> > 
> > I think it's repeating the name of a *type*, not packages.
> 
> Similarly, I've just done a Great renaming on the Booch Components
> (http://www.pushface.org/components/bc/), replacing types like
> BC.Containers.Collections.Unbounded.Unbounded_Collection by
> BC.Containers.Collections.Unbounded.Collection (OK, these are generic

I'd go further and make it BC.Containers.Collections.Unbounded.T. Something like 
this style is used in Modula-3 libraries, and I've seen it in older Ada
libraries and in C. It has the great advantage that it should suit a "use
free" style (I'll refrain from the usual pejorative "use-phobe" :) and
carries less noise in such a style than the usual repeated long name. 

FWIW, I like use, but I generally write code in a use-free style. I detest
"use type", and think it is a hack on Ada to placate fanatics who claim
it's awful and then want to use it with operators and thus make operators
"special". Now the "with type" proposal is asymmetric, great. 

> My_Library_Unit.Unbounded_Collection). This was a change forced by
> actually trying to _use_ my own work ..

Very punny! Seriously, I agree that that'll get you to reevaluate options
quickly.

-- Brian





  reply	other threads:[~2001-03-10 16:30 UTC|newest]

Thread overview: 34+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2001-03-05 20:40 Ada95 tutorials with sample code mcdoobie
2001-03-05 20:58 ` Erik Sigra
2001-03-06  2:45 ` Jeffrey Carter
2001-03-06  7:12   ` Sven Nilsson
2001-03-06  8:09     ` tmoran
2001-03-06 10:38     ` David C. Hoos, Sr.
2001-03-06 15:06       ` Ted Dennison
2001-03-06 10:38     ` David C. Hoos, Sr.
2001-03-06 15:29     ` Robert A Duff
2001-03-06 16:54       ` Ted Dennison
2001-03-06 15:48     ` Ted Dennison
2001-03-06 18:19       ` Robert A Duff
2001-03-06 21:19         ` Ted Dennison
2001-03-08  6:13         ` Simon Wright
2001-03-10 16:30           ` Brian Rogoff [this message]
2001-03-06 18:20     ` Jean-Pierre Rosen
2001-03-06 20:10       ` Erik Sigra
2001-03-07 14:31         ` Simon Pilgrim
2001-03-06 21:47       ` Ted Dennison
2001-03-07  0:11     ` Robert C. Leif, Ph.D.
2001-03-07  6:44     ` Jeffrey Carter
2001-03-07  6:46     ` use-clause Anders Wirzenius
2001-03-07 18:13       ` use-clause Jean-Pierre Rosen
2001-03-07  7:54     ` Ada95 tutorials with sample code Sven Nilsson
2001-03-07 15:10       ` Marin David Condic
2001-03-08  0:05       ` Mark Lundquist
2001-03-06 15:03   ` Marin David Condic
2001-03-06 14:31 ` BSCrawford
2001-03-06 22:38   ` mcdoobie
  -- strict thread matches above, loose matches on Subject: below --
2001-03-06 23:51 Beard, Frank
2001-03-06 23:58 Beard, Frank
     [not found] <01030621102401.00302@a77>
2001-03-07 12:09 ` Mario Amado Alves
     [not found] <Pine.LNX.4.10.10103071153320.971-100000@lexis.di.fct.unl.pt>
2001-03-07 13:12 ` Erik Sigra
2001-03-07 18:07   ` Jean-Pierre Rosen
replies disabled

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