From: "Randy Brukardt" <randy@rrsoftware.com>
Subject: Re: Gnat bug or mistaken program?
Date: Wed, 28 Jul 2021 19:46:04 -0500 [thread overview]
Message-ID: <sdstod$qjo$1@franka.jacob-sparre.dk> (raw)
In-Reply-To: imaos8Fii64U1@mid.individual.net
"Niklas Holsti" <niklas.holsti@tidorum.invalid> wrote in message
news:imaos8Fii64U1@mid.individual.net...
>I disagree with Jeffrey's opinion on what is a reasonable solution here.
>More in-line below.
You're being too hard on Jeff. See below.
....
>> * Use package: this makes everything in the package visible
>>
>> Use pkg is clearly overkill for this case,
>
> I disagree. If the code uses several operators from the package, a "use
> package" is apt (because "use type" does not apply here), but should of
> course be as local as possible.
For general advice, this makes some sense, but in this specific case, there
is only one operator in this package so one of the other options makes more
sense than dragging in several dozen other names. Indeed, if there are
multiple uses of the operator, I'd probably use an expression function to
make the operator locally visible (this is similar to renames, using the
fullly qualified name). I'd only use a use package if there are many
routines in the package that are commonly used and well-understood from the
prespective of the system (GEF may be that for some systems, so perhaps I'm
being too hard on you. :-).
Side-issue: declaring operators that aren't primitive (so use-type doesn't
work) is suspicious. In most cases, operators belong with the type so that
they have the same visibility. The "**" for floats doesn't really belong in
GEF, it was put there for practical reasons (rather than good design) -- as
it is rather complex to describe and implement and isn't commonly used.
Randy.
prev parent reply other threads:[~2021-07-29 0:46 UTC|newest]
Thread overview: 9+ messages / expand[flat|nested] mbox.gz Atom feed top
2021-07-20 12:02 Gnat bug or mistaken program? Richard Iswara
2021-07-20 14:09 ` Niklas Holsti
2021-07-21 2:23 ` Richard Iswara
2021-07-21 8:29 ` Jeffrey R. Carter
2021-07-21 16:56 ` Shark8
2021-07-22 2:14 ` Richard Iswara
2021-07-27 16:00 ` Niklas Holsti
2021-07-28 5:21 ` J-P. Rosen
2021-07-29 0:46 ` Randy Brukardt [this message]
replies disabled
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox