-
Notifications
You must be signed in to change notification settings - Fork 1
Bio Expression Operations
For logical operations you can use and or or tokens. As in following examples:
car.year_of_production > 2015 or car.fuel_efficiency < 12.4
car.is_sport_car and (car.producer = "BMW" or car.max_speed >= 200)
car.engine.engine_type != "vee" or car.producer = "BMW"
For arithmetic operations you can use standard symbols. As in following examples:
car.base_price * 1.12
car.base_price * distributer.interest - government.vat
1 + 2 * ( 45 / 5) / 3 - 28
2 ^ 32 - 2 ^ 30
Note that * and + can also be used by strings. As in following examples:
(car.name + " ") * 5
"Mr." + driver.name + " " + driver.lastname
You can also use between syntax for checking in range. As in following example:
4 < car.engine.cylinders <= 6 and car.fuel_efficiency < 15.4
You can negate boolean results by !
symbol. As in following example:
!(car.is_sport_car or car.max_speed > 200)
!car.is_sport_car
Exists operator is used to check whether Bio Object has a tag value or not. As in following example:
?car.engine and !?car.engine.cylinders
car.engine.is_started and !?driver
Tag operator is used to indicate tag of a Bio Object or a function call be instead of tag name. As in following examples:
car.engine.cylinders > 4
car.engine.calculateHp()
Index operators can be used to indicate index of array or list. As in following example:
car.seats[2].position
plane.engines[3].is_started