Getting Started Documentation Glish Learn More Programming Contact Us
Version 1.9 Build 1556
News FAQ
Search Home


next up previous contents index
Next: Functions Up: Statements Previous: Sending and Receiving Events


Leaving Out the Statement Terminator

Glish has a simple rule for when the ; terminating a statement can be left out. In general, if a line ends with a token that suggests continuation (such as a comma or a binary operator) the statement continues onto the next line. A semi-colon is inserted if it ends with something that could come at the end of a statement. Those tokens that can end a statement are:

Glish inserts ;'s only at the end of a line or just before a ``{". You cannot use these rules to jam two statements onto one line:

    print a b := 3
is illegal, though both
    print a; b := 3
and
    { print a } b := 3
are perfectly okay.

You can prevent Glish from inserting a ; by using an escape (\) as the last character of a line. For example,

    print a \
        , b
is okay, and equivalent to
    print a,
        b
or
    print a, b
A final \ doesn't work after a comment. For example:
    print a   # oops, syntax error next line \
        , b
is interpreted as two separate statements, the second statement produces a syntax error.


next up previous contents index
Next: Functions Up: Statements Previous: Sending and Receiving Events   Contents   Index
Please send questions or comments about AIPS++ to aips2-request@nrao.edu.
Copyright © 1995-2000 Associated Universities Inc., Washington, D.C.

Return to AIPS++ Home Page
2006-10-15