comp.lang.ada
 help / color / mirror / Atom feed
* User defined boolean
@ 2000-10-29  0:41 Daniel Allex
  2000-10-29  1:22 ` Ken Garlington
  2000-10-30  1:02 ` DuckE
  0 siblings, 2 replies; 6+ messages in thread
From: Daniel Allex @ 2000-10-29  0:41 UTC (permalink / raw)


I created a type PASS_FLAG that is an enumeration type of FAIL and
PASS.  I have seven funtions that each return PASS_FLAG, and I wanted to
AND them together an print out the result.  My flag wont work with
either AND or "+".  Can this be done or should I just use the predefined
boolean.  I had reasons for defining my own enumeration type.




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

* Re: User defined boolean
  2000-10-29  0:41 User defined boolean Daniel Allex
@ 2000-10-29  1:22 ` Ken Garlington
  2000-10-30  1:02 ` DuckE
  1 sibling, 0 replies; 6+ messages in thread
From: Ken Garlington @ 2000-10-29  1:22 UTC (permalink / raw)



"Daniel Allex" <dallex@erols.com> wrote in message
news:39FB723B.25D05446@erols.com...
: I created a type PASS_FLAG that is an enumeration type of FAIL and
: PASS.  I have seven funtions that each return PASS_FLAG, and I wanted to
: AND them together an print out the result.  My flag wont work with
: either AND or "+".  Can this be done or should I just use the predefined
: boolean.  I had reasons for defining my own enumeration type.
:

When you say "my flag won't work with AND," I assume you mean that it won't
work with the "and" function defined for Boolean. Since Pass_Flag is of a
different type than Boolean, then you probably shouldn't expect it to work
when called with values of type Pass_Flag. Have you tried declaring an "and"
function for Pass_Flag?

(P.S. It may help if you post a sample package describing what you are
trying to do...)





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

* Re: User defined boolean
  2000-10-29  0:41 User defined boolean Daniel Allex
  2000-10-29  1:22 ` Ken Garlington
@ 2000-10-30  1:02 ` DuckE
  2000-10-30  1:58   ` Robert Dewar
  1 sibling, 1 reply; 6+ messages in thread
From: DuckE @ 2000-10-30  1:02 UTC (permalink / raw)


You can certainly override the built in AND and OR operations to work for
your new type:

   type Pass_Flag is (Fail, Pass);

   function "AND" ( Left, Right : Pass_Flag ) return Boolean is
   begin
      return (Left = Pass) and (Right = Pass);
   end "AND";

   function "OR" ( Left, Right : Pass_Flag ) return Boolean is
   begin
      return (Left = Pass) or (Right = Pass);
   end "OR";

SteveD

"Daniel Allex" <dallex@erols.com> wrote in message
news:39FB723B.25D05446@erols.com...
> I created a type PASS_FLAG that is an enumeration type of FAIL and
> PASS.  I have seven funtions that each return PASS_FLAG, and I wanted to
> AND them together an print out the result.  My flag wont work with
> either AND or "+".  Can this be done or should I just use the predefined
> boolean.  I had reasons for defining my own enumeration type.
>





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

* Re: User defined boolean
  2000-10-30  1:02 ` DuckE
@ 2000-10-30  1:58   ` Robert Dewar
  2000-10-31  3:56     ` DuckE
  0 siblings, 1 reply; 6+ messages in thread
From: Robert Dewar @ 2000-10-30  1:58 UTC (permalink / raw)


In article <3N3L5.30691$E85.782438@news1.sttls1.wa.home.com>,
  "DuckE" <nospam_steved94@home.com> wrote:
> You can certainly override the built in AND and OR operations
> to work for your new type:

Bad terminology! This has nothing whatsoever to do with
overriding, since surely there ARE no AND/OR operations
for the type, so what the above *should* say is simply

"You can certainly define AND and OR operations to work for
 your new type (whatever your definition of working might be!)"



Sent via Deja.com http://www.deja.com/
Before you buy.



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

* Re: User defined boolean
  2000-10-30  1:58   ` Robert Dewar
@ 2000-10-31  3:56     ` DuckE
  2000-10-31 19:48       ` Robert Dewar
  0 siblings, 1 reply; 6+ messages in thread
From: DuckE @ 2000-10-31  3:56 UTC (permalink / raw)


You're absolutely right!  I meant to say "overload" not "override".

SteveD

"Robert Dewar" <robert_dewar@my-deja.com> wrote in message
news:8tikk1$g7q$1@nnrp1.deja.com...
> In article <3N3L5.30691$E85.782438@news1.sttls1.wa.home.com>,
>   "DuckE" <nospam_steved94@home.com> wrote:
> > You can certainly override the built in AND and OR operations
> > to work for your new type:
>
> Bad terminology! This has nothing whatsoever to do with
> overriding, since surely there ARE no AND/OR operations
> for the type, so what the above *should* say is simply
>
> "You can certainly define AND and OR operations to work for
>  your new type (whatever your definition of working might be!)"
>
>
>
> Sent via Deja.com http://www.deja.com/
> Before you buy.





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

* Re: User defined boolean
  2000-10-31  3:56     ` DuckE
@ 2000-10-31 19:48       ` Robert Dewar
  0 siblings, 0 replies; 6+ messages in thread
From: Robert Dewar @ 2000-10-31 19:48 UTC (permalink / raw)


In article <VprL5.34497$E85.876306@news1.sttls1.wa.home.com>,
  "DuckE" <nospam_steved94@home.com> wrote:

> You're absolutely right!  I meant to say "overload" not
> "override".

Ah yes, sorry, I should have figured that out, and yes, of
course overload is exactly the right term!


Sent via Deja.com http://www.deja.com/
Before you buy.



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

end of thread, other threads:[~2000-10-31 19:48 UTC | newest]

Thread overview: 6+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2000-10-29  0:41 User defined boolean Daniel Allex
2000-10-29  1:22 ` Ken Garlington
2000-10-30  1:02 ` DuckE
2000-10-30  1:58   ` Robert Dewar
2000-10-31  3:56     ` DuckE
2000-10-31 19:48       ` Robert Dewar

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