Skip to content

Language Guide: Macros

rollynoel edited this page Jun 18, 2013 · 3 revisions

Added by Bill Wood

Print

print

System.Console.WriteLine()

print

System.Console.WriteLine(<expr>)

print , [... ,]

System.Console.Write(<expr>)
System.Console.Write(' ')
 ...
System.Console.WriteLine(<exprN>)

assert

assert

unless (<expr>):
    raise Boo.AssertionFailedException('(<expr>)')

assert ,

unless (<expr>):
    raise Boo.AssertionFailedException(<string>)

using

using:

try:
    <block>
ensure:
    pass

using [, ...]:

try:
    <block>
ensure:
    if (__disposable__ = (<object> as System.IDisposable)):
        __disposable__.Dispose()
        __disposable__ = null
	...

using = [, ...]:

try:
    __using1__ = <expr>
    ...
    <block>
ensure:
    if (__disposable__ = (__using1__ as System.IDisposable)):
        __disposable__.Dispose()
        __disposable__ = null
	...

lock

lock [, ...]:

_monitor1__ = <expr>
System.Threading.Monitor.Enter(__monitor1__)
try:
    <block>
ensure:
    System.Threading.Monitor.Exit(__monitor1__)

debug

debug

System.Diagnostics.Debug.WriteLine('<debug>')

debug

System.Diagnostics.Debug.WriteLine(<expr>)

debug , [... ,]

System.Diagnostics.Debug.Write(<expr>)
System.Diagnostics.Debug.Write(' ')
 ...
System.Diagnostics.Debug.WriteLine(<exprN>)
Clone this wiki locally