In Java, one would use the instanceof
in order to check if an object is of the same type (or class-wide type) as another object. For instance, if we have the class Peach
and an object peach
, it would through the following:
if (peach instanceof Peach)
System.out.println("peach is of type Peach!");
... execute the statement above into the terminal.
From what I remember, in Ada, there is something along the lines of is in
, as in that some object is inside a certain class-wide set. Brilliantly enough, however, I cannot seem to find information on the subject for the purpose of this question. Last time I used the is in
, I couldn't get it to work. As such, I decided to ask the question on here instead.
Any pointers as to how comparison of tagged types might be done in a similar manner to that of Java's instanceof
would be very helpful!
just in
, not is in
if Foo in Peach'Class then
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With