:help
:reset
a = 2
a + 4
result = a + 4
result + 2
s1 = "Hello"
s2 = "World
res = s1 + " " + s2
a = BigInteger("3181293819812933132")
a + BigInteger("19239912399499124992")
a + 23912939219942192439494393949243
list = ArrayList()
list add 'first str'
list + 'second str'
list
list clear
list
newList = [1, 2, 3]
s=2
if s==2
print("s is 2")
else
print("s is not 2")
x = 3 ^ 2
z = 3/2 # 1
z = 3/2.0 # 1.4
num = 4
num << 1 # 8
Classes created with same name as function. Constructor has the fun
function.
fun isMoreThan2(o)
return o>2
isMoreThan2(1)
isMoreThan2(2)
isMoreThan2(3)
class User(id,name)
getId()=id
getName()=name
toString():String="User("+id+", "+name+")"
equals(o):bool
if o is type User
return id==o.id and name==o.name
return false
user = User(1, "avi")
user.getId()
user
user is type User
s = 2
s is type User
data class User(id:int, name)
user = User(id=1, name="shanks")
user.name
var square = (a) -> a*a
square(5)
var add = (a,b) -> a+b
add(5,6)
Please visit http://latte-lang.org/ for more.