1

我想在 boo 语言中使用 out 关键字,但没有与此关键字相关的选项。如何在 boo 语言中使用它。

4

1 回答 1

2

Boo doesn't support out, but the ref keyword, which you can use instead.

Example:

def Swap(ref a as int, ref b as int):
    t = a
    a = b
    b = t

x = 1
y = 2
Swap(x, y)
于 2012-07-04T14:57:52.653 回答