MPL Documentation

Hybrid Operations

Modern Pascal is named so, as it incorporates modern syntax from other programming languages. Most of these are what we call MACRO aliases, as the functionality already exists, however, there are a few operators that provide new functionality to the original Pascal language.
  1. Aliases
    Alias Original Description
     <<  shl  bitshift the number on the left by the number on the right
     >>  shr  bitshift the number on the left by the number on the right
     ==  =  Comparison equal sign
     !=  <>  Comparison of not equal
     %  mod  Perform modulus
     !  not  Opposite of the current value
  2. Operators
    Alias Original Description
      =  :=  Store to the value on the left, by adding the right.
     -=  := -  Store to the value on the left, by subtracting the right.
     *=  := *  Store to the value on the left, by multiplying the right.
     /=  := /  Store to the value on the left, by dividing the right.
  3. Comments
    Alias Original Description
     /*  (*  Start of a C-style comment block.
     */  *)  End of a C-style comment block.

Optional Grammar

The following are accepted into the existing lexicon as Modern Pascal.
  1. When doing a for loop, the variable can be defined inline. for var loop:=start to end.
The following are in a special build of the product, seeing if these grammar changes will cause major problems for anyone.
  1. then - if your code is formatted with parenthesis for the comparison, the conjunctive adverb is optional.
  2. do - if your code if formatted with parenthesis on a while loop, then conjunctive adverb is optional.