YOU ARE VIEWING DOCUMENTATION FOR ioL v.1. Click here for documentation for older v.0.9x versions of ioL.
ioL

Programming manual (doc.iol.science)



Comments

Any program output enclosed between an opening <! and a closing !> is completely ignored by ioL.

<!This is an ioL comment.!>

You can write anything you want in there and ioL doesn't care. It will not even be printed to the screen. ioL will simply discard it. Comments are useful for two reasons:

  1. To mark notes in your output for the benefit of debugging, or to help your future employees understand why you did that thing. (Once you are a millionaire from writing ioL programs, you will be able to hire people to maintain your software for you. They will be able to read the comments you left in the output to understand why you did it that way.) These comments should be useful and provide the code maintainer with information that they wouldn't necessarily notice just glancing at your markup code.
  2. For experimenting with enabling and disabling bits of output, without deleting them entirely.
You cannot nest one comment inside another comment. ioL will simply end the comment at the first !> it sees, and will not recognise that you had placed two comments inside each other.

Review

  1. What will the following fragment of C code display on the screen when you run the program in an ioL console? (And what will you see if if you run your program in a plain-text TTY to view the raw output?)
        printf(
            "He<! hails from Snowy River, up by Kosciusko's side,\n"
            "Where the hi!>ll<!s are twice as steep and twice as r!>o<!ugh,\n"
            "Where a horse's hoofs strike firelight from!> the<! flint stones every stride,\n"
            "The man that holds his own is good enough.\n"
            "And the Snowy River riders on the mountains make their home,\n"
            "Whe!>re!<! the river runs those giant hills between;\n"
            "I have seen full many horsemen since I first commenced to roam,\n"
            "But nowhere yet such horsemen have I seen.!>\n"
        );
    
    Rather than one multi-line printf() statement in C, we could also have split this into multiple printf() statements instead.
    ioL doesn't really care how you print, as long as the right characters come out of your program. However it is good practice to keep your code as neat as possible.
  2. Try it! Insert this code fragment into a main() function, and add in some way of preventing the program from ending immediately after the output is printed to the screen, so that you will be able to see the result in the ioL console before the program ends. Try running your program both in the TTY terminal and in an ioL environment.
This was a silly example. In real programming, you should use comments to help clarify your code, not to make it more confusing!

What, you were expecting Hello world again?