Search                        Top                                  Index
HELP COMMENT                                            A. Sloman, March 1983

There are two ways of putting comments in POPLOG programs. One is to use the
'end of line' comment and tge second is to use the comment brackets

        /*  .... */

-- END OF LINE COMMENTS -----------------------------------------------------

A standard end of line comment is indicated by three or more semi-colons,
e.g.

    99 =>    ;;; text to be ignored by POP-11
    ** 99

Alternatively, users can change the itemiser character-type of a character,
to make it an end of line comment character. E.g. to make the exclamation
mark indicate end of line comments do:

    9 -> item_chartype(`!`);

Thereafter text after "!" will be ignored.

For reasons to do with the syntax of  POP-11, if ";" has the type of end-of-
line comment, three occurrences are needed for a comment. This is not
required for other characters.

See REF *ITEMISE for more information on itemisation.

See alsoHELP
   *ITEM_CHARTYPE - on accessing and updating a character's 'type' information

-- MULTI-LINE COMMENTS ----------------------------------------------------

The second way to put comments in POP-11 programs is to use the comment
brackets. All text between the brackets is ignored by the compiler, e.g.

/*If this is found in the middle of a program,
  the compiler will ignore it*/

--- POP-2 COMMENTS ---------------------------------------------------------

In POP-2 there was a macro called COMMENT.  This can only be used if you have
loaded the library package *POP2.  The macro reads in text items up to the
next semi-colon; these items are ignored by the compiler.  If you want a
comment to include illustrative POP-11 examples, including semi-colons, you
should include that portion of the comment in a string, e.g.

    comment
    '
            ;;; Here is how to define a procedure
            define sq(x) -> y;
                x * x -> y;
            enddefine;
    '
    ;

Words and strings read in by this macro will eventually be garbage-collected.

See HELP *MACROS for use and construction of MACROS in POP-11