comp.lang.ada
 help / color / mirror / Atom feed
From: "Dmitry A. Kazakov" <mailbox@dmitry-kazakov.de>
Subject: Re: Bus error
Date: Sat, 30 Jun 2007 16:31:16 +0200
Date: 2007-06-30T16:30:35+02:00	[thread overview]
Message-ID: <rafli94244kb.1mv2c2jms21ne.dlg@40tude.net> (raw)
In-Reply-To: 4686432a$0$14873$9b4e6d93@newsspool4.arcor-online.net

On Sat, 30 Jun 2007 13:52:22 +0200, Georg Bauhaus wrote:

> Dmitry A. Kazakov wrote:
>> On Fri, 29 Jun 2007 21:37:43 -0400, Robert A Duff wrote:
> 
>> If you have
>> 
>>    X1 : String renames Get_Line;
>>    X2 : String renames Get_Line;
>>    X3 : String renames Get_Line;
>> 
>> the effect will be X1, X2, X3 all different objects. This should not be
>> called renaming.
>  
> There happen to be no explicit arguments in the function calls.
> Does the same reasoning apply to
> 
>     X1 : String renames Get_Line(Foo);
>     X2 : String renames Get_Line(Bar);
>     X3 : String renames Get_Line(Baz, Mode => Frobnicate);

These examples show that the concept is just wrong. The above creates some
anonymous objects in background and then renames them. How to rename
something that does not have any name?

>> But when I do:
>> 
>>    X : Element renames Collection (Key);
>> 
>> I'd like to be certain that X indeed renames a container's element.
> 
> Then I think there is a problem of choosing the right name for
> what you have called Collection here.

Collection is a container, like an array, Key is an index. Is this better:

   Slice : String renames Line (10..20);

>> package My_IO is
>>    ...
>>    with new Ada.Text_IO.Integer_IO (...);
>>       -- Merge all declarations from this instance with My_Io's public
>>       -- and private parts
> 
> Which IMHO defeats the purpose of well designed packages: focus on one
> thing. (A two dozen years old package like Text_IO formed around various
> assumptions might serve to construct an exception.)
> Why not use interfaces when you need to lump things together? Do you have
> a few convincing examples that show how the decoupling of modules should
> be "improved" with a mechanism of merging them into one? (That is, of
> importing and reexporting declarations of entire packages.)

Yes, I have examples. You can take a look at 

http://www.dmitry-kazakov.de/ada/fuzzy.htm

and figure out how to instantiate a network of generic packages kicked off
by just one actual generic parameter (floating-point type).

Soon you will package that all in bundle packages like:

generic -- Just instantiates things
   type (Number) is ...;
package Bundle is
   package X1 is new Foo (Number);
   package X2 is new X1.Bar;
   package X4 is new X1.Baz (X2.Bar);
   package X5 is new X4...;
   ...
end Bundle;

These proxy packages introduce new names like X1, X2 etc which nobody
actually needs. To "use" Bundle is meaningless. You have to use those Xn
from there. If you have 20 generic packages and 5 different instantiation,
the result is a horribly mess. I would reward with the Nobel Prize anybody
who could propose a working naming convention schema for these Xn.

-- 
Regards,
Dmitry A. Kazakov
http://www.dmitry-kazakov.de



  parent reply	other threads:[~2007-06-30 14:31 UTC|newest]

Thread overview: 51+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
     [not found] <0367891DA5DA7E408D42A860FA002F44B0CC48@sma2901.cr.eurocopter.corp>
2007-06-29  9:35 ` AW: Bus error Duncan Sands
2007-06-29 12:55   ` Dmitry A. Kazakov
2007-06-29 15:37     ` Markus E Leypold
2007-06-29 15:44     ` Georg Bauhaus
2007-06-29 20:07       ` Dmitry A. Kazakov
2007-06-30  1:37         ` Robert A Duff
2007-06-30  8:44           ` Dmitry A. Kazakov
2007-06-30 11:52             ` Georg Bauhaus
2007-06-30 13:16               ` Georg Bauhaus
2007-06-30 14:31               ` Dmitry A. Kazakov [this message]
2007-06-30 18:07                 ` Georg Bauhaus
2007-06-30 19:31                   ` Robert A Duff
2007-07-01  9:07                   ` Dmitry A. Kazakov
2007-06-30 15:40               ` Robert A Duff
2007-06-30 17:54                 ` Georg Bauhaus
2007-07-02  8:01           ` Jean-Pierre Rosen
2007-07-02 12:00             ` Dmitry A. Kazakov
2007-07-02 12:30               ` Jean-Pierre Rosen
2007-07-02 14:22             ` Robert A Duff
2007-06-30 13:14         ` Georg Bauhaus
2007-06-30 14:31           ` Dmitry A. Kazakov
2007-06-30 15:34             ` Robert A Duff
2007-07-01  8:34               ` Dmitry A. Kazakov
2007-07-01 15:39                 ` Robert A Duff
2007-07-01 19:41                   ` Dmitry A. Kazakov
2007-06-30 15:29           ` Robert A Duff
2007-06-30 17:41             ` Georg Bauhaus
2007-06-30 13:31         ` Markus E Leypold
2007-07-02  0:16           ` Robert A Duff
2007-06-29  9:23 AW: " Grein, Christoph (Fa. ESG)
2007-06-29 10:17 ` Dmitry A. Kazakov
  -- strict thread matches above, loose matches on Subject: below --
2007-06-27 14:23 Maciej Sobczak
2007-06-27 15:45 ` Georg Bauhaus
2007-06-27 17:19   ` Maciej Sobczak
2007-06-28  1:58     ` Robert A Duff
2007-06-28 20:06       ` Maciej Sobczak
2007-06-28 21:19         ` Robert A Duff
2007-06-29  8:05           ` Maciej Sobczak
2007-06-29  9:42             ` Georg Bauhaus
2007-06-29 16:59               ` Adam Beneschan
2007-06-30 12:33                 ` Georg Bauhaus
2007-06-30  2:02             ` Robert A Duff
2007-06-29  8:04         ` Dmitry A. Kazakov
2007-06-27 20:02 ` Anh Vo
2007-06-27 20:48   ` Maciej Sobczak
2007-06-28  2:01     ` Robert A Duff
1990-08-27 23:48 BUS ERROR J o s e D u a r t e ! ! !
1990-08-16 14:52 saharbaugh%roo.dnet
1990-08-13 21:11 J o s e D u a r t e !!!
1990-08-10 12:32 bus error saharbaugh%roo.dnet
1990-08-09 14:50 saharbaugh%roo.dnet
1990-08-10 21:38 ` Chuck Peterson
replies disabled

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