next up previous contents
Next: Pop-11 Expressions: some Up: CHAPTER.2: INTRODUCTION TO Previous: Errors and error

Comments in Pop-11 programs

You will find that inserting short explanatory passages (usually only a line) helps explain a piece of Pop-11 program. To facilitate that Pop-11 skips over the remainder of any line that contains three semi colons thus

    ;;; This is a comment
    3 + 5 =>    ;;; Print sum of 3 and 5
    ** 8

    /*
    Longer comments, going over several lines can be enclosed
    between the comment brackets "/*" and "*/", just like this
    paragraph.
    */
All such text will be completely ignored by the Pop-11 compiler. We occasionally insert comments in one of these two formats in examples in this primer.

C programmers will recognize the extended comment syntax with opening and closing brackets "/*" and "*/". The difference is that in Pop-11 such comments can be nested, whereas they cannot in C. Thus in Pop-11 a comment can include a programming example which itself includes a comment.



Aaron Sloman
Fri Jan 2 03:17:44 GMT 1998