comp.lang.ada
 help / color / mirror / Atom feed
* Overloading and / or / = / etc etc
@ 2001-06-13 20:14 Phil Foran
  2001-06-13 20:45 ` Carbonne Damien
  2001-06-13 20:50 ` Ted Dennison
  0 siblings, 2 replies; 7+ messages in thread
From: Phil Foran @ 2001-06-13 20:14 UTC (permalink / raw)


Hi all,

In the package im currently working on, ive got two lines which both use a
standard operator (one is an 'or' the other is a '=') but they are using
overloaded versions from two other packages.  The problem is that the two
other packages which contain the overloaded 'or' and '=' each contain a
different overloaded '=' and 'or' causing problems and ambiguity when
compiling.

Im wondering if there is a way to do PACKAGEX.= or PACKAGEY.or, when i try
these i just get syntax errors, but im sure there must be a way to do it.

If anyone knows the syntax for what i need, please let me know

Thanx in advance!

Phil





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

* Re: Overloading and / or / = / etc etc
  2001-06-13 20:14 Overloading and / or / = / etc etc Phil Foran
@ 2001-06-13 20:45 ` Carbonne Damien
  2001-06-13 20:50 ` Ted Dennison
  1 sibling, 0 replies; 7+ messages in thread
From: Carbonne Damien @ 2001-06-13 20:45 UTC (permalink / raw)


Phil Foran a �crit :

> Hi all,
>
> In the package im currently working on, ive got two lines which both use a
> standard operator (one is an 'or' the other is a '=') but they are using
> overloaded versions from two other packages.  The problem is that the two
> other packages which contain the overloaded 'or' and '=' each contain a
> different overloaded '=' and 'or' causing problems and ambiguity when
> compiling.
>
> Im wondering if there is a way to do PACKAGEX.= or PACKAGEY.or, when i try
> these i just get syntax errors, but im sure there must be a way to do it.
>

try PACKAGEX."="(x, y) or PACKAGEY."or"(x, y)

>
> If anyone knows the syntax for what i need, please let me know
>
> Thanx in advance!
>
> Phil




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

* Re: Overloading and / or / = / etc etc
  2001-06-13 20:14 Overloading and / or / = / etc etc Phil Foran
  2001-06-13 20:45 ` Carbonne Damien
@ 2001-06-13 20:50 ` Ted Dennison
  2001-06-13 21:31   ` Mark Lundquist
  1 sibling, 1 reply; 7+ messages in thread
From: Ted Dennison @ 2001-06-13 20:50 UTC (permalink / raw)


In article <9g8hj6$o3t$1@dns3.cae.ca>, Phil Foran says...
>Im wondering if there is a way to do PACKAGEX.= or PACKAGEY.or, when i try
>these i just get syntax errors, but im sure there must be a way to do it.

packagex."=" (Identifier_1, Identifier_2);

..to be exact.


Most people consider this unspeakably ugly. You may need it. Then again, you may
not. Where exactly is the ambiguity comming from? I don't suppose you could show
us the line with the syntax error and the two function definitions, could you?
We might be able to point out a better way out of the problem. One other
possibility would be to decrease the scope of your "use" or "use type"
statements so that only the appropriate one applies at each place. If you do
truly need the full dot notation, I'd say that those two packages should
probably be rethought.

---
T.E.D.    homepage   - http://www.telepath.com/dennison/Ted/TED.html
          home email - mailto:dennison@telepath.com



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

* Re: Overloading and / or / = / etc etc
  2001-06-13 20:50 ` Ted Dennison
@ 2001-06-13 21:31   ` Mark Lundquist
  2001-06-14  9:32     ` Jacob Sparre Andersen
  0 siblings, 1 reply; 7+ messages in thread
From: Mark Lundquist @ 2001-06-13 21:31 UTC (permalink / raw)



"Ted Dennison" <dennison@telepath.com> wrote in message
news:HmQV6.7405$pb1.285708@www.newsranger.com...

> I don't suppose you could show
> us the line with the syntax error and the two function definitions, could
you?
> We might be able to point out a better way out of the problem.

