Is there something similar in XSharp?Often when deconstructing a tuple or calling a method with out parameters, you're forced to define a variable whose value you don't care about and don't intend to use. C# adds support for discards to handle this scenario. A discard is a write-only variable whose name is _ (the underscore character); you can assign all of the values that you intend to discard to the single variable. A discard is like an unassigned variable; apart from the assignment statement, the discard can't be used in code.
In some cases, this is convenient when overloading methods/functions.
Code: Select all
function MyFunc(x as int, additionalResult out int) as logic
...
return true
function MyFunc(x as int) as logic
local additionalResult as int
return MyFunc(x, out additionalResult)
Best regards,
Leonid