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

Mantra has post-increment and decrement statements, assignments, pipelines, method call statements, while, if, return, break, continue, ';' empty statement, {..} compound statements, and native java blocks. There is a supercharged for-each statement:

// print set elements 3 times
  set names = set("Ter", "Tom", "Sriram", "Kay");
  for (String name in names) {
          println(name);
  }
  names:println;
  names:{String n | println(n);};

also has conditional:

for (string filename in OS.dir(".") where File(filename).isDir()) {
    tester.testDir(filename);
  }
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