Dashboard > Mantra > ... > Documentation > Types
  Mantra Log In | Sign Up   View a printable version of the current page.  
  Types
Added by Terence Parr, last edited by Terence Parr on Nov 03, 2007  (view change)
Labels: 
(None)

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]
Site powered by a free Open Source Project / Non-profit License (more) of Confluence - the Enterprise wiki.
Learn more or evaluate Confluence for your organisation.
Powered by Atlassian Confluence, the Enterprise Wiki. (Version: 2.5.1 Build:#806 May 06, 2007) - Bug/feature request - Contact Administrators