comp.lang.ada
 help / color / mirror / Atom feed
From: spambox@volja.net
Subject: Re: advice on package design
Date: 8 Mar 2005 04:48:41 -0800
Date: 2005-03-08T04:48:41-08:00	[thread overview]
Message-ID: <1110286121.068133.82160@l41g2000cwc.googlegroups.com> (raw)
In-Reply-To: 1gbk0qx2sgzpg$.sltzfssofla8$.dlg@40tude.net

Dmitry A. Kazakov wrote:

> There are many different ways to deal with that. If you have

Dmitry, thank you very much for you help; this is the second time that
you've posted elaborate answers to my problems. I apreciate it.

> 2. You can instantiate your Baz outside Foo but with the things
defined in
> the public part of Foo:

> Note that the body of Foo may still use Baz:

My thoughts on this solution: the package would have to know how the
user chose to instantiate another package, so that it could use the
same name. On the other hand, let's say the package came with
instructions as to how the package it depends on should be
instantiated. However, that would leave the user no choice for the name
and effectively we would get something similar to your first solution.
I find this approach better; the package `a' comes with instructions,
directing the user to "use" something that was instantiated in `a' with
the same name, of course. Sure, it could also be renamed later.

> 2.a. If Bar needs privates of Foo, the you can make Bar a generic
child of
> Foo.

I have yet to investigate this one.

> 3. You can rename parts of contents of Baz in Foo:

At present, this is the accepted solution. It seems to me that it's
also the most logical for ada? Since we're forced to follow the rules
of strong typing, then it's only logical to have different subroutines
for each type. There are only less than ten subroutines in my linked
lists package, so renaming then was easy. Besides, the program becomes
clearer (in the end, that's what ada encourages us to do, right?) --
now, for example, we can use a word_walk subroutine for word lists, and
eg. node_walk for all the others. Agreed, a good idea.

andrej
--
http://sonet.homelinux.net




  reply	other threads:[~2005-03-08 12:48 UTC|newest]

Thread overview: 28+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2005-03-07 16:23 advice on package design spambox
2005-03-07 21:08 ` Dmitry A. Kazakov
2005-03-08 12:48   ` spambox [this message]
2005-03-08 17:18     ` Dmitry A. Kazakov
2005-03-12 19:57   ` Robert A Duff
2005-03-12 20:45     ` Dmitry A. Kazakov
2005-03-12 21:59       ` Robert A Duff
2005-03-13  9:23         ` Dmitry A. Kazakov
2005-03-16 20:41           ` Robert A Duff
2005-03-17 10:22             ` Dmitry A. Kazakov
2005-03-17 14:04               ` Robert A Duff
2005-03-17 15:59                 ` Dmitry A. Kazakov
2005-03-17 19:10                   ` Robert A Duff
2005-03-17 19:47                     ` Martin Dowie
2005-03-17 20:55                       ` Robert A Duff
2005-03-17 21:14                         ` Marius Amado Alves
2005-03-18  9:31                           ` Martin Dowie
2005-03-18  9:38                         ` Martin Dowie
2005-03-21 16:19                           ` Robert A Duff
2005-03-17 20:48                     ` Dmitry A. Kazakov
2005-03-17 21:26                       ` Robert A Duff
2005-03-18  3:06                         ` Jared
2005-03-18 10:00                         ` Dmitry A. Kazakov
2005-03-21 16:17                           ` Robert A Duff
2005-03-21 18:16                             ` Dmitry A. Kazakov
2005-03-21 20:35                               ` Robert A Duff
2005-03-22 10:55                                 ` Dmitry A. Kazakov
2005-03-17 23:23                 ` Randy Brukardt
replies disabled

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