I'd second that, Phil.  The fact that you think "or" can be overloaded (it
can't, really) makes me think that the real problem might turn out to be a
little different than the way you described it.  TED is right -- we can tell
you the syntax for fully qualifying "=", but posting some source code with
interleaved compiler error messages would help us make sure you aren't
barking up the wrong tree.

Mark Lundquist






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

* Re: Overloading and / or / = / etc etc
  2001-06-13 21:31   ` Mark Lundquist
@ 2001-06-14  9:32     ` Jacob Sparre Andersen
  2001-06-14 10:25       ` Phil Foran
  0 siblings, 1 reply; 7+ messages in thread
From: Jacob Sparre Andersen @ 2001-06-14  9:32 UTC (permalink / raw)


Mark:

> I'd second that, Phil.  The fact that you think "or" can be overloaded (it
> can't, really)

According to 4.5(2-7), 6.1(9-10) and 6.6(1), the operator "or" _can_ be
overloaded. The only operator for which special rules apply is "/=".

Jacob
-- 
"Any, sufficiently complicated, experiment is indistinguishable from magic."



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

* Re: Overloading and / or / = / etc etc
  2001-06-14  9:32     ` Jacob Sparre Andersen
@ 2001-06-14 10:25       ` Phil Foran
  2001-06-14 10:51         ` David C. Hoos, Sr.
  0 siblings, 1 reply; 7+ messages in thread
From: Phil Foran @ 2001-06-14 10:25 UTC (permalink / raw)


Hrm, it seems that someone called Mark responded to my post, but for some
reason i only see Jacob's response.... if anyone actually posted how to do
it.. could they mail me the answer instead :)

Thanx!
Jacob Sparre Andersen <sparre@nbi.dk> wrote in message
news:3B2884C0.175B4DC9@nbi.dk...
> Mark:
>
> > I'd second that, Phil.  The fact that you think "or" can be overloaded
(it
> > can't, really)
>
> According to 4.5(2-7), 6.1(9-10) and 6.6(1), the operator "or" _can_ be
> overloaded. The only operator for which special rules apply is "/=".
>
> Jacob
> --
> "Any, sufficiently complicated, experiment is indistinguishable from
magic."





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

* Re: Overloading and / or / = / etc etc
  2001-06-14 10:25       ` Phil Foran
@ 2001-06-14 10:51         ` David C. Hoos, Sr.
  0 siblings, 0 replies; 7+ messages in thread
From: David C. Hoos, Sr. @ 2001-06-14 10:51 UTC (permalink / raw)


What you need to do is use regulate function notation instead of
infix operator notation -- e.g.

Packagex."=" (expression_1, expression_2)

(copy mailed to Phil Foran)

"Phil Foran" <pforan@cae.com> wrote in message
news:9ga3ed$oeb$1@dns3.cae.ca...
> Hrm, it seems that someone called Mark responded to my post, but for some
> reason i only see Jacob's response.... if anyone actually posted how to do
> it.. could they mail me the answer instead :)
>
> Thanx!
> Jacob Sparre Andersen <sparre@nbi.dk> wrote in message
> news:3B2884C0.175B4DC9@nbi.dk...
> > Mark:
> >
> > > I'd second that, Phil.  The fact that you think "or" can be overloaded
> (it
> > > can't, really)
> >
> > According to 4.5(2-7), 6.1(9-10) and 6.6(1), the operator "or" _can_ be
> > overloaded. The only operator for which special rules apply is "/=".
> >
> > Jacob
> > --
> > "Any, sufficiently complicated, experiment is indistinguishable from
> magic."
>
>



-----= Posted via Newsfeeds.Com, Uncensored Usenet News =-----
http://www.newsfeeds.com - The #1 Newsgroup Service in the World!
-----==  Over 80,000 Newsgroups - 16 Different Servers! =-----



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

end of thread, other threads:[~2001-06-14 10:51 UTC | newest]

Thread overview: 7+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2001-06-13 20:14 Overloading and / or / = / etc etc Phil Foran
2001-06-13 20:45 ` Carbonne Damien
2001-06-13 20:50 ` Ted Dennison
2001-06-13 21:31   ` Mark Lundquist
2001-06-14  9:32     ` Jacob Sparre Andersen
2001-06-14 10:25       ` Phil Foran
2001-06-14 10:51         ` David C. Hoos, Sr.

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