Versions Compared

Key

  • This line was added.
  • This line was removed.
  • Formatting was changed.
Comment: Migrated to Confluence 5.3

Triple quoted strings in Boo are used to preserve spacing and linebreaks without a thick slathering of \n's all over your precious code.

It is good for visually representing XML, for instance:

Code Block
xml = """
<xml>
     <randomElement>
     </randomElement>
</xml>
"""

It is also most excellent for formatting console output:

Code Block
name = prompt("Name: ")
age = prompt("Age: ")
sex = prompt("Sex: ")

print """

Hello, ${name}!

My name is Hal, and I will be your Operating System today.

My sensors indicate that you are a ${age} year old ${sex}

If you need any assistance navigating this user interface, please ask.

...

Humans are so fragile...

"""