Simkin Expressions

Simkin supports the following expression types:

TypeDescriptionExample
literala literal value of one of the built-in data types"Simon", 100
selfa reference to the object owning the methodanotherObject.register(self)
nullan object meaning "nothing"if (node=null)
identifierthis is the name of a variable or method, see below for scoping rulesMyVariable
indirectionyou can prepend the identifier with @ to provide indirection@MyVariable
attributethis accesses an attribute in another objectAccount:Balance
fieldthis accesses a field or method in another object, or a sub-item within a fieldAccount.getPerson().Surname
self method callcalling a method on the current object and using the return valuesendMessage(message)
notnegates an expressionnot Overdrawn
andlogical andOverdrawn and WithinRedZone
orlogical orDepositAccount or CurrentAccount
equalityequality testName="Simon"
inequalityinequality testName!="Simon"
less thaninteger less thana lt b
greater thaninteger greater thana gt b
subtractinteger subtract12 - 1
addinteger addition12 + 1
minusinteger inversion- 1
timesinteger multiplication12 * 1
divideinteger division12 / 1
modulusinteger modulus12 % 1
concatenationadding two strings together"First Name " # " Surname"
subexpressionfor grouping expressions and enforcing precedence(4+1)+5