Syntax Overview

The syntax of ISETL resembles that of standard mathematical notation. This makes ISETL an appropriate language for learning abstract algebra, calculus, discrete math, finite math, linear algebra, statistics, or any other type of mathematics.

Experience in programming (C/C++, Java, Pascal, etc.) is helpful, but not necessary to learn ISETL. The following examples will briefly describe the syntax of ISETL statements. For more details see the other Help entries under Language Reference and the very detailed ISETL Manual by Gary Levin (from August,1990).

Semicolons

ISETL statements must end with a semicolon. The following are three valid statements:

1+1;
writeln "Hello";
x := 4 * 6;

Forgetting a semicolon often won't cause an error, but rather ISETL will expect more input and provide a >> double-prompt (see the second example under item 2. in Prompts).

Prompts

ISETL will display prompts when it is waiting for input. ISETL uses 4 different prompts.

  1. > (a single greater-than) is the basic ISETL prompt. This means that ISETL is done executing statements and is waiting to receive more.

    Example:
    >  1+1;
    2;
    >        (cursor is here waiting for user input)

  2. >> (a double greater-than) is a prompt which means that ISETL has started to execute a command, but needs more information. This is commonly seen in func and proc definitions, or when the user forgot to type a semicolon at the end of a statement.

    Example:
    >  p := proc();
    >>  writeln "Inside proc";
    >>  end proc;
    >        (cursor is here waiting for user input)

    Example:
    >  1+1        (note missing semicolon)
    >>  ;        (after >>, user typed the semicolon)
    2;
    >        (cursor is here waiting for user input)

  3. ? (a question mark) is a prompt given during a read statement. ? prompts are only given in the execution window.

    Example:
    >  read x,y;
    ?  1;
    ?  "hello";
    >        (cursor is here waiting for user input)

  4. ?? (a double question mark) is similar to the >> prompt. ?? is given during a read statement which needs more data. This prompt can also be given when a semicolon has been left off of the end of input. ?? prompts are only given in the execution window.

    Example:
    >  read x;
    ?  1        (note missing semicolon)
    ??  ;        (after ?? user typed the semicolon)
    >        (cursor is here waiting for user input)

Predefined Routines

ISETL has many predefined functions.

Example:
>  x := tan(1);
>  x;
1.557;
>        (cursor is here waiting for user input)

Example:
>  odd(3);
true;
>        (cursor is here waiting for user input)

Directives

Directives are special commands used by ISETL to control its behavior and implement special features. Directives are preceded by a ! (an exclamation point). Note that while ISETL statements require a semicolon at the end, ISETL directives do not (and adding one will sometimes generate an error).

Example:
>  !include MySavedStuff.stl
!include MySavedStuff.stl completed
>  

Example:
>  S := {1..5};
>  !setrandom on
>  S;
{4,1,3,5,2};
>  !setrandom off
>  S;
{1,2,3,4,5};
>  

See also the other Help entries under Language Reference and the very detailed ISETL Manual by Gary Levin.