Versions Compared

Key

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

...

  1. With only one argument
  2. With two or more arguments
Code Block
borderStylesolid
titleprint Example
borderStylesolid
print "Hello there"
print "Hello", "there"
No Format
bgColor#D8DDE9
titleOutput
borderStylesolid
titleOutput
Hello there
Hello there

In the second case, for every case except the last, it will write the string to the screen, write a space, then move on.

...

assert can be called with one or two arguments.
The first argument must always be a boolean condition.
The optional second argument is a string that will be sent if the condition fails.

Code Block
borderStylesolid
titleassert Example
borderStylesolid
assert true // this will always pass
assert false, "message" // this will always fail
No Format
bgColor#D8DDE9
titleOutput
borderStylesolid
titleOutput
Boo.Lang.Runtime.AssertionFailedException: message
   at Tutorial.Main(String[] argv)

...

In all three of these, it checks if the underlying object is an IDisposable, which it then disposes of afterward.

Code Block
borderStylesolid
titleusing Example
borderStylesolid
import System.IO

using w = StreamWriter("test.txt"):
    w.WriteLine("Hello there!")

...

lock must accept at least one argument, and it will put the lock on all that are given.

Code Block
borderStylesolid
titlelock Example
borderStylesolid
lock database:
    database.Execute("""
        UPDATE messages
        SET
            id = id + 1""")

...