Types

Mantra has a number of built-in types so far: object, int, char, string, list, dict, tree as well as some I/O objects.

There are no arrays in Mantra, only lists:

list names = ["Jim", "Ashar"];

Strings and ints etc.. are immutable but you can use mustring and mutint:

mutint i = mutint(34);
i++;  // can't do this with ints
println(i); // emits 35
mustring s = mustring("hi");
s += "mom";
println(s); // emits "himom\n"

emits

35
[hi, mom]
Enter labels to add to this page:
Please wait 
Looking for a label? Just start typing.