Firstly, that looks like Python.
Secondly, things like Tall aren't necessarily reflexive. Lets assume as a part of our syntax:
is
can be an infix operator that and sets an object attribute, eg. Jake is Tall
makes Jake.Tall True
is
can be a prefix operator that queris the precence of an attribute.
- Being over 185cm is tall
So lets begin:
Jake <= Person(name="Jake")
Jake is Tall
print(is Jake Tall)
>>> True
All is well, but this introduces problems.
print(Jake.height)
We know Jake is tall, but how tall is he?
Even again:
Jake <= Person(name="Jake",height=199)
Jake is Tall
print(is Jake Tall)
What do we print here?
Now, we've said Jake is less than 200cm, so he isn't Tall, but he've also explicitly stated that he is tall. We can start to introduce logic so that when we call Tall against a person we check the Tall
state or the height
attribute, but the logic incongruencies are difficult.
What you can do is similar to what Python does with its is
statement, and use it to check a state, rather than set it.
So we could go:
Jake <= Person(name="Jake",height=199)
if Jake is Tall {
print("How is the weather up there?")
} else {
print("Need a ladder?")
}
>>> Need a ladder?
This syntax could then just be a shorthand of Jake.isTall or any number of attribute checkers.
[p for p in people if p is tall]