Up

10.6.1  Code Blocks

Mythryl code blocks are much like those of C or Perl. They consist of one or more statements enclosed in curly braces.

Every Mythryl statement without exception ends with a semicolon; this is different from C or Perl, in which some statements end with semicolons and some do not, without any particularly clear pattern. The simplest statement is just an expression terminated by a semicolon.

Mythryl blocks differ from those of C or Perl in that the value of a Mythryl block is always that of the last statement in the block:

    linux$ my

    eval:  { 1; 2; 3; }

    3

A Mythryl block is an expression, and may be used anywhere that an expression is syntactically legal:

    linux$ my

    eval:  { 1; 2; 3; } + { 1; 2; 3; }

    6

Comments and suggestions to: bugs@mythryl.org

Up