Re: limited types (Was: Records that could be arrays)



On Sat, 25 Feb 2006 15:05:02 GMT, Matthew Heaney wrote:

"Dmitry A. Kazakov" <mailbox@xxxxxxxxxxxxxxxxx> writes:

I think that there should also be [limited] containers of limited types.
For this we need a construction model, which would allow user-defined
in-place constructors. After all Ada has always had arrays of limited
components. We have to extend this model onto user-defined containers.

But you can pass in an Initialize procedure as a parameter of an insertion
operation, to perform whatever initialization needs to be done.

You mean "return .. do" for limited types. It is in-place, but a
constructing function does not have safety of a constructor. Then you
cannot ask it from the type, so it can't have a default [deduced from the
type.] It is not dispatching in Insert. What about container of
class-wides, i.e. when Node_Type should have ET'Class?

.... and of course passing pointers to functions is ugly.

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