comp.lang.ada
 help / color / mirror / Atom feed
* [Q] Renaming negation operator in Ada 83
@ 1999-04-22  0:00 .
  1999-04-22  0:00 ` Martin Dowie
  1999-04-23  0:00 ` Robert Dewar
  0 siblings, 2 replies; 3+ messages in thread
From: . @ 1999-04-22  0:00 UTC (permalink / raw)


I can't find the answer to this in the LRM.  I'd like to rename the negation
operator (unary -) in order to avoid a 'use' clause.  I can manage to rename
the subtraction operator but I don't know how to do it with the negation
operator.  Can someone tell me how it can be done, if it can be done?

TIA









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

* Re: [Q] Renaming negation operator in Ada 83
  1999-04-22  0:00 [Q] Renaming negation operator in Ada 83 .
@ 1999-04-22  0:00 ` Martin Dowie
  1999-04-23  0:00 ` Robert Dewar
  1 sibling, 0 replies; 3+ messages in thread
From: Martin Dowie @ 1999-04-22  0:00 UTC (permalink / raw)


same as all the other renames, the difference with the subtract operator is
there is only 1 parameter e.g.

procedure main is
  package nested is
    type an_integer is range -10 .. 10;
  end nested;

  function "-" (x : in nested.an_integer) return nested.an_integer
    renames nested."-";

  a, b : nested.an_integer;

begin
  a := 10;
  b := -a;
end main;


"." wrote:

> I can't find the answer to this in the LRM.  I'd like to rename the negation
> operator (unary -) in order to avoid a 'use' clause.  I can manage to rename
> the subtraction operator but I don't know how to do it with the negation
> operator.  Can someone tell me how it can be done, if it can be done?
>
> TIA





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

* Re: [Q] Renaming negation operator in Ada 83
  1999-04-22  0:00 [Q] Renaming negation operator in Ada 83 .
  1999-04-22  0:00 ` Martin Dowie
@ 1999-04-23  0:00 ` Robert Dewar
  1 sibling, 0 replies; 3+ messages in thread
From: Robert Dewar @ 1999-04-23  0:00 UTC (permalink / raw)


In article
<AE5ACC620F3F9846.FD8655018AF11659.CE00E008C942945B@library
-proxy.airnews.net>,
  "." <nojunk@nospam-san.rr.com> wrote:
> I can't find the answer to this in the LRM.  I'd like to
rename the negation
> operator (unary -) in order to avoid a 'use' clause.

Much better approach in Ada 95, use a USE TYPE clause.
Even those allergic to use clauses find this acceptable :-)

-----------== Posted via Deja News, The Discussion Network ==----------
http://www.dejanews.com/       Search, Read, Discuss, or Start Your Own    




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

end of thread, other threads:[~1999-04-23  0:00 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
1999-04-22  0:00 [Q] Renaming negation operator in Ada 83 .
1999-04-22  0:00 ` Martin Dowie
1999-04-23  0:00 ` Robert Dewar

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