comp.lang.ada
 help / color / mirror / Atom feed
* Composing sequences (interesting to solve)
@ 2003-01-16  3:01 Victor Porton
  2003-01-16 18:20 ` Dmitry A. Kazakov
                   ` (3 more replies)
  0 siblings, 4 replies; 8+ messages in thread
From: Victor Porton @ 2003-01-16  3:01 UTC (permalink / raw)


See an interesting and yet unsolved by me practical task to solve:

I have "elements" of various kinds (Base_Element'Class):

type Base_Element is null record;

There are many various types of element derived from
Base_Element. Some of these contain accesses to other
elements (which I allocate by "new"), so that this forms
trees.

To eliminate access types conversions I decided to limit
myself to use only Base_Element_Access (not accesses to
derived types) (BTW, Is it right design decision?):

type Base_Element_Access is access Base_Element'Class;

One of the types of elements is "sequence" (it is an ordered
container of elements):

type Sequence is new Base_Element with private;

I wish to produce sequences (allocated dynamically) by such
the syntax using overloaded function "&":

E1 & E2 & E3

The question is how to define function "&" so that it would
give the right result (access to one dynamically allocated
sequence) independingly on the number of elements?



^ permalink raw reply	[flat|nested] 8+ messages in thread

end of thread, other threads:[~2003-01-18 12:31 UTC | newest]

Thread overview: 8+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2003-01-16  3:01 Composing sequences (interesting to solve) Victor Porton
2003-01-16 18:20 ` Dmitry A. Kazakov
2003-01-16 20:09 ` Victor Porton
2003-01-17  8:27   ` Fraser Wilson
2003-01-17 16:27   ` Dmitry A. Kazakov
2003-01-17 20:45 ` Victor Porton
2003-01-17 21:04 ` Victor Porton
2003-01-18 12:31   ` Dmitry A. Kazakov

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