Types in Clay are implicit and inferred by the use of variables and expressions.
The language supports the following types.
String literals are delimited by the "
character.
var st = "Lorem ipsum" // literal
var st = "A" + "Certain" + "Regard" // concatenation
Numeric is used for all types of numbers.
var x = 42 // numeric literal
var y = (12 + x * 2) / 3 // math operators
Boolean can have either true or false value.
// boolean literals
var a = true
var b = false
// boolean operators
var c = a && !b
The literal nil
is used to denote the absence of a value
var x
if (x == nil) {
// x is not definited
}
Function references are used to represent coordinates of methods (functions) in the code being analysed, typically to look for places where these methods are called.
var myRef = @System.assert{1}
// References the method assert with arity 1 in the class System
A function reference is made of the following parts: