-3

## Context

(I apologize for the technical programmery context. The root of the question is English though)

I have a static class method is that takes in some object and returns whether that object is of that type of class.

Using this method works like this:

Animal.is(dog)

Due to technical constraints, I can't swap the subject and object of the sentence to be 'dog is animal' meaning that animal must be the subject and dog must be the object.

Again, I apologize for all the technical context. The only reason I had to include it is explain why I need an inverse of 'be' in the first place.

Please try to ignore the technical context when answering the question.

Question

What word should I use in place of is (or any form of be) that acts like the inverse of is?

i.e. what would should I use in the sentence

"Animal ____ dog".

that holds the same meaning and truth as the following?

"A dog is an animal."

And to further clarify what I mean by truth:

"A dog is an animal." is a fact with some truth that could be tested like "If a dog is an animal...".

Now how can you form an English sentence that states the same fact expect where the subject and object are swapped. e.g. "An animal ____ a dog.", "If an animal ___ a dog...".

Is that possible? Does that even make sense?

(I also apologize if I'm not using the correct tag here. Feel free to edit for corrections).

closed as off-topic by Hot Licks, vickyace, TimLymington, Mari-Lou A, Scott Apr 3 '17 at 1:45

  • This question does not appear to be about English language and usage within the scope defined in the help center.
If this question can be reworded to fit the rules in the help center, please edit the question.

  • 2
    You have a poor concept of how objects and classes work. If you use "is" for your operator you will only get more confused. Try "instanceof" and "classof". – Hot Licks Mar 30 '17 at 18:20
  • 2
    (In English "is" is generally bidirectional, when context does not imply otherwise.) – Hot Licks Mar 30 '17 at 18:21
  • 3
    Can you use 'includes'? – Yosef Baskin Mar 30 '17 at 18:29
  • 3
    @HotLicks has it: Animal.is(fido) returns Dog, and fido instanceof Animal returns true. But the author Scott Myers says "Anytime you find yourself writing code of the form "if the object is of type T1, then do something, but if it's of type T2, then do something else," slap yourself." – Yorik Mar 30 '17 at 18:36
  • 3
    I'm voting to close this question as off-topic because it's about naming software operators, not writing English. – Hot Licks Mar 30 '17 at 19:55
2

A plain English word would be contains, so you could write:

Animal.contains(dog)

A more technical phrase would be is the class of, so you would write:

Animal.isClassOf(dog)

Or you could stick with is, and refer back to Bill Clinton -- it depends on what the meaning of is is. :)

2

As a general term - though it has a different meaning in C/C++ - you might like "include". While it's tempting to jump to object-oriented terminology, it's perfectly valid to think of subclasses as members of a set of implementers of a superclass. That is, to say that dogs and cats are animals is to say they are members of a set of all animals. Formally:

Dogs and Cats are Animals

Animals include Dogs and Cats.

For animals it might sound a bit weird, but it's more natural in context:

Some car manufacturers include Porsche and Audi.

If you can get away with two words (or jamming two words together) I also like "such as".

A Dog is an Animal

vs

Animals such as Dogs.

0

Have a look at what terms are used in Java; and using their terminology it would be :

An Animal [class] is assignment-compatible with a dog [or a cat] [object].

The Java community have spent an enormous amount time and resources naming their methods, so normally their terminology is a good starting point.

Quoting the relevant Java API definition, my emphasis:

public boolean isInstance(Object obj) Determines if the specified Object is assignment-compatible with the object represented by this Class. This method is the dynamic equivalent of the Java language instanceof operator. [...]


NOTE: This answer was written before question was updated to say: ... ignore the technical context when answering the question.

  • I'm looking for more of a general term that's not related to a programming language but thank you for the answer – Rico Kahler Mar 30 '17 at 22:18

Not the answer you're looking for? Browse other questions tagged or ask your own question.