comp.lang.ada
 help / color / mirror / Atom feed
From: AdaMagica <christ-usch.grein@t-online.de>
Subject: Re: overloading operators
Date: Wed, 21 Nov 2018 05:50:03 -0800 (PST)
Date: 2018-11-21T05:50:03-08:00	[thread overview]
Message-ID: <fd28a26b-2271-4df0-978c-e24c9dc8b066@googlegroups.com> (raw)
In-Reply-To: <3e2acd57-a8c6-4e89-8d69-572cf4396aec@googlegroups.com>

Am Mittwoch, 21. November 2018 10:56:09 UTC+1 schrieb hn...@yahoo.de:
> How can I use the old and the overloaded operator at the same time in the same program for the same type?
> For example: Overloaded  "*" defined by user for type Real_Matrix and "*" defined in package Numerics.Real_Arrays for Real_Matrix.

For the nomenclature:
If I understand correctly what you're saying, it's not overloading, but overriding what you're doing.
If you defined a function "*" for type Real_Matrix in a package of your own, say Pack, the corresponding operation in the package where Real_Matrix is defined, here Ada.Numerics, is hidden from direct and use visibility in Pack. You can make it visible again via an extended name.
So which "*" is visible at certain place depends on the kind of visibility of Pack and Ada.Numerics. With proper name qualification, both are callable at the same place in code.


  parent reply	other threads:[~2018-11-21 13:50 UTC|newest]

Thread overview: 11+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2018-11-21  9:56 overloading operators hnptz
2018-11-21 11:28 ` Jeffrey R. Carter
2018-11-21 13:50 ` AdaMagica [this message]
2018-11-21 13:52   ` AdaMagica
2018-11-21 16:39   ` hnptz
2018-11-21 17:37     ` Simon Wright
2018-11-22  8:18       ` briot.emmanuel
2018-11-22 11:39         ` Simon Wright
2018-11-26 17:47         ` Anh Vo
2018-11-26 18:03           ` Simon Wright
2018-11-26 18:24             ` Dmitry A. Kazakov
replies disabled

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